adityapooniya / base2

Automatically exported from code.google.com/p/base2
0 stars 0 forks source link

I found bug with getAttribute/setAttribute in IE6 #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I found bug with getAttribute/setAttribute in IE6.

My code is:

{{{
<!doctype html>

<html>
  <head>
  <title>&laquo;Testing&raquo;</title>
  <meta charset="UTF-8">
  <script type="text/javascript"
src="http://base2.googlecode.com/svn/trunk/lib/base2-dom-fp.js"></script>
  <script type="text/javascript">

  new function(_) {
      base2.DOM.bind(document);

      eval(base2.namespace);
      eval(DOM.namespace);

      document.addEventListener("DOMContentLoaded", function(event) {
          forEach (document.matchAll("input[class$=button]:not([title])"),
function(element) {
              element.setAttribute("title", element.getAttribute("value"));
          });
      }, false);
  }

  </script>

<body>

  <form action="" method="post">
    <p><input type="submit" value="Sending" class="button"></p>
  </form>
}}}

Title attribute must be the same like value, but doesn't.
In firefox works well.

OS: Windows XP SP2
Browser: IE 6.0.2900.2180.xpsp_sp2_gdr.070227-2254

Original issue reported on code.google.com by dwarf...@gmail.com on 29 Aug 2007 at 10:40

GoogleCodeExporter commented 9 years ago

Original comment by dean.edw...@gmail.com on 30 Aug 2007 at 3:41

GoogleCodeExporter commented 9 years ago

Original comment by dean.edw...@gmail.com on 14 Sep 2007 at 7:18

GoogleCodeExporter commented 9 years ago
This should be fixed now.

Original comment by dean.edw...@gmail.com on 19 Dec 2007 at 9:20

GoogleCodeExporter commented 9 years ago
I checked the latest revision. Error still there.

element.getAttribute ( "value") returns null in IE. In a browser Firefox2, 
Firefox3 beta2, Safari3 returns the string "Sending".

OS: Windows XP SP2
IE: 6.0.2900.2180.xpsp_sp2_gdr.070227-2254

<!doctype html>

<html>
  <head>
  <title>«Testing»</title>
  <meta charset="UTF-8">
  <script type="text/javascript" src="http://base2.googlecode.com/svn/trunk/lib/base2-dom-fp.js"></script>
  <script type="text/javascript">

  new function(_) {
      base2.DOM.bind(document);

      eval(base2.namespace);
      eval(DOM.namespace);

      document.addEventListener("DOMContentLoaded", function(event) {
          forEach (document.querySelectorAll("input[class$=button]:not([title])"), function(element) {
              alert(element.getAttribute("value")); // return null
              alert(element.value);                            // return "Sending"
              element.setAttribute("title", element.getAttribute("value"));
          });
      }, false);
  }

  </script>

<body>

  <form action="" method="post">
    <p><input type="submit" value="Sending" class="button"></p>
  </form>

Original comment by dwarf...@gmail.com on 20 Dec 2007 at 9:27

GoogleCodeExporter commented 9 years ago
OK. I'll take a look.

Original comment by dean.edw...@gmail.com on 20 Dec 2007 at 11:09

GoogleCodeExporter commented 9 years ago
I'm pretty sure this is fixed now. For some reason the value property never has 
its
"specified" property set. So I had to add a special check just for this 
circumstance.
Grr.

Original comment by dean.edw...@gmail.com on 20 Dec 2007 at 7:53

GoogleCodeExporter commented 9 years ago
Confirm all fine now

Original comment by dwarf...@gmail.com on 20 Dec 2007 at 8:06