Bug 583514 - implement click and accesskey for all HTML elements r=smaug
☠☠ backed out by e838e2dc618e ☠ ☠
authorDavid Zbarsky <dzbarsky@gmail.com>
Thu, 07 Apr 2011 21:52:08 -0700
changeset 67643 4910cd19bc9a2d6caf5950a6abac38a91ca74871
parent 67642 789f731f215e355a0f07aab1165d85d9f7497d86
child 67644 8b6d59ff790fb60848fe8171c023a366b0b2effa
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs583514
milestone2.2a1pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 583514 - implement click and accesskey for all HTML elements r=smaug
accessible/src/html/nsHTMLFormControlAccessible.cpp
content/base/public/nsINode.h
content/base/src/nsDocumentFragment.cpp
content/base/src/nsGenericElement.cpp
content/events/test/test_bug409604.html
content/html/content/reftests/409604-1-ref.html
content/html/content/reftests/409604-1.html
content/html/content/reftests/583514-1-ref.html
content/html/content/reftests/583514-1.html
content/html/content/reftests/583514-2-ref.html
content/html/content/reftests/583514-2.html
content/html/content/reftests/reftest.list
content/html/content/src/nsGenericHTMLElement.cpp
content/html/content/src/nsGenericHTMLElement.h
content/html/content/src/nsHTMLAnchorElement.cpp
content/html/content/src/nsHTMLAreaElement.cpp
content/html/content/src/nsHTMLButtonElement.cpp
content/html/content/src/nsHTMLInputElement.cpp
content/html/content/src/nsHTMLInputElement.h
content/html/content/src/nsHTMLLabelElement.cpp
content/html/content/src/nsHTMLLegendElement.cpp
content/html/content/src/nsHTMLLegendElement.h
content/html/content/src/nsHTMLSelectElement.cpp
content/html/content/src/nsHTMLTextAreaElement.cpp
content/html/content/test/test_bug583514.html
dom/interfaces/html/nsIDOMHTMLAnchorElement.idl
dom/interfaces/html/nsIDOMHTMLAppletElement.idl
dom/interfaces/html/nsIDOMHTMLAreaElement.idl
dom/interfaces/html/nsIDOMHTMLAudioElement.idl
dom/interfaces/html/nsIDOMHTMLBRElement.idl
dom/interfaces/html/nsIDOMHTMLBaseElement.idl
dom/interfaces/html/nsIDOMHTMLBodyElement.idl
dom/interfaces/html/nsIDOMHTMLButtonElement.idl
dom/interfaces/html/nsIDOMHTMLCanvasElement.idl
dom/interfaces/html/nsIDOMHTMLCollection.idl
dom/interfaces/html/nsIDOMHTMLDListElement.idl
dom/interfaces/html/nsIDOMHTMLDataListElement.idl
dom/interfaces/html/nsIDOMHTMLDirectoryElement.idl
dom/interfaces/html/nsIDOMHTMLDivElement.idl
dom/interfaces/html/nsIDOMHTMLElement.idl
dom/interfaces/html/nsIDOMHTMLEmbedElement.idl
dom/interfaces/html/nsIDOMHTMLFieldSetElement.idl
dom/interfaces/html/nsIDOMHTMLFontElement.idl
dom/interfaces/html/nsIDOMHTMLFormElement.idl
dom/interfaces/html/nsIDOMHTMLFrameElement.idl
dom/interfaces/html/nsIDOMHTMLFrameSetElement.idl
dom/interfaces/html/nsIDOMHTMLHRElement.idl
dom/interfaces/html/nsIDOMHTMLHeadElement.idl
dom/interfaces/html/nsIDOMHTMLHeadingElement.idl
dom/interfaces/html/nsIDOMHTMLHtmlElement.idl
dom/interfaces/html/nsIDOMHTMLIFrameElement.idl
dom/interfaces/html/nsIDOMHTMLImageElement.idl
dom/interfaces/html/nsIDOMHTMLInputElement.idl
dom/interfaces/html/nsIDOMHTMLIsIndexElement.idl
dom/interfaces/html/nsIDOMHTMLLIElement.idl
dom/interfaces/html/nsIDOMHTMLLabelElement.idl
dom/interfaces/html/nsIDOMHTMLLegendElement.idl
dom/interfaces/html/nsIDOMHTMLLinkElement.idl
dom/interfaces/html/nsIDOMHTMLMapElement.idl
dom/interfaces/html/nsIDOMHTMLMediaElement.idl
dom/interfaces/html/nsIDOMHTMLMenuElement.idl
dom/interfaces/html/nsIDOMHTMLMetaElement.idl
dom/interfaces/html/nsIDOMHTMLModElement.idl
dom/interfaces/html/nsIDOMHTMLOListElement.idl
dom/interfaces/html/nsIDOMHTMLObjectElement.idl
dom/interfaces/html/nsIDOMHTMLOptGroupElement.idl
dom/interfaces/html/nsIDOMHTMLOptionElement.idl
dom/interfaces/html/nsIDOMHTMLOutputElement.idl
dom/interfaces/html/nsIDOMHTMLParagraphElement.idl
dom/interfaces/html/nsIDOMHTMLParamElement.idl
dom/interfaces/html/nsIDOMHTMLPreElement.idl
dom/interfaces/html/nsIDOMHTMLQuoteElement.idl
dom/interfaces/html/nsIDOMHTMLScriptElement.idl
dom/interfaces/html/nsIDOMHTMLSelectElement.idl
dom/interfaces/html/nsIDOMHTMLSourceElement.idl
dom/interfaces/html/nsIDOMHTMLStyleElement.idl
dom/interfaces/html/nsIDOMHTMLTableCaptionElem.idl
dom/interfaces/html/nsIDOMHTMLTableCellElement.idl
dom/interfaces/html/nsIDOMHTMLTableColElement.idl
dom/interfaces/html/nsIDOMHTMLTableElement.idl
dom/interfaces/html/nsIDOMHTMLTableRowElement.idl
dom/interfaces/html/nsIDOMHTMLTableSectionElem.idl
dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl
dom/interfaces/html/nsIDOMHTMLTitleElement.idl
dom/interfaces/html/nsIDOMHTMLUListElement.idl
dom/interfaces/html/nsIDOMHTMLVideoElement.idl
dom/interfaces/html/nsIDOMNSHTMLElement.idl
dom/interfaces/html/nsIDOMNSHTMLHRElement.idl
--- a/accessible/src/html/nsHTMLFormControlAccessible.cpp
+++ b/accessible/src/html/nsHTMLFormControlAccessible.cpp
@@ -543,17 +543,17 @@ NS_IMETHODIMP nsHTMLTextFieldAccessible:
     return NS_OK;
   }
   return NS_ERROR_INVALID_ARG;
 }
 
 NS_IMETHODIMP nsHTMLTextFieldAccessible::DoAction(PRUint8 index)
 {
   if (index == 0) {
-    nsCOMPtr<nsIDOMNSHTMLElement> element(do_QueryInterface(mContent));
+    nsCOMPtr<nsIDOMHTMLElement> element(do_QueryInterface(mContent));
     if ( element ) {
       return element->Focus();
     }
     return NS_ERROR_FAILURE;
   }
   return NS_ERROR_INVALID_ARG;
 }
 
--- a/content/base/public/nsINode.h
+++ b/content/base/public/nsINode.h
@@ -166,17 +166,17 @@ enum {
   NODE_NEEDS_FRAME =             0x00080000U,
 
   // At least one descendant in the flattened tree has NODE_NEEDS_FRAME set.
   // This should be set on every node on the flattened tree path between the
   // node(s) with NODE_NEEDS_FRAME and the root content.
   NODE_DESCENDANTS_NEED_FRAMES = 0x00100000U,
 
   // Set if the node is an element.
-  NODE_IS_ELEMENT              = 0x00200000U,
+  NODE_HANDLING_CLICK          = 0x00200000U,
   
   // Set if the node has the accesskey attribute set.
   NODE_HAS_ACCESSKEY           = 0x00400000U,
 
   // Set if the node has the accesskey attribute set.
   NODE_HAS_NAME                = 0x00800000U,
 
   // Two bits for the script-type ID.  Not enough to represent all
@@ -316,17 +316,18 @@ public:
 #ifdef MOZILLA_INTERNAL_API
   nsINode(already_AddRefed<nsINodeInfo> aNodeInfo)
   : mNodeInfo(aNodeInfo),
     mParentPtrBits(0),
     mFlagsOrSlots(NODE_DOESNT_HAVE_SLOTS),
     mNextSibling(nsnull),
     mPreviousSibling(nsnull),
     mFirstChild(nsnull),
-    mNodeHasRenderingObservers(false)
+    mNodeHasRenderingObservers(false),
+    mIsElement(false)
   {
   }
 
 #endif
 
   virtual ~nsINode();
 
   /**
@@ -369,17 +370,17 @@ public:
    * @return whether the content matches ALL flags passed in
    */
   virtual PRBool IsNodeOfType(PRUint32 aFlags) const = 0;
 
   /**
    * Return whether the node is an Element node
    */
   PRBool IsElement() const {
-    return HasFlag(NODE_IS_ELEMENT);
+    return mIsElement;
   }
 
   /**
    * Return this node as an Element.  Should only be used for nodes
    * for which IsElement() is true.
    */
   mozilla::dom::Element* AsElement();
 
@@ -1282,16 +1283,17 @@ protected:
   PtrBits mFlagsOrSlots;
 
   nsIContent* mNextSibling;
   nsIContent* mPreviousSibling;
   nsIContent* mFirstChild;
 
   // More flags
   bool mNodeHasRenderingObservers : 1;
+  bool mIsElement : 1;
 };
 
 
 extern const nsIID kThisPtrOffsetsSID;
 
 // _implClass is the class to use to cast to nsISupports
 #define NS_OFFSET_AND_INTERFACE_TABLE_BEGIN_AMBIGUOUS(_class, _implClass)     \
   static const QITableEntry offsetAndQITable[] = {                            \
--- a/content/base/src/nsDocumentFragment.cpp
+++ b/content/base/src/nsDocumentFragment.cpp
@@ -182,17 +182,17 @@ NS_NewDocumentFragment(nsIDOMDocumentFra
   NS_ADDREF(*aInstancePtrResult = it);
 
   return NS_OK;
 }
 
 nsDocumentFragment::nsDocumentFragment(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericElement(aNodeInfo)
 {
-  UnsetFlags(NODE_IS_ELEMENT);
+  mIsElement = false;
 }
 
 nsDocumentFragment::~nsDocumentFragment()
 {
 }
 
 PRBool
 nsDocumentFragment::IsNodeOfType(PRUint32 aFlags) const
--- a/content/base/src/nsGenericElement.cpp
+++ b/content/base/src/nsGenericElement.cpp
@@ -2155,18 +2155,18 @@ nsGenericElement::nsDOMSlots::~nsDOMSlot
   }
 }
 
 nsGenericElement::nsGenericElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : Element(aNodeInfo)
 {
   // Set the default scriptID to JS - but skip SetScriptTypeID as it
   // does extra work we know isn't necessary here...
-  SetFlags(NODE_IS_ELEMENT |
-           (nsIProgrammingLanguage::JAVASCRIPT << NODE_SCRIPT_TYPE_OFFSET));
+  SetFlags(nsIProgrammingLanguage::JAVASCRIPT << NODE_SCRIPT_TYPE_OFFSET);
+  mIsElement = true;
 }
 
 nsGenericElement::~nsGenericElement()
 {
   NS_PRECONDITION(!IsInDoc(),
                   "Please remove this from the document properly");
 }
 
--- a/content/events/test/test_bug409604.html
+++ b/content/events/test/test_bug409604.html
@@ -17,24 +17,21 @@ https://bugzilla.mozilla.org/show_bug.cg
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
   /** Test for Bug 409604 **/
 
   var modifier = Components.interfaces.nsIDOMNSEvent.ALT_MASK |
                  Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
-  var expectedFocus = "d,g,h,k,l,m,n";
+  var expectedFocus = "a,c,d,e,f,g,h,i,j,k,l,m,n,p,x,y";
   // XXX the "map" test is causing trouble, see bug 433089
-  // var expectedClick = "a,b,c,e,f,i,j";
-  var expectedClick = "a,c,e,f,i,j";
   var focusArray = expectedFocus.split(",");
-  var clickArray = expectedClick.split(",");
-  var invalidElementId = "invalid";
-  var invalidTags = [
+  var unfocusableElementId = "invalid";
+  var unfocusableTags = [
       {tag: "abbr", content: "text", attribs: {title: "something"}},
       {tag: "acronym", content: "text", attribs: {title: "something"}},
       {tag: "address", content: "text"},
       {tag: "b", content: "text"},
       {tag: "bdo", content: "text"},
       {tag: "big", content: "text"},
       {tag: "blockquote", content: "text"},
       {tag: "caption", content: "text", parent: "table", where: "first"},
@@ -58,25 +55,23 @@ https://bugzilla.mozilla.org/show_bug.cg
       {tag: "hr"},
       {tag: "i", content: "text"},
       {tag: "img", attribs: {src: "any.png", alt: "image"}},
       {tag: "ins", content: "text"},
       {tag: "kbd", content: "text"},
       {tag: "li", content: "text", parent: "ol"},
       {tag: "li", content: "text", parent: "ul"},
       {tag: "noscript", content: "text"},
-      {tag: "object", content: "text"},
       {tag: "ol", content: "<li>text</li>"},
       {tag: "optgroup", content: "<option>text</option>", attribs: {label: "some label"}, parent: "select"},
       {tag: "option", content: "text", parent: "select"},
       {tag: "p", content: "text"},
       {tag: "pre", content: "text"},
       {tag: "q", content: "text"},
       {tag: "samp", content: "text"},
-      {tag: "select", content: "<option>text</option>"},
       {tag: "small", content: "text"},
       {tag: "span", content: "text"},
       {tag: "strong", content: "text"},
       {tag: "sub", content: "text"},
       {tag: "sup", content: "text"},
       {tag: "tt", content: "text"},
       {tag: "ul", content: "<li>text</li>"},
       {tag: "var", content: "text"}
@@ -128,19 +123,16 @@ https://bugzilla.mozilla.org/show_bug.cg
     } else {
       ok(expected == e.accessKey, "(focus) unexpected element: " + e.accessKey +
          " expected: " + expected);
     }
   }
 
   function handleClick(e) {
     ok("accessKey" in e, "(click) accesskey property not found on element");
-    var expected = clickArray.shift();
-    ok(expected == e.accessKey, "(click) unexpected element: " + e.accessKey +
-       " expected: " + expected);
   }
 
   function handleInvalid(e) {
     ok("accessKey" in e, "(invalid) accesskey property not found on element");
     ok(false, "(invalid) accesskey should not have any effect on this element: " +
        e.localName);
   }
 
@@ -149,40 +141,39 @@ https://bugzilla.mozilla.org/show_bug.cg
     // Send key events.
     var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
                        getInterface(Components.interfaces.nsIDOMWindowUtils);
     utils.sendKeyEvent("keydown", key, key, modifier);
     utils.sendKeyEvent("keypress", key, key, modifier);
     utils.sendKeyEvent("keyup", key, key, modifier);
   }
 
-  function testValidElements() {
-    for (var code = "a".charCodeAt(0); code <= "o".charCodeAt(0); ++ code) {
+  function testFocusableElements() {
+    for (var code = "a".charCodeAt(0); code <= "y".charCodeAt(0); ++ code) {
       // XXX the "map" test is causing trouble, see bug 433089
       if (code == "b".charCodeAt(0))
         continue;
       pressAccessKey(code);
     }
     ok(focusArray.length == 0, "(focus) unhandled elements remaining: " + focusArray.join(","));
-    ok(clickArray.length == 0, "(click) unhandled elements remaining: " + clickArray.join(","));
   }
 
-  function createInvalidElement(elem, accesskey) {
-    ok("tag" in elem, "invalid object passed to createInvalidElement: " + elem.toString());
+  function createUnfocusableElement(elem, accesskey) {
+    ok("tag" in elem, "invalid object passed to createUnfocusableElement: " + elem.toString());
     var e = document.createElement(elem.tag);
     if ("content" in elem) {
       e.innerHTML = elem.content;
     }
     if ("attribs" in elem) {
       for (var attr in elem.attribs) {
         e.setAttribute(attr, elem.attribs[attr]);
       }
     }
     e.setAttribute("accesskey", accesskey);
-    e.setAttribute("onclick", "handleInvalid(event.target); event.preventDefault();");
+    e.setAttribute("onclick", "handleClick(event.target); event.preventDefault();");
     e.setAttribute("onfocus", "handleInvalid(event.target);");
     var parent = null;
     var elementToInsert = null;
     if ("parent" in elem) {
       parent = document.getElementById(elem.parent);
       elementToInsert = e;
     } else {
       parent = document.getElementById("tbody");
@@ -191,58 +182,58 @@ https://bugzilla.mozilla.org/show_bug.cg
       td.textContent = elem.tag;
       elementToInsert.appendChild(td);
       td = document.createElement("td");
       td.appendChild(e);
       elementToInsert.appendChild(td);
     }
     ok(parent != null, "parent element not specified for element: " + elem.tag);
     ok(elementToInsert != null, "elementToInsert not specified for element: " + elem.tag);
-    elementToInsert.setAttribute("id", invalidElementId);
+    elementToInsert.setAttribute("id", unfocusableElementId);
     if ("where" in elem) {
       if (elem.where == "first") {
         parent.insertBefore(elementToInsert, parent.firstChild);
       } else {
         ok(false, "invalid where value specified for element: " + elem.tag);
       }
     } else {
       parent.appendChild(elementToInsert);
     }
   }
 
-  function destroyInvalidElement() {
-    var el = document.getElementById(invalidElementId);
-    ok(el != null, "invalid element not found");
+  function destroyUnfocusableElement() {
+    var el = document.getElementById(unfocusableElementId);
+    ok(el != null, "unfocusable element not found");
     el.parentNode.removeChild(el);
-    ok(document.getElementById(invalidElementId) == null, "invalid element not properly removed");
+    ok(document.getElementById(unfocusableElementId) == null, "unfocusable element not properly removed");
   }
 
-  function testInvalidElements() {
+  function testUnfocusableElements() {
     var i, e;
-    for (i = 0; i < invalidTags.length; ++ i) {
-      createInvalidElement(invalidTags[i], "z");
+    for (i = 0; i < unfocusableTags.length; ++ i) {
+      createUnfocusableElement(unfocusableTags[i], "z");
       pressAccessKey("z".charCodeAt(0));
-      destroyInvalidElement();
+      destroyUnfocusableElement();
     }
     for (i = 0; i < invalidElements.length; ++ i) {
       e = document.getElementById(invalidElements[i]);
       ok(e != null, "element with ID " + invalidElements[i] + " not found");
       e.setAttribute("accesskey", "z");
-      e.setAttribute("onclick", "handleInvalid(event.target); event.preventDefault();");
+      e.setAttribute("onclick", "handleClick(event.target); event.preventDefault();");
       e.setAttribute("onfocus", "handleInvalid(event.target);");
       pressAccessKey("z".charCodeAt(0));
       e.removeAttribute("accesskey");
       e.removeAttribute("onclick");
       e.removeAttribute("onfocus");
     }
   }
 
   function start() {
-    testValidElements();
-    testInvalidElements();
+    testFocusableElements();
+    testUnfocusableElements();
     setOrRestoreContentAccess(0);
     SimpleTest.finish();
   }
 
   function doTest() {
     setOrRestoreContentAccess(5);
     setTimeout(start, 100);
   }
@@ -260,69 +251,154 @@ https://bugzilla.mozilla.org/show_bug.cg
       <tr><td id="td">Test footer</td><td></td></tr>
     </tfoot>
     <tbody id="tbody">
       <colgroup id="colgroup">
         <col id="col"></col>
         <col></col>
       </colgroup>
       <tr>
-        <td>a</td><td><a href="#" onclick="handleClick(event.target); return false;" accesskey="a">test link</a></td>
+        <td>a</td><td><a href="#" onclick="handleClick(event.target); return false;" accesskey="a" onfocus="handleFocus(event.target);">test link"</a></td>
       </tr>
 <!-- the "map" test is causing trouble, see bug 433089
       <tr>
         <td>area</td><td><img src="about:logo" width="300" height="236" usemap="#map">
           <map id="map" name="map"><area shape="rect" coords="0,0,82,126" href="#"
             onclick="handleClick(event.target); return false;" accesskey="b"></map>
         </td>
       </tr>
 -->
       <tr>
-        <td>button</td><td><button onclick="handleClick(event.target);" accesskey="c">test button</button></td>
+        <td>button</td><td><button onclick="handleClick(event.target);" accesskey="c" onfocus="handleFocus(event.target);">test button"</button></td>
       </tr>
       <tr>
-        <td>input type="text"</td><td><input type="text" value="" onfocus="handleFocus(event.target);" accesskey="d"></td>
+        <td>input type="text"</td><td><input type="text" value="" onclick="handleClick(event.target);" onfocus="handleFocus(event.target);" accesskey="d"></td>
       </tr>
       <tr>
-        <td>input type="button"</td><td><input type="button" value="type='button'" onclick="handleClick(event.target);" accesskey="e"></td>
+        <td>input type="button"</td><td><input type="button" value="type='button'" onclick="handleClick(event.target);" onfocus="handleFocus(event.target);" accesskey="e"></td>
       </tr>
       <tr>
-        <td>input type="checkbox"</td><td><input type="checkbox" onclick="handleClick(event.target);" accesskey="f"></td>
+        <td>input type="checkbox"</td><td><input type="checkbox" onclick="handleClick(event.target);" onfocus="handleFocus(event.target)" accesskey="f"></td>
       </tr>
       <tr>
-        <td>input type="radio"</td><td><input type="radio" name="radio" onfocus="handleFocus(event.target);" accesskey="g"></td>
+        <td>input type="radio"</td><td><input type="radio" name="radio" onclick="handleClick(event.target);" onfocus="handleFocus(event.target);" accesskey="g"></td>
       </tr>
       <tr>
-        <td>input type="password"</td><td><input type="password" onfocus="handleFocus(event.target);" accesskey="h"></td>
+        <td>input type="password"</td><td><input type="password" onclick="handleClick(event.target);" onfocus="handleFocus(event.target);" accesskey="h"></td>
       </tr>
       <tr>
-        <td>input type="submit"</td><td><input type="submit" value="type='submit'" onclick="handleClick(event.target); return false;" accesskey="i"></td>
+        <td>input type="submit"</td><td><input type="submit" value="type='submit'" onclick="handleClick(event.target); return false;" 
+                                               onfocus="handleFocus(event.target);" accesskey="i"></td>
       </tr>
       <tr>
-        <td>input type="reset"</td><td><input type="submit" value="type='reset'" onclick="handleClick(event.target);" accesskey="j"></td>
+        <td>input type="reset"</td><td><input type="submit" value="type='reset'" onclick="handleClick(event.target);" 
+                                              onfocus="handleFocus(event.target);" accesskey="j"></td>
       </tr>
       <tr>
-        <td>label</td><td><label accesskey="k">test label
-                          <input type="text" value="test for label" onfocus="handleFocus(event.target);"></label></td>
+        <td>label</td><td><label accesskey="k" onclick="handleClick(event.target);" onfocus="handleInvalid(event.target);">test label
+                          <input type="text" value="test for label" onfocus="handleFocus(event.target);" onclick="handleClick(event.target);"></label></td>
       </tr>
       <tr>
         <td>legend</td><td><fieldset><legend accesskey="l">test legend</legend>
-                           <input type="text" value="test for legend" onfocus="handleFocus(event.target);"></fieldset></td>
+                           <input type="text" value="test for legend" onfocus="handleFocus(event.target);" onclick="handleClick(event.target);" ></fieldset></td>
+      </tr>
+      <tr>
+        <td>textarea</td><td><textarea onfocus="handleFocus(event.target);" onclick="handleClick(event.target);" accesskey="m">test text</textarea></td>
+      </tr>
+      <tr>
+        <td>label (label invisible)</td><td><label for="txt1" accesskey="n" style="display:none"
+               onclick="handleClick(event.target);" onfocus="handleInvalid(event.target);">test label</label>
+                          <input type="text" id="txt1" value="test for label" onclick="handleClick(event.target);" onfocus="handleFocus(event.target);"></td>
+      </tr>
+      <tr>
+        <td>label (control invisible)</td><td><label for="txt2" accesskey="o"
+               onclick="handleClick(event.target);" onfocus="handleInvalid(event.target);">test label</label>
+                          <input type="text" id="txt2" value="test for label" onclick="handleClick(event.target);" 
+                                 onfocus="handleInvalid(event.target);" style="display:none"></td>
+      </tr>
+      <tr>
+        <td>select</td>
+        <td>
+            <select onclick="handleClick(event.target);" onfocus="handleFocus(event.target)" accesskey="p"><option>option</option></select>
+        </td>
       </tr>
       <tr>
-        <td>textarea</td><td><textarea onfocus="handleFocus(event.target);" accesskey="m">test text</textarea></td>
+        <td>object</td>
+        <td>
+          <object onclick="handleClick(event.target);" onfocus="handleInvalid(event.target)" accesskey="q">an object</object>
+        </td>
+      </tr>
+      <tr>
+          <td>a without href</td>
+          <td>
+                <a onclick="handleClick(event.target);" onfocus="handleInvalid(event.target)" accesskey="r">an object</object>
+          </td>
+      </tr>
+      <tr>
+          <td>disabled button</td>
+          <td>
+              <button disabled="" onclick="handleClick(event.target);" onfocus="handleInvalid(event.target)" accesskey="s">disabled</button>
+          </td>
+      </tr>
+      <tr>
+          <td>disabled input</td>
+          <td>
+              <input disabled="" onclick="handleClick(event.target);" onfocus="handleInvalid(event.target)" accesskey="t"></input>
+          </td>
       </tr>
       <tr>
-        <td>label (label invisible)</td><td><label for="txt1" accesskey="n" style="display:none">test label</label>
-                          <input type="text" id="txt1" value="test for label" onfocus="handleFocus(event.target);"></td>
+          <td>hidden input</td>
+          <td>
+              <input type="hidden" onclick="handleClick(event.target);" onfocus="handleInvalid(event.target)" accesskey="u">disabled</input>
+          </td>
+      </tr>
+      <tr>
+          <td>disabled select</td>
+          <td>
+              <select disabled onclick="handleClick(event.target);" onfocus="handleInvalid(event.target)" accesskey="v">
+                  <option>disabled</option>
+              </select>
+          </td>
+      </tr>
+      <tr>
+          <td>disabled textarea</td>
+          <td>
+              <textarea disabled onclick="handleClick(event.target);" onfocus="handleInvalid(event.target)" accesskey="w">disabled</textarea>
+          </td>
       </tr>
       <tr>
-        <td>label (control invisible)</td><td><label for="txt2" accesskey="o">test label</label>
-                          <input type="text" id="txt2" value="test for label" onfocus="handleInvalid(event.target);" style="display:none"></td>
+          <td>scrollable div(focusable)</td>
+          <td>
+              <div onclick="handleClick(event.target);" onfocus="handleFocus(event.target)" accesskey="x" style="height: 50px; overflow: auto;">
+                  The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy
+
+                  dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the
+
+                  lazy dog. The quick brown fox jumps over the lazy dog.
+                  The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy
+
+                  dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the
+
+                  lazy dog. The quick brown fox jumps over the lazy dog.
+                  The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy
+
+                  dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the
+
+                  lazy dog. The quick brown fox jumps over the lazy dog.
+                  </div>
+          </td>
       </tr>
+      <tr>
+            <td>contenteditable div(focusable)</td>
+            <td>
+                <div onclick="handleClick(event.target);" onfocus="handleFocus(event.target)" accesskey="y" contenteditable="true">
+                    Test text.....
+                </div>
+            </td>
+        </tr>
     </tbody>
   </table>
   <dl id="dl"></dl>
   <ul id="ul"></ul>
   <ol id="ol"></ol>
   <select id="select"></select>
 </body>
 </html>
new file mode 100644
--- /dev/null
+++ b/content/html/content/reftests/409604-1-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+    <body">
+        <div>pass</div>
+    </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/content/html/content/reftests/409604-1.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html class=reftest-wait>
+    <script>
+        function onLoadHandler()
+        {
+        var v = document.createElement("input");
+        v.setAttribute("onclick", "document.getElementById('result').innerHTML += 'pass';\
+                                   document.documentElement.removeAttribute('class');");
+        v.click();
+        }
+    </script>
+    <body onload="onLoadHandler();">
+        <div id="result"></div>
+    </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/content/html/content/reftests/583514-1-ref.html
@@ -0,0 +1,3 @@
+<body>
+<input>
+<div>Results: div clicked body clicked input clicked div clicked body clicked input focused
new file mode 100644
--- /dev/null
+++ b/content/html/content/reftests/583514-1.html
@@ -0,0 +1,24 @@
+<head>
+<script>
+function test()
+{
+  document.getElementById("a").click();
+  document.getElementById("b").click();
+  document.getElementById("a").focus();
+  document.getElementById("b").focus();
+  
+  // unfocus input to avoid failing due to caret
+  document.getElementById("b").blur();
+}
+
+function log(text)
+{
+  document.getElementById("c").innerHTML+=text;
+}
+</script>
+</head>
+
+<body id="body" onload='javascript:test()' onclick='log("body clicked");'>
+<div id=a onclick='log(" div clicked ");' onfocus='log(" div focused ");'>
+<input id=b onclick='log(" input clicked ");' onfocus='log(" input focused ");'></div>
+<div id="c">Results:
new file mode 100644
--- /dev/null
+++ b/content/html/content/reftests/583514-2-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+Pass
new file mode 100644
--- /dev/null
+++ b/content/html/content/reftests/583514-2.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<head>
+    <script>
+        function test() {
+            var elem = document.createElement("input");
+            elem.setAttribute("onclick","document.getElementById('result').innerHTML = 'Pass'");
+            elem.click();
+        }
+    </script>
+</head>
+<body onload="test()">
+    <div id="result">Fail</div>
+</body>
\ No newline at end of file
--- a/content/html/content/reftests/reftest.list
+++ b/content/html/content/reftests/reftest.list
@@ -16,16 +16,19 @@ include autofocus/reftest.list
 == 560059-video-dimensions.html 560059-video-dimensions-ref.html
 == 573322-quirks.html 573322-quirks-ref.html
 == 573322-no-quirks.html 573322-no-quirks-ref.html
 == 596455-1a.html 596455-ref-1.html
 == 596455-1b.html 596455-ref-1.html
 == 596455-2a.html 596455-ref-2.html
 == 596455-2b.html 596455-ref-2.html
 == 610935.html 610935-ref.html
+== 583514-1.html 583514-1-ref.html
+== 583514-2.html 583514-2-ref.html
+== 409604-1.html 409604-1-ref.html
 == hidden-1a.html hidden-1-ref.html
 == hidden-1b.html hidden-1-ref.html
 == hidden-1c.html hidden-1-ref.html
 == hidden-1d.html hidden-1-ref.html
 == hidden-1e.html hidden-1-ref.html
 == hidden-1f.html hidden-1-ref.html
 == hidden-1g.html hidden-1-ref.html
 == hidden-2.svg hidden-2-ref.svg
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -463,16 +463,18 @@ nsGenericHTMLElement::GetClassName(nsASt
 
 nsresult
 nsGenericHTMLElement::SetClassName(const nsAString& aClassName)
 {
   SetAttr(kNameSpaceID_None, nsGkAtoms::_class, aClassName, PR_TRUE);
   return NS_OK;
 }
 
+NS_IMPL_STRING_ATTR(nsGenericHTMLElement, AccessKey, accesskey)
+
 static PRBool
 IsBody(nsIContent *aContent)
 {
   return aContent->NodeInfo()->Equals(nsGkAtoms::body) &&
          aContent->IsHTML();
 }
 
 static PRBool IS_TABLE_CELL(nsIAtom* frameType) {
@@ -943,16 +945,17 @@ nsGenericHTMLElement::BindToTree(nsIDocu
                                  PRBool aCompileEventHandlers)
 {
   nsresult rv = nsGenericHTMLElementBase::BindToTree(aDocument, aParent,
                                                      aBindingParent,
                                                      aCompileEventHandlers);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (aDocument) {
+    RegAccessKey();
     if (HasFlag(NODE_HAS_NAME)) {
       aDocument->
         AddToNameTable(this, GetParsedAttr(nsGkAtoms::name)->GetAtomValue());
     }
     if (HasFlag(NODE_IS_EDITABLE) && GetContentEditableValue() == eTrue) {
       nsCOMPtr<nsIHTMLDocument> htmlDocument = do_QueryInterface(aDocument);
       if (htmlDocument) {
         htmlDocument->ChangeContentEditableCount(this, +1);
@@ -961,16 +964,20 @@ nsGenericHTMLElement::BindToTree(nsIDocu
   }
 
   return rv;
 }
 
 void
 nsGenericHTMLElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
 {
+  if (IsInDoc()) {
+    UnregAccessKey();
+  }
+
   RemoveFromNameTable();
 
   if (GetContentEditableValue() == eTrue) {
     nsCOMPtr<nsIHTMLDocument> htmlDocument = do_QueryInterface(GetCurrentDoc());
     if (htmlDocument) {
       htmlDocument->ChangeContentEditableCount(this, -1);
     }
   }
@@ -1180,34 +1187,46 @@ nsGenericHTMLElement::GetEventListenerMa
 
 nsresult
 nsGenericHTMLElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
                               nsIAtom* aPrefix, const nsAString& aValue,
                               PRBool aNotify)
 {
   PRBool contentEditable = aNameSpaceID == kNameSpaceID_None &&
                            aName == nsGkAtoms::contenteditable;
+  PRBool accessKey = aName == nsGkAtoms::accesskey && 
+                     aNameSpaceID == kNameSpaceID_None;
+                     
   PRInt32 change;
   if (contentEditable) {
     change = GetContentEditableValue() == eTrue ? -1 : 0;
     SetFlags(NODE_MAY_HAVE_CONTENT_EDITABLE_ATTR);
   }
 
+  if (accessKey) {
+    UnregAccessKey();
+  }
+
   nsresult rv = nsStyledElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
                                          aNotify);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (contentEditable) {
     if (aValue.IsEmpty() || aValue.LowerCaseEqualsLiteral("true")) {
       change += 1;
     }
 
     ChangeEditableState(change);
   }
 
+  if (accessKey && !aValue.IsEmpty()) {
+    SetFlags(NODE_HAS_ACCESSKEY);
+    RegAccessKey();
+  }
+
   return NS_OK;
 }
 
 nsresult
 nsGenericHTMLElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
                                 PRBool aNotify)
 {
   PRBool contentEditable = PR_FALSE;
@@ -1219,16 +1238,21 @@ nsGenericHTMLElement::UnsetAttr(PRInt32 
       // Have to do this before clearing flag. See RemoveFromNameTable
       RemoveFromNameTable();
       UnsetFlags(NODE_HAS_NAME);
     }
     else if (aAttribute == nsGkAtoms::contenteditable) {
       contentEditable = PR_TRUE;
       contentEditableChange = GetContentEditableValue() == eTrue ? -1 : 0;
     }
+    else if (aAttribute == nsGkAtoms::accesskey) {
+      // Have to unregister before clearing flag. See UnregAccessKey
+      UnregAccessKey();
+      UnsetFlags(NODE_HAS_ACCESSKEY);
+    }
     else if (nsContentUtils::IsEventAttributeName(aAttribute,
                                                   EventNameType_HTML)) {
       nsIEventListenerManager* manager = GetListenerManager(PR_FALSE);
       if (manager) {
         manager->RemoveScriptEventListener(aAttribute);
       }
     }
   }
@@ -3226,16 +3250,48 @@ nsGenericHTMLElement::Blur()
 nsresult
 nsGenericHTMLElement::Focus()
 {
   nsIFocusManager* fm = nsFocusManager::GetFocusManager();
   nsCOMPtr<nsIDOMElement> elem = do_QueryInterface(this);
   return fm ? fm->SetFocus(elem, 0) : NS_OK;
 }
 
+nsresult nsGenericHTMLElement::Click()
+{
+  if (HasFlag(NODE_HANDLING_CLICK))
+    return NS_OK;
+
+  // Strong in case the event kills it
+  nsCOMPtr<nsIDocument> doc = GetCurrentDoc();
+
+  nsCOMPtr<nsIPresShell> shell = nsnull;
+  nsRefPtr<nsPresContext> context = nsnull;
+  if (doc) {
+    shell = doc->GetShell();
+    if (shell) {
+      context = shell->GetPresContext();
+    }
+  }
+
+  SetFlags(NODE_HANDLING_CLICK);
+
+  // Click() is never called from native code, but it may be
+  // called from chrome JS. Mark this event trusted if Click()
+  // is called from chrome code.
+  nsMouseEvent event(nsContentUtils::IsCallerChrome(),
+                     NS_MOUSE_CLICK, nsnull, nsMouseEvent::eReal);
+  event.inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_UNKNOWN;
+
+  nsEventDispatcher::Dispatch(this, context, &event);
+
+  UnsetFlags(NODE_HANDLING_CLICK);
+  return NS_OK;
+}
+
 PRBool
 nsGenericHTMLElement::IsHTMLFocusable(PRBool aWithMouse,
                                       PRBool *aIsFocusable,
                                       PRInt32 *aTabIndex)
 {
   nsIDocument *doc = GetCurrentDoc();
   if (!doc || doc->HasFlag(NODE_IS_EDITABLE)) {
     // In designMode documents we only allow focusing the document.
--- a/content/html/content/src/nsGenericHTMLElement.h
+++ b/content/html/content/src/nsGenericHTMLElement.h
@@ -135,25 +135,28 @@ public:
   virtual nsresult GetInnerHTML(nsAString& aInnerHTML);
   virtual nsresult SetInnerHTML(const nsAString& aInnerHTML);
   nsresult ScrollIntoView(PRBool aTop, PRUint8 optional_argc);
   // Declare Focus(), Blur(), GetTabIndex(), SetTabIndex(), GetHidden(),
   // SetHidden(), GetSpellcheck(), SetSpellcheck(), and GetDraggable() such that
   // classes that inherit interfaces with those methods properly override them.
   NS_IMETHOD Focus();
   NS_IMETHOD Blur();
+  NS_IMETHOD Click();
   NS_IMETHOD GetTabIndex(PRInt32 *aTabIndex);
   NS_IMETHOD SetTabIndex(PRInt32 aTabIndex);
   NS_IMETHOD GetHidden(PRBool* aHidden);
   NS_IMETHOD SetHidden(PRBool aHidden);
   NS_IMETHOD GetSpellcheck(PRBool* aSpellcheck);
   NS_IMETHOD SetSpellcheck(PRBool aSpellcheck);
   NS_IMETHOD GetDraggable(PRBool* aDraggable);
   NS_IMETHOD SetDraggable(PRBool aDraggable);
-  nsresult GetContentEditable(nsAString &aContentEditable);
+  NS_IMETHOD GetAccessKey(nsAString &aAccessKey);
+  NS_IMETHOD SetAccessKey(const nsAString& aAccessKey);
+  nsresult GetContentEditable(nsAString& aContentEditable);
   nsresult GetIsContentEditable(PRBool* aContentEditable);
   nsresult SetContentEditable(const nsAString &aContentEditable);
 
   // Implementation for nsIContent
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               PRBool aCompileEventHandlers);
   virtual void UnbindFromTree(PRBool aDeep = PR_TRUE,
@@ -1475,16 +1478,32 @@ protected:
     NS_INTERFACE_TABLE_ENTRY(_class, _i5)                                     \
     NS_INTERFACE_TABLE_ENTRY(_class, _i6)                                     \
     NS_INTERFACE_TABLE_ENTRY(_class, _i7)                                     \
     NS_INTERFACE_TABLE_ENTRY(_class, _i8)                                     \
     NS_INTERFACE_TABLE_ENTRY(_class, _i9)                                     \
     NS_INTERFACE_TABLE_ENTRY(_class, _i10)                                    \
   NS_OFFSET_AND_INTERFACE_TABLE_END
 
+/* Use this macro to declare functions that forward the behavior of this interface to another object. 
+   This macro doesn't forward Focus or Click because sometimes elements will want to override them. */
+#define NS_FORWARD_NSIDOMHTMLELEMENT_NOFOCUSCLICK(_to) \
+  NS_SCRIPTABLE NS_IMETHOD GetId(nsAString & aId) { return _to GetId(aId); } \
+  NS_SCRIPTABLE NS_IMETHOD SetId(const nsAString & aId) { return _to SetId(aId); } \
+  NS_SCRIPTABLE NS_IMETHOD GetTitle(nsAString & aTitle) { return _to GetTitle(aTitle); } \
+  NS_SCRIPTABLE NS_IMETHOD SetTitle(const nsAString & aTitle) { return _to SetTitle(aTitle); } \
+  NS_SCRIPTABLE NS_IMETHOD GetLang(nsAString & aLang) { return _to GetLang(aLang); } \
+  NS_SCRIPTABLE NS_IMETHOD SetLang(const nsAString & aLang) { return _to SetLang(aLang); } \
+  NS_SCRIPTABLE NS_IMETHOD GetDir(nsAString & aDir) { return _to GetDir(aDir); } \
+  NS_SCRIPTABLE NS_IMETHOD SetDir(const nsAString & aDir) { return _to SetDir(aDir); } \
+  NS_SCRIPTABLE NS_IMETHOD GetClassName(nsAString & aClassName) { return _to GetClassName(aClassName); } \
+  NS_SCRIPTABLE NS_IMETHOD SetClassName(const nsAString & aClassName) { return _to SetClassName(aClassName); } \
+  NS_SCRIPTABLE NS_IMETHOD GetAccessKey(nsAString & aAccessKey) { return _to GetAccessKey(aAccessKey); } \
+  NS_SCRIPTABLE NS_IMETHOD SetAccessKey(const nsAString & aAccessKey) { return _to SetAccessKey(aAccessKey); } \
+  NS_SCRIPTABLE NS_IMETHOD Blur(void) { return _to Blur(); }
 
 /**
  * A macro to declare the NS_NewHTMLXXXElement() functions.
  */
 #define NS_DECLARE_NS_NEW_HTML_ELEMENT(_elementName)                       \
 nsGenericHTMLElement*                                                      \
 NS_NewHTML##_elementName##Element(already_AddRefed<nsINodeInfo> aNodeInfo, \
                                   mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
--- a/content/html/content/src/nsHTMLAnchorElement.cpp
+++ b/content/html/content/src/nsHTMLAnchorElement.cpp
@@ -162,17 +162,16 @@ NS_IMPL_STRING_ATTR(nsHTMLAnchorElement,
 NS_IMPL_URI_ATTR(nsHTMLAnchorElement, Href, href)
 NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Hreflang, hreflang)
 NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Name, name)
 NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Rel, rel)
 NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Rev, rev)
 NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Shape, shape)
 NS_IMPL_INT_ATTR(nsHTMLAnchorElement, TabIndex, tabindex)
 NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Type, type)
-NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, AccessKey, accesskey)
 
 NS_IMETHODIMP
 nsHTMLAnchorElement::GetDraggable(PRBool* aDraggable)
 {
   // links can be dragged as long as there is an href and the
   // draggable attribute isn't false
   if (HasAttr(kNameSpaceID_None, nsGkAtoms::href)) {
     *aDraggable = !AttrValueIs(kNameSpaceID_None, nsGkAtoms::draggable,
@@ -191,53 +190,33 @@ nsHTMLAnchorElement::BindToTree(nsIDocum
 {
   Link::ResetLinkState(false);
 
   nsresult rv = nsGenericHTMLElement::BindToTree(aDocument, aParent,
                                                  aBindingParent,
                                                  aCompileEventHandlers);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  if (aDocument) {
-    RegAccessKey();
-  }
-
   // Prefetch links
   if (aDocument && nsHTMLDNSPrefetch::IsAllowed(GetOwnerDoc())) {
     nsHTMLDNSPrefetch::PrefetchLow(this);
   }
   return rv;
 }
 
 void
 nsHTMLAnchorElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
 {
   // If this link is ever reinserted into a document, it might
   // be under a different xml:base, so forget the cached state now.
   Link::ResetLinkState(false);
 
-  if (IsInDoc()) {
-    UnregAccessKey();
-  }
-
   nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
 }
 
-NS_IMETHODIMP
-nsHTMLAnchorElement::Blur()
-{
-  return nsGenericHTMLElement::Blur();
-}
-
-NS_IMETHODIMP
-nsHTMLAnchorElement::Focus()
-{
-  return nsGenericHTMLElement::Focus();
-}
-
 PRBool
 nsHTMLAnchorElement::IsHTMLFocusable(PRBool aWithMouse,
                                      PRBool *aIsFocusable, PRInt32 *aTabIndex)
 {
   if (nsGenericHTMLElement::IsHTMLFocusable(aWithMouse, aIsFocusable, aTabIndex)) {
     return PR_TRUE;
   }
 
@@ -396,20 +375,16 @@ nsHTMLAnchorElement::GetHrefURI() const
   return GetHrefURIForAnchors();
 }
 
 nsresult
 nsHTMLAnchorElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
                              nsIAtom* aPrefix, const nsAString& aValue,
                              PRBool aNotify)
 {
-  if (aName == nsGkAtoms::accesskey && kNameSpaceID_None == aNameSpaceID) {
-    UnregAccessKey();
-  }
-
   bool reset = false;
   if (aName == nsGkAtoms::href && kNameSpaceID_None == aNameSpaceID) {
     // If we do not have a cached URI, we have some value here so we must reset
     // our link state after calling the parent.
     if (!Link::HasCachedURI()) {
       reset = true;
     }
     // However, if we have a cached URI, we'll want to see if the value changed.
@@ -429,36 +404,23 @@ nsHTMLAnchorElement::SetAttr(PRInt32 aNa
   // is important here!  The attribute is not set until SetAttr returns, and
   // we will need the updated attribute value because notifying the document
   // that content states have changed will call IntrinsicState, which will try
   // to get updated information about the visitedness from Link.
   if (reset) {
     Link::ResetLinkState(!!aNotify);
   }
 
-  if (aName == nsGkAtoms::accesskey && kNameSpaceID_None == aNameSpaceID &&
-      !aValue.IsEmpty()) {
-    SetFlags(NODE_HAS_ACCESSKEY);
-    RegAccessKey();
-  }
-
   return rv;
 }
 
 nsresult
 nsHTMLAnchorElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
                                PRBool aNotify)
 {
-  if (aAttribute == nsGkAtoms::accesskey &&
-      kNameSpaceID_None == aNameSpaceID) {
-    // Have to unregister before clearing flag. See UnregAccessKey
-    UnregAccessKey();
-    UnsetFlags(NODE_HAS_ACCESSKEY);
-  }
-
   nsresult rv = nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute,
                                                 aNotify);
 
   // The ordering of the parent class's UnsetAttr call and Link::ResetLinkState
   // is important here!  The attribute is not unset until UnsetAttr returns, and
   // we will need the updated attribute value because notifying the document
   // that content states have changed will call IntrinsicState, which will try
   // to get updated information about the visitedness from Link.
--- a/content/html/content/src/nsHTMLAreaElement.cpp
+++ b/content/html/content/src/nsHTMLAreaElement.cpp
@@ -135,17 +135,16 @@ NS_INTERFACE_TABLE_HEAD(nsHTMLAreaElemen
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLAreaElement,
                                                nsGenericHTMLElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLAreaElement)
 
 
 NS_IMPL_ELEMENT_CLONE(nsHTMLAreaElement)
 
 
-NS_IMPL_STRING_ATTR(nsHTMLAreaElement, AccessKey, accesskey)
 NS_IMPL_STRING_ATTR(nsHTMLAreaElement, Alt, alt)
 NS_IMPL_STRING_ATTR(nsHTMLAreaElement, Coords, coords)
 NS_IMPL_URI_ATTR(nsHTMLAreaElement, Href, href)
 NS_IMPL_BOOL_ATTR(nsHTMLAreaElement, NoHref, nohref)
 NS_IMPL_STRING_ATTR(nsHTMLAreaElement, Shape, shape)
 NS_IMPL_INT_ATTR(nsHTMLAreaElement, TabIndex, tabindex)
 
 NS_IMETHODIMP
@@ -192,83 +191,55 @@ nsHTMLAreaElement::GetLinkTarget(nsAStri
 
 nsresult
 nsHTMLAreaElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               PRBool aCompileEventHandlers)
 {
   Link::ResetLinkState(false);
 
-  nsresult rv = nsGenericHTMLElement::BindToTree(aDocument, aParent,
+  return nsGenericHTMLElement::BindToTree(aDocument, aParent,
                                                  aBindingParent,
                                                  aCompileEventHandlers);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (aDocument) {
-    RegAccessKey();
-  }
-
-  return rv;
 }
 
 void
 nsHTMLAreaElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
 {
   // If this link is ever reinserted into a document, it might
   // be under a different xml:base, so forget the cached state now.
   Link::ResetLinkState(false);
 
-  if (IsInDoc()) {
-    UnregAccessKey();
-  }
-
   nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
 }
 
 nsresult
 nsHTMLAreaElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
                            nsIAtom* aPrefix, const nsAString& aValue,
                            PRBool aNotify)
 {
-  if (aName == nsGkAtoms::accesskey && aNameSpaceID == kNameSpaceID_None) {
-    UnregAccessKey();
-  }
-
   nsresult rv =
     nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue, aNotify);
 
   // The ordering of the parent class's SetAttr call and Link::ResetLinkState
   // is important here!  The attribute is not set until SetAttr returns, and
   // we will need the updated attribute value because notifying the document
   // that content states have changed will call IntrinsicState, which will try
   // to get updated information about the visitedness from Link.
   if (aName == nsGkAtoms::href && aNameSpaceID == kNameSpaceID_None) {
     Link::ResetLinkState(!!aNotify);
   }
 
-  if (aName == nsGkAtoms::accesskey && aNameSpaceID == kNameSpaceID_None &&
-      !aValue.IsEmpty()) {
-    SetFlags(NODE_HAS_ACCESSKEY);
-    RegAccessKey();
-  }
-
   return rv;
 }
 
 nsresult
 nsHTMLAreaElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
                              PRBool aNotify)
 {
-  if (aAttribute == nsGkAtoms::accesskey &&
-      aNameSpaceID == kNameSpaceID_None) {
-    // Have to unregister before clearing flag. See UnregAccessKey
-    UnregAccessKey();
-    UnsetFlags(NODE_HAS_ACCESSKEY);
-  }
-
   nsresult rv = nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute,
                                                 aNotify);
 
   // The ordering of the parent class's UnsetAttr call and Link::ResetLinkState
   // is important here!  The attribute is not unset until UnsetAttr returns, and
   // we will need the updated attribute value because notifying the document
   // that content states have changed will call IntrinsicState, which will try
   // to get updated information about the visitedness from Link.
--- a/content/html/content/src/nsHTMLButtonElement.cpp
+++ b/content/html/content/src/nsHTMLButtonElement.cpp
@@ -133,17 +133,16 @@ public:
   virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor);
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   virtual void DoneCreatingElement();
   virtual nsXPCClassInfo* GetClassInfo();
 
 protected:
   PRUint8 mType;
-  PRPackedBool mHandlingClick;
   PRPackedBool mDisabledChanged;
   PRPackedBool mInInternalActivate;
 
 private:
   // The analogue of defaultValue in the DOM for input and textarea
   nsresult SetDefaultValue(const nsAString& aDefaultValue);
   nsresult GetDefaultValue(nsAString& aDefaultValue);
 };
@@ -153,17 +152,16 @@ private:
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Button)
 
 
 nsHTMLButtonElement::nsHTMLButtonElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLFormElement(aNodeInfo),
     mType(kButtonDefaultType->value),
-    mHandlingClick(PR_FALSE),
     mDisabledChanged(PR_FALSE),
     mInInternalActivate(PR_FALSE)
 {
   // <button> is always barred from constraint validation.
   SetBarredFromConstraintValidation(PR_TRUE);
 }
 
 nsHTMLButtonElement::~nsHTMLButtonElement()
@@ -199,79 +197,31 @@ NS_IMPL_ELEMENT_CLONE(nsHTMLButtonElemen
 // nsIDOMHTMLButtonElement
 
 NS_IMETHODIMP
 nsHTMLButtonElement::GetForm(nsIDOMHTMLFormElement** aForm)
 {
   return nsGenericHTMLFormElement::GetForm(aForm);
 }
 
-NS_IMPL_STRING_ATTR(nsHTMLButtonElement, AccessKey, accesskey)
 NS_IMPL_BOOL_ATTR(nsHTMLButtonElement, Autofocus, autofocus)
 NS_IMPL_BOOL_ATTR(nsHTMLButtonElement, Disabled, disabled)
 NS_IMPL_ACTION_ATTR(nsHTMLButtonElement, FormAction, formaction)
 NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLButtonElement, FormEnctype, formenctype,
                                 kFormDefaultEnctype->tag)
 NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLButtonElement, FormMethod, formmethod,
                                 kFormDefaultMethod->tag)
 NS_IMPL_BOOL_ATTR(nsHTMLButtonElement, FormNoValidate, formnovalidate)
 NS_IMPL_STRING_ATTR(nsHTMLButtonElement, FormTarget, formtarget)
 NS_IMPL_STRING_ATTR(nsHTMLButtonElement, Name, name)
 NS_IMPL_INT_ATTR(nsHTMLButtonElement, TabIndex, tabindex)
 NS_IMPL_STRING_ATTR(nsHTMLButtonElement, Value, value)
 NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLButtonElement, Type, type,
                                 kButtonDefaultType->tag)
 
-NS_IMETHODIMP
-nsHTMLButtonElement::Blur()
-{
-  return nsGenericHTMLElement::Blur();
-}
-
-NS_IMETHODIMP
-nsHTMLButtonElement::Focus()
-{
-  return nsGenericHTMLElement::Focus();
-}
-
-NS_IMETHODIMP
-nsHTMLButtonElement::Click()
-{
-  if (mHandlingClick)
-    return NS_OK;
-
-  mHandlingClick = PR_TRUE;
-  // Hold on to the document in case one of the events makes it die or
-  // something...
-  nsCOMPtr<nsIDocument> doc = GetCurrentDoc();
-
-  if (doc) {
-    nsIPresShell *shell = doc->GetShell();
-    if (shell) {
-      nsRefPtr<nsPresContext> context = shell->GetPresContext();
-      if (context) {
-        // Click() is never called from native code, but it may be
-        // called from chrome JS. Mark this event trusted if Click()
-        // is called from chrome code.
-        nsMouseEvent event(nsContentUtils::IsCallerChrome(),
-                           NS_MOUSE_CLICK, nsnull,
-                           nsMouseEvent::eReal);
-        event.inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_UNKNOWN;
-        nsEventStatus status = nsEventStatus_eIgnore;
-        nsEventDispatcher::Dispatch(static_cast<nsIContent*>(this), context,
-                                    &event, nsnull, &status);
-      }
-    }
-  }
-
-  mHandlingClick = PR_FALSE;
-
-  return NS_OK;
-}
-
 PRBool
 nsHTMLButtonElement::IsHTMLFocusable(PRBool aWithMouse, PRBool *aIsFocusable, PRInt32 *aTabIndex)
 {
   if (nsGenericHTMLFormElement::IsHTMLFocusable(aWithMouse, aIsFocusable, aTabIndex)) {
     return PR_TRUE;
   }
 
   *aIsFocusable = 
--- a/content/html/content/src/nsHTMLInputElement.cpp
+++ b/content/html/content/src/nsHTMLInputElement.cpp
@@ -968,17 +968,16 @@ NS_IMETHODIMP
 nsHTMLInputElement::GetForm(nsIDOMHTMLFormElement** aForm)
 {
   return nsGenericHTMLFormElement::GetForm(aForm);
 }
 
 NS_IMPL_STRING_ATTR(nsHTMLInputElement, DefaultValue, value)
 NS_IMPL_BOOL_ATTR(nsHTMLInputElement, DefaultChecked, checked)
 NS_IMPL_STRING_ATTR(nsHTMLInputElement, Accept, accept)
-NS_IMPL_STRING_ATTR(nsHTMLInputElement, AccessKey, accesskey)
 NS_IMPL_STRING_ATTR(nsHTMLInputElement, Align, align)
 NS_IMPL_STRING_ATTR(nsHTMLInputElement, Alt, alt)
 NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLInputElement, Autocomplete, autocomplete,
                                 kInputDefaultAutocomplete->tag)
 NS_IMPL_BOOL_ATTR(nsHTMLInputElement, Autofocus, autofocus)
 //NS_IMPL_BOOL_ATTR(nsHTMLInputElement, Checked, checked)
 NS_IMPL_BOOL_ATTR(nsHTMLInputElement, Disabled, disabled)
 NS_IMPL_ACTION_ATTR(nsHTMLInputElement, FormAction, formaction)
@@ -1742,22 +1741,16 @@ nsHTMLInputElement::SetCheckedInternal(P
   }
 
   if (mType == NS_FORM_INPUT_RADIO) {
     UpdateValueMissingValidityState();
   }
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::Blur()
-{
-  return nsGenericHTMLElement::Blur();
-}
-
-NS_IMETHODIMP
 nsHTMLInputElement::Focus()
 {
   if (mType == NS_FORM_INPUT_FILE) {
     // for file inputs, focus the button instead
     nsIFrame* frame = GetPrimaryFrame();
     if (frame) {
       nsIFrame* childFrame = frame->GetFirstChild(nsnull);
       while (childFrame) {
@@ -1850,78 +1843,20 @@ nsHTMLInputElement::SelectAll(nsPresCont
   if (formControlFrame) {
     formControlFrame->SetFormProperty(nsGkAtoms::select, EmptyString());
   }
 }
 
 NS_IMETHODIMP
 nsHTMLInputElement::Click()
 {
-  nsresult rv = NS_OK;
-
-  if (GET_BOOLBIT(mBitField, BF_HANDLING_CLICK)) // Fixes crash as in bug 41599
-      return rv;                      // --heikki@netscape.com
-
-  // first see if we are disabled or not. If disabled then do nothing.
-  nsAutoString disabled;
-  if (IsDisabled()) {
-    return NS_OK;
-  }
-
-  // see what type of input we are.  Only click button, checkbox, radio,
-  // reset, submit, & image
-  if (mType == NS_FORM_INPUT_BUTTON   ||
-      mType == NS_FORM_INPUT_CHECKBOX ||
-      mType == NS_FORM_INPUT_RADIO    ||
-      mType == NS_FORM_INPUT_RESET    ||
-      mType == NS_FORM_INPUT_SUBMIT   ||
-      mType == NS_FORM_INPUT_IMAGE    ||
-      mType == NS_FORM_INPUT_FILE) {
-
-    // Strong in case the event kills it
-    nsCOMPtr<nsIDocument> doc = GetCurrentDoc();
-    if (!doc) {
-      return rv;
-    }
-
-    nsCOMPtr<nsIPresShell> shell = doc->GetShell();
-    nsRefPtr<nsPresContext> context = nsnull;
-    if (shell) {
-      context = shell->GetPresContext();
-    }
-
-    if (!context) {
-      doc->FlushPendingNotifications(Flush_Frames);
-      shell = doc->GetShell();
-      if (shell) {
-        context = shell->GetPresContext();
-      }
-    }
-
-    if (context) {
-      // Click() is never called from native code, but it may be
-      // called from chrome JS. Mark this event trusted if Click()
-      // is called from chrome code.
-      nsMouseEvent event(nsContentUtils::IsCallerChrome(),
-                         NS_MOUSE_CLICK, nsnull, nsMouseEvent::eReal);
-      event.inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_UNKNOWN;
-      nsEventStatus status = nsEventStatus_eIgnore;
-
-      SET_BOOLBIT(mBitField, BF_HANDLING_CLICK, PR_TRUE);
-      if (mType == NS_FORM_INPUT_FILE){
-        FireAsyncClickHandler();
-      }
-      nsEventDispatcher::Dispatch(static_cast<nsIContent*>(this), context,
-                                  &event, nsnull, &status);
-
-      SET_BOOLBIT(mBitField, BF_HANDLING_CLICK, PR_FALSE);
-    }
-  }
-
-  return NS_OK;
+  if (mType == NS_FORM_INPUT_FILE)
+    FireAsyncClickHandler();
+
+  return nsGenericHTMLElement::Click();
 }
 
 NS_IMETHODIMP
 nsHTMLInputElement::FireAsyncClickHandler()
 {
   nsCOMPtr<nsIRunnable> event = new AsyncClickHandler(this);
   return NS_DispatchToMainThread(event);
 }
--- a/content/html/content/src/nsHTMLInputElement.h
+++ b/content/html/content/src/nsHTMLInputElement.h
@@ -50,29 +50,28 @@
 #include "nsIConstraintValidation.h"
 #include "nsDOMFile.h"
 #include "nsHTMLFormElement.h" // for ShouldShowInvalidUI()
 
 //
 // Accessors for mBitField
 //
 #define BF_DISABLED_CHANGED 0
-#define BF_HANDLING_CLICK 1
-#define BF_VALUE_CHANGED 2
-#define BF_CHECKED_CHANGED 3
-#define BF_CHECKED 4
-#define BF_HANDLING_SELECT_EVENT 5
-#define BF_SHOULD_INIT_CHECKED 6
-#define BF_PARSER_CREATING 7
-#define BF_IN_INTERNAL_ACTIVATE 8
-#define BF_CHECKED_IS_TOGGLED 9
-#define BF_INDETERMINATE 10
-#define BF_INHIBIT_RESTORATION 11
-#define BF_CAN_SHOW_INVALID_UI 12
-#define BF_CAN_SHOW_VALID_UI 13
+#define BF_VALUE_CHANGED 1
+#define BF_CHECKED_CHANGED 2
+#define BF_CHECKED 3
+#define BF_HANDLING_SELECT_EVENT 4
+#define BF_SHOULD_INIT_CHECKED 5
+#define BF_PARSER_CREATING 6
+#define BF_IN_INTERNAL_ACTIVATE 7
+#define BF_CHECKED_IS_TOGGLED 8
+#define BF_INDETERMINATE 9
+#define BF_INHIBIT_RESTORATION 10
+#define BF_CAN_SHOW_INVALID_UI 11
+#define BF_CAN_SHOW_VALID_UI 12
 
 #define GET_BOOLBIT(bitfield, field) (((bitfield) & (0x01 << (field))) \
                                         ? PR_TRUE : PR_FALSE)
 #define SET_BOOLBIT(bitfield, field, b) ((b) \
                                         ? ((bitfield) |=  (0x01 << (field))) \
                                         : ((bitfield) &= ~(0x01 << (field))))
 
 class nsDOMFileList;
@@ -131,30 +130,33 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLFormElement::)
 
   // nsIDOMElement
   NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
 
-  // nsIDOMHTMLElement
-  NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)
-
   // nsIDOMHTMLInputElement
   NS_DECL_NSIDOMHTMLINPUTELEMENT
 
   // nsIPhonetic
   NS_DECL_NSIPHONETIC
 
   // nsIDOMNSEditableElement
   NS_IMETHOD GetEditor(nsIEditor** aEditor)
   {
     return nsGenericHTMLElement::GetEditor(aEditor);
   }
+
+  // Forward nsIDOMHTMLElement
+  NS_FORWARD_NSIDOMHTMLELEMENT_NOFOCUSCLICK(nsGenericHTMLFormElement::)
+  NS_IMETHOD Focus();
+  NS_IMETHOD Click();
+
   NS_IMETHOD SetUserInput(const nsAString& aInput);
 
   // Overriden nsIFormControl methods
   NS_IMETHOD_(PRUint32) GetType() const { return mType; }
   NS_IMETHOD Reset();
   NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission);
   NS_IMETHOD SaveState();
   virtual PRBool RestoreState(nsPresState* aState);
--- a/content/html/content/src/nsHTMLLabelElement.cpp
+++ b/content/html/content/src/nsHTMLLabelElement.cpp
@@ -63,29 +63,31 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLFormElement::)
 
   // nsIDOMElement
   NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
 
-  // nsIDOMHTMLElement
-  NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)
-
   // nsIDOMHTMLLabelElement
   NS_DECL_NSIDOMHTMLLABELELEMENT
 
+  // Forward nsIDOMHTMLElement -- We don't override Click()
+  NS_FORWARD_NSIDOMHTMLELEMENT_NOFOCUSCLICK(nsGenericHTMLFormElement::)
+  NS_IMETHOD Click() { 
+    return nsGenericHTMLFormElement::Click(); 
+  }
+  NS_IMETHOD Focus();
+
   // nsIFormControl
   NS_IMETHOD_(PRUint32) GetType() const { return NS_FORM_LABEL; }
   NS_IMETHOD Reset();
   NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission);
 
-  NS_IMETHOD Focus();
-
   virtual bool IsDisabled() const { return PR_FALSE; }
 
   // nsIContent
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               PRBool aCompileEventHandlers);
   virtual void UnbindFromTree(PRBool aDeep = PR_TRUE,
                               PRBool aNullParent = PR_TRUE);
@@ -169,17 +171,16 @@ nsHTMLLabelElement::GetControl(nsIDOMHTM
   nsCOMPtr<nsIContent> content = GetControlContent();
   nsCOMPtr<nsIDOMHTMLElement> element = do_QueryInterface(content);
 
   element.swap(*aElement);
   return NS_OK;
 }
 
 
-NS_IMPL_STRING_ATTR(nsHTMLLabelElement, AccessKey, accesskey)
 NS_IMPL_STRING_ATTR(nsHTMLLabelElement, HtmlFor, _for)
 
 NS_IMETHODIMP
 nsHTMLLabelElement::Focus()
 {
   // retarget the focus method at the for content
   nsIFocusManager* fm = nsFocusManager::GetFocusManager();
   if (fm) {
@@ -193,35 +194,24 @@ nsHTMLLabelElement::Focus()
   return NS_OK;
 }
 
 nsresult
 nsHTMLLabelElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                                nsIContent* aBindingParent,
                                PRBool aCompileEventHandlers)
 {
-  nsresult rv = nsGenericHTMLFormElement::BindToTree(aDocument, aParent,
-                                                     aBindingParent,
-                                                     aCompileEventHandlers);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (aDocument) {
-    RegAccessKey();
-  }
-
-  return rv;
+  return nsGenericHTMLFormElement::BindToTree(aDocument, aParent,
+                                              aBindingParent,
+                                              aCompileEventHandlers);
 }
 
 void
 nsHTMLLabelElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
 {
-  if (IsInDoc()) {
-    UnregAccessKey();
-  }
-
   nsGenericHTMLFormElement::UnbindFromTree(aDeep, aNullParent);
 }
 
 static PRBool
 EventTargetIn(nsEvent *aEvent, nsIContent *aChild, nsIContent *aStop)
 {
   nsCOMPtr<nsIContent> c = do_QueryInterface(aEvent->target);
   nsIContent *content = c;
@@ -351,44 +341,24 @@ nsHTMLLabelElement::SubmitNamesValues(ns
 {
   return NS_OK;
 }
 
 nsresult
 nsHTMLLabelElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix,
                             const nsAString& aValue, PRBool aNotify)
 {
-  if (aName == nsGkAtoms::accesskey && kNameSpaceID_None == aNameSpaceID) {
-    UnregAccessKey();
-  }
-
-  nsresult rv =
-      nsGenericHTMLFormElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
-                                        aNotify);
-
-  if (aName == nsGkAtoms::accesskey && kNameSpaceID_None == aNameSpaceID &&
-      !aValue.IsEmpty()) {
-    SetFlags(NODE_HAS_ACCESSKEY);
-    RegAccessKey();
-  }
-
-  return rv;
+  return nsGenericHTMLFormElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
+                                           aNotify);
 }
 
 nsresult
 nsHTMLLabelElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
                               PRBool aNotify)
 {
-  if (aAttribute == nsGkAtoms::accesskey &&
-      kNameSpaceID_None == aNameSpaceID) {
-    // Have to unregister before clearing flag. See UnregAccessKey
-    UnregAccessKey();
-    UnsetFlags(NODE_HAS_ACCESSKEY);
-  }
-
   return nsGenericHTMLFormElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
 }
 
 void
 nsHTMLLabelElement::PerformAccesskey(PRBool aKeyCausesActivation,
                                      PRBool aIsTrustedEvent)
 {
   if (!aKeyCausesActivation) {
--- a/content/html/content/src/nsHTMLLegendElement.cpp
+++ b/content/html/content/src/nsHTMLLegendElement.cpp
@@ -85,17 +85,16 @@ NS_IMETHODIMP
 nsHTMLLegendElement::GetForm(nsIDOMHTMLFormElement** aForm)
 {
   Element *form = GetFormElement();
 
   return form ? CallQueryInterface(form, aForm) : NS_OK;
 }
 
 
-NS_IMPL_STRING_ATTR(nsHTMLLegendElement, AccessKey, accesskey)
 NS_IMPL_STRING_ATTR(nsHTMLLegendElement, Align, align)
 
 // this contains center, because IE4 does
 static const nsAttrValue::EnumTable kAlignTable[] = {
   { "left", NS_STYLE_TEXT_ALIGN_LEFT },
   { "right", NS_STYLE_TEXT_ALIGN_RIGHT },
   { "center", NS_STYLE_TEXT_ALIGN_CENTER },
   { "bottom", NS_STYLE_VERTICAL_ALIGN_BOTTOM },
@@ -136,76 +135,44 @@ nsHTMLLegendElement::GetAttributeChangeH
   nsChangeHint retval =
       nsGenericHTMLElement::GetAttributeChangeHint(aAttribute, aModType);
   if (aAttribute == nsGkAtoms::align) {
     NS_UpdateHint(retval, NS_STYLE_HINT_REFLOW);
   }
   return retval;
 }
 
-nsresult
-nsHTMLLegendElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
-                             nsIAtom* aPrefix, const nsAString& aValue,
-                             PRBool aNotify)
-{
-  PRBool accesskey = (aAttribute == nsGkAtoms::accesskey &&
-                      aNameSpaceID == kNameSpaceID_None);
-  if (accesskey) {
-    UnregAccessKey();
-  }
-
-  nsresult rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aAttribute,
-                                              aPrefix, aValue, aNotify);
-
-  if (accesskey && !aValue.IsEmpty()) {
-    SetFlags(NODE_HAS_ACCESSKEY);
-    RegAccessKey();
-  }
-
-  return rv;
-}
-
-nsresult
-nsHTMLLegendElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
-                               PRBool aNotify)
-{
-  if (aAttribute == nsGkAtoms::accesskey &&
-      aNameSpaceID == kNameSpaceID_None) {
-    // Have to unregister before clearing flag. See UnregAccessKey
-    UnregAccessKey();
-    UnsetFlags(NODE_HAS_ACCESSKEY);
-  }
-
-  return nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
-}
+nsresult
+nsHTMLLegendElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
+                             nsIAtom* aPrefix, const nsAString& aValue,
+                             PRBool aNotify)
+{
+  return nsGenericHTMLElement::SetAttr(aNameSpaceID, aAttribute,
+                                       aPrefix, aValue, aNotify);
+}
+nsresult
+nsHTMLLegendElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
+                               PRBool aNotify)
+{
+  return nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
+}
 
 nsresult
 nsHTMLLegendElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                                 nsIContent* aBindingParent,
                                 PRBool aCompileEventHandlers)
 {
-  nsresult rv = nsGenericHTMLElement::BindToTree(aDocument, aParent,
-                                                 aBindingParent,
-                                                 aCompileEventHandlers);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (aDocument) {
-    RegAccessKey();
-  }
-
-  return rv;
+  return nsGenericHTMLElement::BindToTree(aDocument, aParent,
+                                          aBindingParent,
+                                          aCompileEventHandlers);
 }
 
 void
 nsHTMLLegendElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
 {
-  if (IsInDoc()) {
-    UnregAccessKey();
-  }
-
   nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
 }
 
 NS_IMETHODIMP
 nsHTMLLegendElement::Focus()
 {
   nsIFrame* frame = GetPrimaryFrame();
   if (!frame)
--- a/content/html/content/src/nsHTMLLegendElement.h
+++ b/content/html/content/src/nsHTMLLegendElement.h
@@ -59,24 +59,25 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
   // nsIDOMElement
   NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
 
-  // nsIDOMHTMLElement
-  NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
-
   // nsIDOMHTMLLegendElement
   NS_DECL_NSIDOMHTMLLEGENDELEMENT
 
-  // nsGenericHTMLElement
-  NS_IMETHODIMP Focus();
+    // Forward nsIDOMHTMLElement -- We don't override Click()
+  NS_FORWARD_NSIDOMHTMLELEMENT_NOFOCUSCLICK(nsGenericHTMLElement::)
+  NS_IMETHOD Click() { 
+    return nsGenericHTMLElement::Click(); 
+  }
+  NS_IMETHOD Focus();
 
   virtual void PerformAccesskey(PRBool aKeyCausesActivation,
                                 PRBool aIsTrustedEvent);
 
   // nsIContent
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               PRBool aCompileEventHandlers);
--- a/content/html/content/src/nsHTMLSelectElement.cpp
+++ b/content/html/content/src/nsHTMLSelectElement.cpp
@@ -1267,28 +1267,16 @@ nsHTMLSelectElement::SetValue(const nsAS
 NS_IMPL_BOOL_ATTR(nsHTMLSelectElement, Autofocus, autofocus)
 NS_IMPL_BOOL_ATTR(nsHTMLSelectElement, Disabled, disabled)
 NS_IMPL_BOOL_ATTR(nsHTMLSelectElement, Multiple, multiple)
 NS_IMPL_STRING_ATTR(nsHTMLSelectElement, Name, name)
 NS_IMPL_BOOL_ATTR(nsHTMLSelectElement, Required, required)
 NS_IMPL_NON_NEGATIVE_INT_ATTR_DEFAULT_VALUE(nsHTMLSelectElement, Size, size, 0)
 NS_IMPL_INT_ATTR(nsHTMLSelectElement, TabIndex, tabindex)
 
-NS_IMETHODIMP
-nsHTMLSelectElement::Blur()
-{
-  return nsGenericHTMLElement::Blur();
-}
-
-NS_IMETHODIMP
-nsHTMLSelectElement::Focus()
-{
-  return nsGenericHTMLElement::Focus();
-}
-
 PRBool
 nsHTMLSelectElement::IsHTMLFocusable(PRBool aWithMouse,
                                      PRBool *aIsFocusable, PRInt32 *aTabIndex)
 {
   if (nsGenericHTMLFormElement::IsHTMLFocusable(aWithMouse, aIsFocusable, aTabIndex)) {
     return PR_TRUE;
   }
 
--- a/content/html/content/src/nsHTMLTextAreaElement.cpp
+++ b/content/html/content/src/nsHTMLTextAreaElement.cpp
@@ -362,28 +362,16 @@ nsHTMLTextAreaElement::GetForm(nsIDOMHTM
 {
   return nsGenericHTMLFormElement::GetForm(aForm);
 }
 
 
 // nsIContent
 
 NS_IMETHODIMP
-nsHTMLTextAreaElement::Blur()
-{
-  return nsGenericHTMLElement::Blur();
-}
-
-NS_IMETHODIMP
-nsHTMLTextAreaElement::Focus()
-{
-  return nsGenericHTMLElement::Focus();
-}
-
-NS_IMETHODIMP
 nsHTMLTextAreaElement::Select()
 {
   // XXX Bug?  We have to give the input focus before contents can be
   // selected
 
   FocusTristate state = FocusState();
   if (state == eUnfocusable) {
     return NS_OK;
@@ -444,17 +432,16 @@ nsHTMLTextAreaElement::IsHTMLFocusable(P
     return PR_TRUE;
   }
 
   // disabled textareas are not focusable
   *aIsFocusable = !IsDisabled();
   return PR_FALSE;
 }
 
-NS_IMPL_STRING_ATTR(nsHTMLTextAreaElement, AccessKey, accesskey)
 NS_IMPL_BOOL_ATTR(nsHTMLTextAreaElement, Autofocus, autofocus)
 NS_IMPL_UINT_ATTR_NON_ZERO_DEFAULT_VALUE(nsHTMLTextAreaElement, Cols, cols, DEFAULT_COLS)
 NS_IMPL_BOOL_ATTR(nsHTMLTextAreaElement, Disabled, disabled)
 NS_IMPL_NON_NEGATIVE_INT_ATTR(nsHTMLTextAreaElement, MaxLength, maxlength)
 NS_IMPL_STRING_ATTR(nsHTMLTextAreaElement, Name, name)
 NS_IMPL_BOOL_ATTR(nsHTMLTextAreaElement, ReadOnly, readonly)
 NS_IMPL_BOOL_ATTR(nsHTMLTextAreaElement, Required, required)
 NS_IMPL_UINT_ATTR_NON_ZERO_DEFAULT_VALUE(nsHTMLTextAreaElement, Rows, rows, DEFAULT_ROWS_TEXTAREA)
new file mode 100644
--- /dev/null
+++ b/content/html/content/test/test_bug583514.html
@@ -0,0 +1,61 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=562932
+-->
+<head>
+  <title>Test for Bug 583514</title>
+  <script type="application/javascript" src="/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=583514">Mozilla Bug 583514</a>
+<p id="display"></p>
+<div id="content">
+  <div id="a" accesskey="a" onfocus="divfocus = true;" onclick="divclicked = true;">
+    <input id="b" accesskey = "b" onfocus="inputfocus = true;" onclick="inputclicked = true;">
+  </div>
+</div>
+<pre id="test">
+<script type="application/javascript">
+
+    /** Test for Bug 583514 **/
+
+    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+    var Cc = Components.classes;
+    var Ci = Components.interfaces;
+
+    var modifier = Cc["@mozilla.org/preferences-service;1"].
+    getService(Ci.nsIPrefBranch).
+    getIntPref("ui.key.contentAccess");
+
+    var divfocus = false;
+    var divclicked = false;
+    var inputfocus = false;
+    var inputclicked = false;
+
+    var utils = window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
+    //utils.sendNativeKeyEvent(0, 65, modifier, "a", "a");
+
+    utils.sendKeyEvent("keypress", "a", 65, modifier);
+
+    is(divfocus, false, "accesskey does not focus div");
+    is(divclicked, true, "accesskey fires click at div");
+    is(inputfocus, false, "input was not targeted");
+    is(inputclicked, false, "inpt was not targeted");
+
+    divclicked = false;
+
+    utils.sendKeyEvent("keypress", "b", 66, modifier);
+
+    is(divfocus, false, "focus cannot bubble to div");
+    is(divclicked, true, "click bubbles to div");
+    is(inputfocus, true, "accesskey focuses input");
+    is(inputclicked, true, "accesskey clicks input");
+
+</script>
+</pre>
+</body>
+</html>
--- a/dom/interfaces/html/nsIDOMHTMLAnchorElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLAnchorElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(4e237175-3628-4dc8-892f-5270edc3c71a)]
+[scriptable, uuid(d4111310-29a9-42c7-a3fe-9b797ab85409)]
 interface nsIDOMHTMLAnchorElement : nsIDOMHTMLElement
 {
            attribute DOMString        href;
            attribute DOMString        target;
 
            attribute DOMString        ping;
 
            attribute DOMString        rel;
@@ -73,20 +73,17 @@ interface nsIDOMHTMLAnchorElement : nsID
            attribute DOMString        host;
            attribute DOMString        hostname;
            attribute DOMString        port;
            attribute DOMString        pathname;
            attribute DOMString        search;
            attribute DOMString        hash;
 
 
-           attribute DOMString        accessKey;
            attribute DOMString        charset;
            attribute DOMString        coords;
            attribute DOMString        name;
            attribute DOMString        rev;
            attribute DOMString        shape;
            attribute long             tabIndex;
 
   DOMString                 toString();
-  void                      blur();
-  void                      focus();
 };
--- a/dom/interfaces/html/nsIDOMHTMLAppletElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLAppletElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90ae-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(2b50b3a0-a7ac-4802-aafe-aa2613dae1c8)]
 interface nsIDOMHTMLAppletElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
            attribute DOMString        alt;
            attribute DOMString        archive;
            attribute DOMString        code;
            attribute DOMString        codeBase;
            attribute DOMString        height;
--- a/dom/interfaces/html/nsIDOMHTMLAreaElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLAreaElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(fca7d30d-c834-470d-9bb2-25eddfedd86b)]
+[scriptable, uuid(c42d5c09-aafa-4390-80d3-d0b1d07e31b0)]
 interface nsIDOMHTMLAreaElement : nsIDOMHTMLElement
 {
            attribute DOMString        alt;
            attribute DOMString        coords;
            attribute DOMString        shape;
            attribute DOMString        href;
            attribute DOMString        target;
 
@@ -66,14 +66,13 @@ interface nsIDOMHTMLAreaElement : nsIDOM
            attribute DOMString        host;
            attribute DOMString        hostname;  
            attribute DOMString        port;
            attribute DOMString        pathname;
            attribute DOMString        search;
            attribute DOMString        hash;
            
 
-           attribute DOMString        accessKey;
            attribute long             tabIndex;
            attribute boolean          noHref;
            DOMString                 toString();
 
 };
--- a/dom/interfaces/html/nsIDOMHTMLAudioElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLAudioElement.idl
@@ -47,17 +47,17 @@
  * <audio> element.
  *
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#audio
  *
  * @status UNDER_DEVELOPMENT
  */
 
-[scriptable, uuid(cd1a6a6b-bc4c-4e5a-b7da-53dccc878ab8)]
+[scriptable, uuid(223024c8-6a48-4b3d-8bec-1ea45523e306)]
 interface nsIDOMHTMLAudioElement : nsIDOMHTMLMediaElement
 {
   // Setup the audio stream for writing
   void mozSetup(in PRUint32 channels, in PRUint32 rate);
 
   // Write audio to the audio stream
   [implicit_jscontext]
   unsigned long mozWriteAudio(in jsval data);
--- a/dom/interfaces/html/nsIDOMHTMLBRElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLBRElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90a5-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(59160d7f-c33b-4e14-a105-0f5fe445304d)]
 interface nsIDOMHTMLBRElement : nsIDOMHTMLElement
 {
            attribute DOMString        clear;
 };
--- a/dom/interfaces/html/nsIDOMHTMLBaseElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLBaseElement.idl
@@ -45,14 +45,14 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf908b-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(2fe75fbd-5d66-4145-b80b-95e4c89d5693)]
 interface nsIDOMHTMLBaseElement : nsIDOMHTMLElement
 {
            attribute DOMString        href;
            attribute DOMString        target;
 };
--- a/dom/interfaces/html/nsIDOMHTMLBodyElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLBodyElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf908e-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(69540caf-da25-4543-a45c-383062fb1471)]
 interface nsIDOMHTMLBodyElement : nsIDOMHTMLElement
 {
            attribute DOMString        aLink;
            attribute DOMString        background;
            attribute DOMString        bgColor;
            attribute DOMString        link;
            attribute DOMString        text;
            attribute DOMString        vLink;
--- a/dom/interfaces/html/nsIDOMHTMLButtonElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLButtonElement.idl
@@ -47,40 +47,36 @@
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
 interface nsIDOMValidityState;
 
-[scriptable, uuid(bcae78a1-9f9b-46bf-abb5-a3fe410d97ae)]
+[scriptable, uuid(832f7129-7f71-4692-81b5-eb8d5fd71e68)]
 interface nsIDOMHTMLButtonElement : nsIDOMHTMLElement
 {
            attribute boolean               autofocus;
            attribute boolean               disabled;
   readonly attribute nsIDOMHTMLFormElement form;
            attribute DOMString             formAction;
            attribute DOMString             formEnctype;
            attribute DOMString             formMethod;
            attribute boolean               formNoValidate;
            attribute DOMString             formTarget;
 
            attribute DOMString             name;
            attribute DOMString             type;
            attribute DOMString             value;
 
            
-           attribute DOMString             accessKey;
            attribute long                  tabIndex;
-  void                      blur();
-  void                      focus();
-  void                      click();
 
-  // The following lines are parte of the constraint validation API, see:
+  // The following lines are part of the constraint validation API, see:
   // http://www.whatwg.org/specs/web-apps/current-work/#the-constraint-validation-api
   readonly attribute boolean             willValidate;
   readonly attribute nsIDOMValidityState validity;
   readonly attribute DOMString           validationMessage;
   boolean checkValidity();
   void setCustomValidity(in DOMString error);
 };
 
--- a/dom/interfaces/html/nsIDOMHTMLCanvasElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLCanvasElement.idl
@@ -49,17 +49,17 @@
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#graphics
  *
  * @status UNDER_DEVELOPMENT
  */
 
 interface nsIDOMFile;
 
-[scriptable, uuid(6b44a95a-c0ad-41f9-beb5-579bdb8698f2)]
+[scriptable, uuid(accc66d5-48a3-43b4-add9-af77e8fd6717)]
 interface nsIDOMHTMLCanvasElement : nsIDOMHTMLElement
 {
   attribute unsigned long width;
   attribute unsigned long height;
   attribute boolean mozOpaque;
 
   nsISupports getContext(in DOMString contextId,
                          [optional] in jsval contextOptions);
--- a/dom/interfaces/html/nsIDOMHTMLCollection.idl
+++ b/dom/interfaces/html/nsIDOMHTMLCollection.idl
@@ -45,16 +45,16 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf9083-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(1af9e026-011d-4d0e-91db-09bcfa3e9622)]
 interface nsIDOMHTMLCollection : nsISupports
 {
   readonly attribute unsigned long    length;
 
   nsIDOMNode                item(in unsigned long index);
   nsIDOMNode                namedItem(in DOMString name);
 };
--- a/dom/interfaces/html/nsIDOMHTMLDListElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLDListElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf909b-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(7f2fd6e0-fd97-43d1-ad1b-9e4ea5aa51a4)]
 interface nsIDOMHTMLDListElement : nsIDOMHTMLElement
 {
            attribute boolean          compact;
 };
--- a/dom/interfaces/html/nsIDOMHTMLDataListElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLDataListElement.idl
@@ -44,14 +44,14 @@
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#the-datalist-element
  *
  * @status UNDER_DEVELOPMENT
  */
 
 interface nsIDOMHTMLCollection;
 
-[scriptable, uuid(ec66a63e-8a23-4a85-bd53-050b49a2b048)]
+[scriptable, uuid(d7924061-3bd1-4446-8ba7-c1ad86e7c492)]
 interface nsIDOMHTMLDataListElement : nsIDOMHTMLElement
 {
   readonly attribute nsIDOMHTMLCollection options;
 };
 
--- a/dom/interfaces/html/nsIDOMHTMLDirectoryElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLDirectoryElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf909c-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(26b21995-f6f6-4ef9-8eec-0e9d8cb3125e)]
 interface nsIDOMHTMLDirectoryElement : nsIDOMHTMLElement
 {
            attribute boolean          compact;
 };
--- a/dom/interfaces/html/nsIDOMHTMLDivElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLDivElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90a0-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(02181d51-531c-4bca-908f-c426abcca32c)]
 interface nsIDOMHTMLDivElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
 };
--- a/dom/interfaces/html/nsIDOMHTMLElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLElement.idl
@@ -46,17 +46,23 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf9085-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(cf054c24-22ea-49e9-a824-f9661636c2f3)]
 interface nsIDOMHTMLElement : nsIDOMElement
 {
            attribute DOMString        id;
            attribute DOMString        title;
            attribute DOMString        lang;
            attribute DOMString        dir;
            attribute DOMString        className;
+
+           attribute DOMString        accessKey;
+
+           void                       blur();
+           void                       focus();
+           void                       click();
 };
--- a/dom/interfaces/html/nsIDOMHTMLEmbedElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLEmbedElement.idl
@@ -42,17 +42,17 @@
 /**
  * The nsIDOMHTMLEmbedElement interface is the interface to a [X]HTML
  * embed element.
  *
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#the-embed-element
  */
 
-[scriptable, uuid(123f90ab-15b3-11d2-456e-00805f8add32)]
+[scriptable, uuid(e9c14230-1e5c-41d4-98a7-34a0aafb448d)]
 interface nsIDOMHTMLEmbedElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
            attribute DOMString        height;
            attribute DOMString        name;
            attribute DOMString        src;
            attribute DOMString        type;
            attribute DOMString        width;
--- a/dom/interfaces/html/nsIDOMHTMLFieldSetElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLFieldSetElement.idl
@@ -47,17 +47,17 @@
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
 interface nsIDOMValidityState;
 
-[scriptable, uuid(58db2166-36fc-482c-a9f8-84ad262537b2)]
+[scriptable, uuid(b45e652e-b131-455e-93a8-c3832026f8aa)]
 interface nsIDOMHTMLFieldSetElement : nsIDOMHTMLElement
 {
            attribute boolean                disabled;
   readonly attribute nsIDOMHTMLFormElement  form;
            attribute DOMString              name;
 
   readonly attribute DOMString              type;
 
--- a/dom/interfaces/html/nsIDOMHTMLFontElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLFontElement.idl
@@ -45,15 +45,15 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90a7-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(0f14f0f1-68cf-4760-a709-90a22276e421)]
 interface nsIDOMHTMLFontElement : nsIDOMHTMLElement
 {
            attribute DOMString        color;
            attribute DOMString        face;
            attribute DOMString        size;
 };
--- a/dom/interfaces/html/nsIDOMHTMLFormElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLFormElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(0884ce23-e069-499e-a13c-a91c8ae0fc98)]
+[scriptable, uuid(5449f8bd-0392-4cba-ab08-6c9a68d2a89f)]
 interface nsIDOMHTMLFormElement : nsIDOMHTMLElement
 {
            attribute DOMString            name;
 
            attribute DOMString            acceptCharset;
            attribute DOMString            action;
            attribute DOMString            autocomplete;
            attribute DOMString            enctype;
--- a/dom/interfaces/html/nsIDOMHTMLFrameElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLFrameElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90b9-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(00503771-9ff0-4664-a8a8-66a8246255b7)]
 interface nsIDOMHTMLFrameElement : nsIDOMHTMLElement
 {
            attribute DOMString        frameBorder;
            attribute DOMString        longDesc;
            attribute DOMString        marginHeight;
            attribute DOMString        marginWidth;
            attribute DOMString        name;
            attribute boolean          noResize;
--- a/dom/interfaces/html/nsIDOMHTMLFrameSetElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLFrameSetElement.idl
@@ -45,14 +45,14 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90b8-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(903739a5-3ce5-4dc7-8abd-373aa07b84d9)]
 interface nsIDOMHTMLFrameSetElement : nsIDOMHTMLElement
 {
            attribute DOMString        cols;
            attribute DOMString        rows;
 };
--- a/dom/interfaces/html/nsIDOMHTMLHRElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLHRElement.idl
@@ -45,16 +45,16 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90a8-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(8303ec1f-dc33-447a-8a10-7a28b5809dec)]
 interface nsIDOMHTMLHRElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
            attribute boolean          noShade;
            attribute DOMString        size;
            attribute DOMString        width;
 };
--- a/dom/interfaces/html/nsIDOMHTMLHeadElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLHeadElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf9087-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(a921d694-5e14-4ad7-8bdf-4abaac32c070)]
 interface nsIDOMHTMLHeadElement : nsIDOMHTMLElement
 {
            [noscript] attribute DOMString        profile;
 };
--- a/dom/interfaces/html/nsIDOMHTMLHeadingElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLHeadingElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90a2-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(f29c32bf-c597-420e-b38e-747dda978c94)]
 interface nsIDOMHTMLHeadingElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
 };
--- a/dom/interfaces/html/nsIDOMHTMLHtmlElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLHtmlElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf9086-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(f5966a2b-acab-44eb-8f39-3246acb3ad40)]
 interface nsIDOMHTMLHtmlElement : nsIDOMHTMLElement
 {
            attribute DOMString        version;
 };
--- a/dom/interfaces/html/nsIDOMHTMLIFrameElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLIFrameElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90ba-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(eb2c9cf7-c9b4-454c-a1de-c83334f13ca0)]
 interface nsIDOMHTMLIFrameElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
            attribute DOMString        frameBorder;
            attribute DOMString        height;
            attribute DOMString        longDesc;
            attribute DOMString        marginHeight;
            attribute DOMString        marginWidth;
--- a/dom/interfaces/html/nsIDOMHTMLImageElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLImageElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(3fc9c313-49b9-4315-b39f-7166cf362e10)]
+[scriptable, uuid(1a903431-4968-4c45-b2f8-3123d5b802a1)]
 interface nsIDOMHTMLImageElement : nsIDOMHTMLElement
 {
            attribute DOMString        alt;
            attribute DOMString        src;
            attribute DOMString        useMap;
            attribute boolean          isMap;
            attribute long             width;
            attribute long             height;
--- a/dom/interfaces/html/nsIDOMHTMLInputElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLInputElement.idl
@@ -49,17 +49,17 @@ interface nsIDOMValidityState;
   *
   * This interface is trying to follow the DOM Level 2 HTML specification:
   * http://www.w3.org/TR/DOM-Level-2-HTML/
   *
   * with changes from the work-in-progress WHATWG HTML specification:
   * http://www.whatwg.org/specs/web-apps/current-work/
   */
 
-[scriptable, uuid(0805059d-f18f-4095-ae6b-0bf6df80b7b8)]
+[scriptable, uuid(f7124276-4198-41d7-bc7d-9d37b942dfca)]
 interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
 {
            attribute DOMString             accept;
            attribute DOMString             alt;
 
            attribute DOMString             autocomplete;
            attribute boolean               autofocus;
            attribute boolean               defaultChecked;
@@ -82,17 +82,16 @@ interface nsIDOMHTMLInputElement : nsIDO
            attribute boolean               multiple;
            attribute DOMString             name;
 
            attribute DOMString             pattern;
            attribute DOMString             placeholder;
            attribute boolean               readOnly;
            attribute boolean               required;
 
-           attribute DOMString             accessKey;
            attribute DOMString             align;
 
            attribute unsigned long         size;
            attribute DOMString             src;
 
            attribute DOMString             type;
            attribute DOMString             defaultValue;
            attribute DOMString             value;
@@ -121,13 +120,9 @@ interface nsIDOMHTMLInputElement : nsIDO
   void mozSetFileNameArray([array,size_is(aLength)] in wstring aFileNames,
                            in unsigned long aLength);
 
     /**
    * This non-standard method prevents to check types manually to know if the
    * element is a text field.
    */
   boolean mozIsTextField(in boolean aExcludePassword);
-
-  void blur();
-  void focus();
-  void click();
 };
--- a/dom/interfaces/html/nsIDOMHTMLIsIndexElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLIsIndexElement.idl
@@ -45,14 +45,14 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf908c-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(b1bd295b-40f1-48d7-bb26-d14b5052243d)]
 interface nsIDOMHTMLIsIndexElement : nsIDOMHTMLElement
 {
   readonly attribute nsIDOMHTMLFormElement form;
            attribute DOMString             prompt;
 };
--- a/dom/interfaces/html/nsIDOMHTMLLIElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLLIElement.idl
@@ -45,14 +45,14 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf909e-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(1bb231a0-48e3-453b-834e-3ac3828691ad)]
 interface nsIDOMHTMLLIElement : nsIDOMHTMLElement
 {
            attribute DOMString           type;
            attribute long                value;
 };
--- a/dom/interfaces/html/nsIDOMHTMLLabelElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLLabelElement.idl
@@ -45,17 +45,15 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(8a207452-e725-4a9e-beb6-9e0c0a65012c)]
+[scriptable, uuid(d929a64e-4265-471c-89dc-13f9b24e233d)]
 interface nsIDOMHTMLLabelElement : nsIDOMHTMLElement
 {
   readonly attribute nsIDOMHTMLFormElement form;
            attribute DOMString             htmlFor;
   readonly attribute nsIDOMHTMLElement     control;
-
-           attribute DOMString             accessKey;
 };
--- a/dom/interfaces/html/nsIDOMHTMLLegendElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLLegendElement.idl
@@ -45,15 +45,14 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf9098-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(633b72af-79b1-4b5e-b132-792e78caff81)]
 interface nsIDOMHTMLLegendElement : nsIDOMHTMLElement
 {
   readonly attribute nsIDOMHTMLFormElement form;
-           attribute DOMString             accessKey;
            attribute DOMString             align;
 };
--- a/dom/interfaces/html/nsIDOMHTMLLinkElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLLinkElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf9088-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(42fc88fb-0361-4a56-9bd7-809c035f00c3)]
 interface nsIDOMHTMLLinkElement : nsIDOMHTMLElement
 {
            attribute boolean          disabled;
            attribute DOMString        charset;
            attribute DOMString        href;
            attribute DOMString        hreflang;
            attribute DOMString        media;
            attribute DOMString        rel;
--- a/dom/interfaces/html/nsIDOMHTMLMapElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLMapElement.idl
@@ -45,14 +45,14 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90af-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(851edc2f-ea1f-44fa-b1fc-0799152b7cdb)]
 interface nsIDOMHTMLMapElement : nsIDOMHTMLElement
 {
   readonly attribute nsIDOMHTMLCollection areas;
            attribute DOMString            name;
 };
--- a/dom/interfaces/html/nsIDOMHTMLMediaElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLMediaElement.idl
@@ -52,17 +52,17 @@
 
 // undef the GetCurrentTime macro defined in WinBase.h from the MS Platform SDK
 %{C++
 #ifdef GetCurrentTime
 #undef GetCurrentTime
 #endif
 %}
 
-[scriptable, uuid(91f65f50-74ea-40ea-8e26-652290738730)]
+[scriptable, uuid(f783b694-118b-44ec-982b-ad8a96e31db0)]
 interface nsIDOMHTMLMediaElement : nsIDOMHTMLElement
 {
   // error state
   readonly attribute nsIDOMMediaError error;
 
   // network state
            attribute DOMString src;
   readonly attribute DOMString currentSrc;
--- a/dom/interfaces/html/nsIDOMHTMLMenuElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLMenuElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf909d-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(e4d49037-b0ae-40c5-805f-0115bb47f193)]
 interface nsIDOMHTMLMenuElement : nsIDOMHTMLElement
 {
            attribute boolean          compact;
 };
--- a/dom/interfaces/html/nsIDOMHTMLMetaElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLMetaElement.idl
@@ -45,16 +45,16 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf908a-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(5f1bfd9f-1e57-46a4-8320-8a8316917cd2)]
 interface nsIDOMHTMLMetaElement : nsIDOMHTMLElement
 {
            attribute DOMString        content;
            attribute DOMString        httpEquiv;
            attribute DOMString        name;
            attribute DOMString        scheme;
 };
--- a/dom/interfaces/html/nsIDOMHTMLModElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLModElement.idl
@@ -45,14 +45,14 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90a9-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(73b8aebe-01ed-40aa-bb23-e73b317bd36b)]
 interface nsIDOMHTMLModElement : nsIDOMHTMLElement
 {
            attribute DOMString        cite;
            attribute DOMString        dateTime;
 };
--- a/dom/interfaces/html/nsIDOMHTMLOListElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLOListElement.idl
@@ -45,15 +45,15 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf909a-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(4092f095-d9c5-4621-a10e-5b9baecfee3c)]
 interface nsIDOMHTMLOListElement : nsIDOMHTMLElement
 {
            attribute boolean          compact;
            attribute long             start;
            attribute DOMString        type;
 };
--- a/dom/interfaces/html/nsIDOMHTMLObjectElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLObjectElement.idl
@@ -47,17 +47,17 @@
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
 interface nsIDOMValidityState;
 
-[scriptable, uuid(9b93aab4-7fe8-4f79-9ad2-0623178a0c46)]
+[scriptable, uuid(8408203a-72cd-4d62-b618-81a4c8aba13e)]
 interface nsIDOMHTMLObjectElement : nsIDOMHTMLElement
 {
   readonly attribute nsIDOMHTMLFormElement form;
            attribute DOMString             code;
            attribute DOMString             align;
            attribute DOMString             archive;
            attribute DOMString             border;
            attribute DOMString             codeBase;
--- a/dom/interfaces/html/nsIDOMHTMLOptGroupElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLOptGroupElement.idl
@@ -45,14 +45,14 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf9091-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(73627f70-10df-4568-858b-4636e16d4b41)]
 interface nsIDOMHTMLOptGroupElement : nsIDOMHTMLElement
 {
            attribute boolean          disabled;
            attribute DOMString        label;
 };
--- a/dom/interfaces/html/nsIDOMHTMLOptionElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLOptionElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(611d00f5-1eb8-4571-b995-2a2019d2d11c)]
+[scriptable, uuid(c50d24b5-a023-4179-a980-58feccf9ae1a)]
 interface nsIDOMHTMLOptionElement : nsIDOMHTMLElement
 {
            attribute boolean               disabled;
   readonly attribute nsIDOMHTMLFormElement form;
            attribute DOMString             label;
            attribute boolean               defaultSelected;
            attribute boolean               selected;
            attribute DOMString             value;
--- a/dom/interfaces/html/nsIDOMHTMLOutputElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLOutputElement.idl
@@ -45,17 +45,17 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#the-output-element
  *
  * @status UNDER_DEVELOPMENT
  */
 
 interface nsIDOMDOMSettableTokenList;
 interface nsIDOMValidityState;
 
-[scriptable, uuid(0f7f15a9-ea72-4feb-b2b5-2fcbc9c10ab8)]
+[scriptable, uuid(13445f20-125f-4d4a-a2cc-b7315d06a690)]
 interface nsIDOMHTMLOutputElement : nsIDOMHTMLElement
 {
   readonly attribute nsIDOMDOMSettableTokenList htmlFor;
   readonly attribute nsIDOMHTMLFormElement      form;
            attribute DOMString                  name;
 
   readonly attribute DOMString                  type;
            attribute DOMString                  defaultValue;
--- a/dom/interfaces/html/nsIDOMHTMLParagraphElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLParagraphElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90a1-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(7f2ad673-8c8f-4a05-b108-78c923be72ae)]
 interface nsIDOMHTMLParagraphElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
 };
--- a/dom/interfaces/html/nsIDOMHTMLParamElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLParamElement.idl
@@ -45,16 +45,16 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90ad-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(ffb1d4ba-454d-4002-a4e9-2a35d7d73cdf)]
 interface nsIDOMHTMLParamElement : nsIDOMHTMLElement
 {
            attribute DOMString        name;
            attribute DOMString        type;
            attribute DOMString        value;
            attribute DOMString        valueType;
 };
--- a/dom/interfaces/html/nsIDOMHTMLPreElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLPreElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90a4-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(bda4e12e-944e-4d5a-8fdf-a9a6a09a9d6f)]
 interface nsIDOMHTMLPreElement : nsIDOMHTMLElement
 {
            attribute long             width;
 };
--- a/dom/interfaces/html/nsIDOMHTMLQuoteElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLQuoteElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90a3-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(d287d084-efb3-4e12-8e4d-fee6a67c0eb3)]
 interface nsIDOMHTMLQuoteElement : nsIDOMHTMLElement
 {
            attribute DOMString        cite;
 };
--- a/dom/interfaces/html/nsIDOMHTMLScriptElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLScriptElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(4af8568c-375c-42fd-a82f-b25a7c03fc3e)]
+[scriptable, uuid(c4cd6bf6-eb08-4e8f-bd2b-eb9c940c8985)]
 interface nsIDOMHTMLScriptElement : nsIDOMHTMLElement
 {
            attribute DOMString        src;
            attribute boolean          async;
            attribute boolean          defer;
            attribute DOMString        type;
            attribute DOMString        charset;
            attribute DOMString        text;
--- a/dom/interfaces/html/nsIDOMHTMLSelectElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLSelectElement.idl
@@ -48,17 +48,17 @@
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
 interface nsIDOMValidityState;
 
-[scriptable, uuid(da2be32d-63de-47ae-8c81-7ab8ac6b5aae)]
+[scriptable, uuid(79ae1985-4751-42a1-99af-c4c657b4e377)]
 interface nsIDOMHTMLSelectElement : nsIDOMHTMLElement
 {
            attribute boolean                     autofocus;
            attribute boolean                     disabled;
   readonly attribute nsIDOMHTMLFormElement       form;
            attribute boolean                     multiple;
            attribute DOMString                   name;
            attribute long                        size;
@@ -73,20 +73,18 @@ interface nsIDOMHTMLSelectElement : nsID
                                 in nsIDOMHTMLElement before)
                                                      raises(DOMException);   
   void                      remove(in long index);
 
            attribute long                  selectedIndex;
            attribute DOMString             value;
 
            attribute long                  tabIndex;
-  void                      blur();
-  void                      focus();
 
-  // The following lines are parte of the constraint validation API, see:
+  // The following lines are part of the constraint validation API, see:
   // http://www.whatwg.org/specs/web-apps/current-work/#the-constraint-validation-api
   readonly attribute boolean             willValidate;
   readonly attribute nsIDOMValidityState validity;
   readonly attribute DOMString           validationMessage;
   boolean checkValidity();
   void setCustomValidity(in DOMString error);
 
   attribute boolean                      required;
--- a/dom/interfaces/html/nsIDOMHTMLSourceElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLSourceElement.idl
@@ -43,14 +43,14 @@
  * <source> element.
  *
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#source
  *
  * @status UNDER_DEVELOPMENT
  */
 
-[scriptable, uuid(be281029-7dd9-4268-963e-96f5196acc19)]
+[scriptable, uuid(11512cc3-8303-423a-b25c-a5cbe7d0a332)]
 interface nsIDOMHTMLSourceElement : nsIDOMHTMLElement
 {
            attribute DOMString src;
            attribute DOMString type;
 };
--- a/dom/interfaces/html/nsIDOMHTMLStyleElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLStyleElement.idl
@@ -45,15 +45,15 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf908d-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(93905d93-6a58-4084-9be9-4368becc5687)]
 interface nsIDOMHTMLStyleElement : nsIDOMHTMLElement
 {
            attribute boolean          disabled;
            attribute DOMString        media;
            attribute DOMString        type;
 };
--- a/dom/interfaces/html/nsIDOMHTMLTableCaptionElem.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTableCaptionElem.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90b3-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(3c6e8b95-5d33-44d5-9f3c-1d72ff6d46ef)]
 interface nsIDOMHTMLTableCaptionElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
 };
--- a/dom/interfaces/html/nsIDOMHTMLTableCellElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTableCellElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90b7-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(2fcc14f0-8c36-4df5-879a-661f002860af)]
 interface nsIDOMHTMLTableCellElement : nsIDOMHTMLElement
 {
   readonly attribute long             cellIndex;
            attribute DOMString        abbr;
            attribute DOMString        align;
            attribute DOMString        axis;
            attribute DOMString        bgColor;
            attribute DOMString        ch;
--- a/dom/interfaces/html/nsIDOMHTMLTableColElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTableColElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90b4-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(faf0f52d-bf1d-4d7b-9c42-59ee3dfe8c3a)]
 interface nsIDOMHTMLTableColElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
            attribute DOMString        ch;
            attribute DOMString        chOff;
            attribute long             span;
            attribute DOMString        vAlign;
            attribute DOMString        width;
--- a/dom/interfaces/html/nsIDOMHTMLTableElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTableElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90b2-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(6d7871e7-cf0d-45f5-973b-e746cdf44a5b)]
 interface nsIDOMHTMLTableElement : nsIDOMHTMLElement
 {
   // Modified in DOM Level 2:
            attribute nsIDOMHTMLTableCaptionElement caption;
                                              // raises(DOMException) on setting
 
   // Modified in DOM Level 2:
            attribute nsIDOMHTMLTableSectionElement tHead;
--- a/dom/interfaces/html/nsIDOMHTMLTableRowElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTableRowElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90b6-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(45432e97-b2d1-4e54-ba5a-af6f021e39b4)]
 interface nsIDOMHTMLTableRowElement : nsIDOMHTMLElement
 {
   // Modified in DOM Level 2:
   readonly attribute long                 rowIndex;
   // Modified in DOM Level 2:
   readonly attribute long                 sectionRowIndex;
   // Modified in DOM Level 2:
   readonly attribute nsIDOMHTMLCollection cells;
--- a/dom/interfaces/html/nsIDOMHTMLTableSectionElem.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTableSectionElem.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf90b5-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(be77c7dc-fdc4-4d14-9c8b-ee23098d4ff9)]
 interface nsIDOMHTMLTableSectionElement : nsIDOMHTMLElement
 {
            attribute DOMString            align;
            attribute DOMString            ch;
            attribute DOMString            chOff;
            attribute DOMString            vAlign;
   readonly attribute nsIDOMHTMLCollection rows;
   // Modified in DOM Level 2:
--- a/dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl
@@ -45,27 +45,24 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(7a403df9-8911-499b-afbf-98a1bbc20dd1)]
+[scriptable, uuid(ab97985c-914c-4193-92ce-5a4d4b68927c)]
 interface nsIDOMHTMLTextAreaElement : nsIDOMHTMLElement
 {
   // Modified in DOM Level 2:
            attribute DOMString             defaultValue;
   readonly attribute nsIDOMHTMLFormElement form;
-           attribute DOMString             accessKey;
            attribute unsigned long         cols;
            attribute boolean               disabled;
            attribute DOMString             name;
            attribute boolean               readOnly;
            attribute unsigned long         rows;
            attribute long                  tabIndex;
   readonly attribute DOMString             type;
            attribute DOMString             value;
-  void                      blur();
-  void                      focus();
   void                      select();
 };
--- a/dom/interfaces/html/nsIDOMHTMLTitleElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTitleElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf9089-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(98c88210-6291-482c-aaf4-2dbb958dd8c0)]
 interface nsIDOMHTMLTitleElement : nsIDOMHTMLElement
 {
            attribute DOMString        text;
 };
--- a/dom/interfaces/html/nsIDOMHTMLUListElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLUListElement.idl
@@ -45,14 +45,14 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(a6cf9099-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(834c45a3-85a5-49ab-b947-f6a9383eb937)]
 interface nsIDOMHTMLUListElement : nsIDOMHTMLElement
 {
            attribute boolean          compact;
            attribute DOMString        type;
 };
--- a/dom/interfaces/html/nsIDOMHTMLVideoElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLVideoElement.idl
@@ -43,17 +43,17 @@
  * <video> element.
  *
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#video
  *
  * @status UNDER_DEVELOPMENT
  */
 
-[scriptable, uuid(e1f52aa5-9962-4019-b7b3-af3aee6e4d48)]
+[scriptable, uuid(ef602186-7eee-410c-9c4a-eb750749b6ce)]
 interface nsIDOMHTMLVideoElement : nsIDOMHTMLMediaElement
 {
            attribute long width; 
            attribute long height;
   readonly attribute unsigned long videoWidth;
   readonly attribute unsigned long videoHeight;
            attribute DOMString poster;
            
--- a/dom/interfaces/html/nsIDOMNSHTMLElement.idl
+++ b/dom/interfaces/html/nsIDOMNSHTMLElement.idl
@@ -33,17 +33,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "domstubs.idl"
 
-[scriptable, uuid(f0ffe1d2-9615-492b-aae1-05428ebc2a70)]
+[scriptable, uuid(4738f75d-9c6f-40f8-81d0-84b2e4726a8f)]
 interface nsIDOMNSHTMLElement : nsISupports
 {
   readonly attribute long             offsetTop;
   readonly attribute long             offsetLeft;
   readonly attribute long             offsetWidth;
   readonly attribute long             offsetHeight;
   readonly attribute nsIDOMElement    offsetParent;
            attribute DOMString        innerHTML;
@@ -58,15 +58,12 @@ interface nsIDOMNSHTMLElement : nsISuppo
            attribute long             tabIndex;
 
            attribute DOMString        contentEditable;
   readonly attribute boolean          isContentEditable;
 
            // for WHAT-WG drag and drop
            attribute boolean          draggable;
 
-  void blur();
-  void focus();
-
   [optional_argc] void scrollIntoView([optional] in boolean top);
 
            attribute boolean         spellcheck;
 };
--- a/dom/interfaces/html/nsIDOMNSHTMLHRElement.idl
+++ b/dom/interfaces/html/nsIDOMNSHTMLHRElement.idl
@@ -37,13 +37,13 @@
 
 #include "nsISupports.idl"
 
 /**
  * The nsIDOMNSHTMLHRElement interface contains extensions to the
  * interface for [X]HTML hr elements, for compatibility with IE.
  */
 
-[scriptable, uuid(19b5879f-c125-447c-aaaf-719de3ef221a)]
+[scriptable, uuid(63c0ae1b-8aa7-4e72-82a1-aff486bfdaf5)]
 interface nsIDOMNSHTMLHRElement : nsISupports
 {
            attribute DOMString        color;
 };