Revert to changeset e0ce7821fce1 because the latest push broke all of the builds DONTBUILD
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 19 Jul 2011 16:25:54 -0400
changeset 74069 25e22336ce745f5dabea61438b6a781bab9cf580
parent 74068 a2cff1e0ccf14fb69c05dd3b42ecb693e0588a25
child 74070 44f0f4395d6aa694cafc81e80be1f01f7f33a43b
push id67
push userclegnitto@mozilla.com
push dateFri, 04 Nov 2011 22:39:41 +0000
treeherdermozilla-release@04778346a3b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone8.0a1
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
Revert to changeset e0ce7821fce1 because the latest push broke all of the builds DONTBUILD
content/base/public/nsContentUtils.h
content/base/public/nsIDocument.h
content/base/src/nsCommentNode.cpp
content/base/src/nsContentList.h
content/base/src/nsCopySupport.cpp
content/base/src/nsDocument.cpp
content/base/src/nsDocument.h
content/base/src/nsFrameLoader.h
content/base/src/nsGenericDOMDataNode.cpp
content/base/src/nsGenericDOMDataNode.h
content/base/src/nsImageLoadingContent.cpp
content/base/src/nsImageLoadingContent.h
content/base/src/nsMappedAttributeElement.h
content/base/src/nsMappedAttributes.h
content/base/src/nsNodeInfo.cpp
content/base/src/nsObjectLoadingContent.cpp
content/base/src/nsStyledElement.h
content/base/src/nsTextFragment.h
content/base/src/nsTextNode.h
content/base/src/nsTreeWalker.cpp
content/html/content/src/nsGenericHTMLElement.cpp
content/html/content/src/nsGenericHTMLElement.h
content/html/content/test/Makefile.in
content/html/content/test/forms/test_formnovalidate_attribute.html
content/html/content/test/forms/test_input_attributes_reflection.html
content/html/content/test/forms/test_required_attribute.html
content/html/content/test/forms/test_textarea_attributes_reflection.html
content/html/content/test/reflect.js
content/html/content/test/test_bug41464.html
content/html/content/test/test_bug457800.html
content/html/content/test/test_bug546995.html
content/smil/nsSMILMappedAttribute.cpp
content/xbl/src/nsXBLBinding.cpp
content/xbl/src/nsXBLPrototypeBinding.cpp
content/xbl/src/nsXBLService.cpp
content/xbl/src/nsXBLWindowKeyHandler.cpp
content/xml/content/src/nsXMLCDATASection.cpp
content/xml/content/src/nsXMLProcessingInstruction.h
content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp
content/xul/content/src/nsXULPopupListener.cpp
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMNavigationTiming.h
dom/base/nsGlobalWindow.cpp
dom/base/nsGlobalWindow.h
dom/base/nsJSUtils.cpp
dom/base/nsLocation.cpp
dom/base/nsLocation.h
dom/plugins/base/nsNPAPIPluginInstance.cpp
dom/src/notification/nsDesktopNotification.h
editor/libeditor/html/nsHTMLEditor.cpp
layout/base/nsDocumentViewer.cpp
layout/forms/nsButtonFrameRenderer.cpp
layout/generic/nsSelection.cpp
layout/inspector/src/inDOMUtils.cpp
layout/style/nsHTMLStyleSheet.cpp
layout/style/nsHTMLStyleSheet.h
layout/xul/base/src/nsButtonBoxFrame.cpp
layout/xul/base/src/nsResizerFrame.cpp
layout/xul/base/src/nsXULTooltipListener.cpp
toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
widget/src/xpwidgets/nsNativeTheme.cpp
--- a/content/base/public/nsContentUtils.h
+++ b/content/base/public/nsContentUtils.h
@@ -74,23 +74,23 @@ static fp_except_t oldmask = fpsetmask(~
 #include "nsIScriptGlobalObject.h"
 #include "nsIDOMEvent.h"
 #include "nsTArray.h"
 #include "nsTextFragment.h"
 #include "nsReadableUtils.h"
 #include "mozilla/AutoRestore.h"
 #include "nsINode.h"
 #include "nsHashtable.h"
-#include "nsIDOMNode.h"
 
 struct nsNativeKeyEvent; // Don't include nsINativeKeyBindings.h here: it will force strange compilation error!
 
 class nsIDOMScriptObjectFactory;
 class nsIXPConnect;
 class nsIContent;
+class nsIDOMNode;
 class nsIDOMKeyEvent;
 class nsIDocument;
 class nsIDocumentObserver;
 class nsIDocShell;
 class nsINameSpaceManager;
 class nsIScriptSecurityManager;
 class nsIJSContextStack;
 class nsIThreadJSContextStack;
@@ -117,16 +117,17 @@ class nsIScriptContext;
 class nsIRunnable;
 class nsIInterfaceRequestor;
 template<class E> class nsCOMArray;
 template<class K, class V> class nsRefPtrHashtable;
 struct JSRuntime;
 class nsIUGenCategory;
 class nsIWidget;
 class nsIDragSession;
+class nsPIDOMWindow;
 class nsIPresShell;
 class nsIXPConnectJSObjectHolder;
 #ifdef MOZ_XTF
 class nsIXTFService;
 #endif
 #ifdef IBMBIDI
 class nsIBidiKeyboard;
 #endif
--- a/content/base/public/nsIDocument.h
+++ b/content/base/public/nsIDocument.h
@@ -64,17 +64,16 @@
 #ifdef MOZ_SMIL
 #include "nsSMILAnimationController.h"
 #endif // MOZ_SMIL
 #include "nsIScriptGlobalObject.h"
 #include "nsIDocumentEncoder.h"
 #include "nsIAnimationFrameListener.h"
 #include "nsEventStates.h"
 #include "nsIStructuredCloneContainer.h"
-#include "nsDOMMemoryReporter.h"
 
 class nsIContent;
 class nsPresContext;
 class nsIPresShell;
 class nsIDocShell;
 class nsStyleSet;
 class nsIStyleSheet;
 class nsIStyleRule;
@@ -145,17 +144,16 @@ class Element;
 // Gecko.
 class nsIDocument : public nsINode
 {
 public:
   typedef mozilla::dom::Element Element;
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_IID)
   NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
-  NS_DECL_DOM_MEMORY_REPORTER_SIZEOF
 
 #ifdef MOZILLA_INTERNAL_API
   nsIDocument()
     : nsINode(nsnull),
       mCharacterSet(NS_LITERAL_CSTRING("ISO-8859-1")),
       mNodeInfoManager(nsnull),
       mCompatMode(eCompatibility_FullStandards),
       mIsInitialDocumentInWindow(PR_FALSE),
@@ -1528,16 +1526,18 @@ public:
 #define DEPRECATED_OPERATION(_op) e##_op,
   enum DeprecatedOperations {
 #include "nsDeprecatedOperationList.h"
     eDeprecatedOperationCount
   };
 #undef DEPRECATED_OPERATION
   void WarnOnceAbout(DeprecatedOperations aOperation);
 
+  PRInt64 SizeOf() const;
+
 private:
   PRUint32 mWarnedAbout;
 
 protected:
   ~nsIDocument()
   {
     // XXX The cleanup of mNodeInfoManager (calling DropDocumentReference and
     //     releasing it) happens in the nsDocument destructor. We'd prefer to
--- a/content/base/src/nsCommentNode.cpp
+++ b/content/base/src/nsCommentNode.cpp
@@ -38,17 +38,16 @@
 /*
  * Implementations of DOM Core's nsIDOMComment node.
  */
 
 #include "nsIDOMComment.h"
 #include "nsGenericDOMDataNode.h"
 #include "nsCOMPtr.h"
 #include "nsIDocument.h"
-#include "nsDOMMemoryReporter.h"
 
 class nsCommentNode : public nsGenericDOMDataNode,
                       public nsIDOMComment
 {
 public:
   nsCommentNode(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsCommentNode();
 
@@ -56,20 +55,16 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericDOMDataNode::)
 
   // nsIDOMCharacterData
   NS_FORWARD_NSIDOMCHARACTERDATA(nsGenericDOMDataNode::)
 
-  // DOM Memory Reporter participant.
-  NS_DECL_AND_IMPL_DOM_MEMORY_REPORTER_SIZEOF(nsCommentNode,
-                                              nsGenericDOMDataNode)
-
   // nsIDOMComment
   // Empty interface
 
   // nsINode
   virtual PRBool IsNodeOfType(PRUint32 aFlags) const;
 
   virtual nsGenericDOMDataNode* CloneDataNode(nsINodeInfo *aNodeInfo,
                                               PRBool aCloneText) const;
--- a/content/base/src/nsContentList.h
+++ b/content/base/src/nsContentList.h
@@ -51,17 +51,17 @@
 #include "nsIDOMNodeList.h"
 #include "nsINodeList.h"
 #include "nsStubMutationObserver.h"
 #include "nsIAtom.h"
 #include "nsINameSpaceManager.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsWrapperCache.h"
 #include "nsCRT.h"
-#include "nsHashKeys.h"
+#include "mozilla/dom/Element.h"
 
 // Magic namespace id that means "match all namespaces".  This is
 // negative so it won't collide with actual namespace constants.
 #define kNameSpaceID_Wildcard PR_INT32_MIN
 
 // This is a callback function type that can be used to implement an
 // arbitrary matching algorithm.  aContent is the content that may
 // match the list, while aNamespaceID, aAtom, and aData are whatever
@@ -69,21 +69,16 @@
 typedef PRBool (*nsContentListMatchFunc)(nsIContent* aContent,
                                          PRInt32 aNamespaceID,
                                          nsIAtom* aAtom,
                                          void* aData);
 
 typedef void (*nsContentListDestroyFunc)(void* aData);
 
 class nsIDocument;
-namespace mozilla {
-namespace dom {
-class Element;
-}
-}
 
 
 class nsBaseContentList : public nsINodeList
 {
 public:
   virtual ~nsBaseContentList();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
--- a/content/base/src/nsCopySupport.cpp
+++ b/content/base/src/nsCopySupport.cpp
@@ -74,18 +74,16 @@
 #include "nsIFrame.h"
 
 // image copy stuff
 #include "nsIImageLoadingContent.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsContentUtils.h"
 #include "nsContentCID.h"
 
-#include "mozilla/dom/Element.h"
-
 nsresult NS_NewDomSelection(nsISelection **aDomSelection);
 
 static NS_DEFINE_CID(kCClipboardCID,           NS_CLIPBOARD_CID);
 static NS_DEFINE_CID(kCTransferableCID,        NS_TRANSFERABLE_CID);
 static NS_DEFINE_CID(kHTMLConverterCID,        NS_HTMLFORMATCONVERTER_CID);
 
 // private clipboard data flavors for html copy, used by editor when pasting
 #define kHTMLContext   "text/_moz_htmlcontext"
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -8378,16 +8378,8 @@ nsIDocument::SizeOf() const
   for (nsIContent* node = GetFirstChild(); node;
        node = node->GetNextNode(this)) {
     size += node->SizeOf();
   }
 
   return size;
 }
 
-PRInt64
-nsDocument::SizeOf() const
-{
-  PRInt64 size = MemoryReporter::GetBasicSize<nsDocument, nsIDocument>(this);
-  size += mAttrStyleSheet ? mAttrStyleSheet->SizeOf() : 0;
-  return size;
-}
-
--- a/content/base/src/nsDocument.h
+++ b/content/base/src/nsDocument.h
@@ -494,17 +494,16 @@ class nsDocument : public nsIDocument,
                    public nsIApplicationCacheContainer,
                    public nsStubMutationObserver,
                    public nsIDOMDocumentTouch
 {
 public:
   typedef mozilla::dom::Element Element;
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_DOM_MEMORY_REPORTER_SIZEOF
 
   using nsINode::GetScriptTypeID;
 
   virtual void Reset(nsIChannel *aChannel, nsILoadGroup *aLoadGroup);
   virtual void ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup,
                           nsIPrincipal* aPrincipal);
 
   // StartDocumentLoad is pure virtual so that subclasses must override it.
--- a/content/base/src/nsFrameLoader.h
+++ b/content/base/src/nsFrameLoader.h
@@ -48,18 +48,18 @@
 #include "nsStringFwd.h"
 #include "nsIFrameLoader.h"
 #include "nsPoint.h"
 #include "nsSize.h"
 #include "nsIURI.h"
 #include "nsAutoPtr.h"
 #include "nsFrameMessageManager.h"
 #include "Layers.h"
-#include "nsIContent.h"
 
+class nsIContent;
 class nsIURI;
 class nsSubDocumentFrame;
 class nsIView;
 class nsIInProcessContentFrameMessageManager;
 class AutoResetInShow;
 
 namespace mozilla {
 namespace dom {
--- a/content/base/src/nsGenericDOMDataNode.cpp
+++ b/content/base/src/nsGenericDOMDataNode.cpp
@@ -62,17 +62,17 @@
 #include "nsBindingManager.h"
 #include "nsCCUncollectableMarker.h"
 #include "mozAutoDocUpdate.h"
 #include "nsPLDOMEvent.h"
 
 #include "pldhash.h"
 #include "prprf.h"
 
-using namespace mozilla;
+namespace css = mozilla::css;
 
 nsGenericDOMDataNode::nsGenericDOMDataNode(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsIContent(aNodeInfo)
 {
   NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::TEXT_NODE ||
                     mNodeInfo->NodeType() == nsIDOMNode::CDATA_SECTION_NODE ||
                     mNodeInfo->NodeType() == nsIDOMNode::COMMENT_NODE ||
                     mNodeInfo->NodeType() ==
@@ -1060,18 +1060,8 @@ nsGenericDOMDataNode::GetAttributeChange
   return nsChangeHint(0);
 }
 
 nsIAtom*
 nsGenericDOMDataNode::GetClassAttributeName() const
 {
   return nsnull;
 }
-
-PRInt64
-nsGenericDOMDataNode::SizeOf() const
-{
-  PRInt64 size = dom::MemoryReporter::GetBasicSize<nsGenericDOMDataNode,
-                                                   nsIContent>(this);
-  size += mText.SizeOf() - sizeof(mText);
-  return size;
-}
-
--- a/content/base/src/nsGenericDOMDataNode.h
+++ b/content/base/src/nsGenericDOMDataNode.h
@@ -46,17 +46,16 @@
 #include "nsIContent.h"
 #include "nsIDOMCharacterData.h"
 #include "nsTextFragment.h"
 #include "nsDOMError.h"
 #include "nsEventListenerManager.h"
 #include "nsGenericElement.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsContentUtils.h"
-#include "nsDOMMemoryReporter.h"
 
 #ifdef MOZ_SMIL
 #include "nsISMILAttr.h"
 #endif // MOZ_SMIL
 
 // This bit is set to indicate that if the text node changes to
 // non-whitespace, we may need to create a frame for it. This bit must
 // not be set on nodes that already have a frame.
@@ -80,18 +79,16 @@ class nsIDOMText;
 class nsINodeInfo;
 class nsURI;
 
 class nsGenericDOMDataNode : public nsIContent
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
-  NS_DECL_DOM_MEMORY_REPORTER_SIZEOF
-
   nsGenericDOMDataNode(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsGenericDOMDataNode();
 
   // Implementation for nsIDOMNode
   nsresult GetNodeName(nsAString& aNodeName)
   {
     aNodeName = NodeName();
     return NS_OK;
--- a/content/base/src/nsImageLoadingContent.cpp
+++ b/content/base/src/nsImageLoadingContent.cpp
@@ -74,17 +74,16 @@
 #include "nsContentUtils.h"
 #include "nsIContentPolicy.h"
 #include "nsContentPolicyUtils.h"
 #include "nsEventDispatcher.h"
 #include "nsDOMClassInfo.h"
 #include "nsSVGEffects.h"
 
 #include "mozAutoDocUpdate.h"
-#include "mozilla/dom/Element.h"
 
 #ifdef DEBUG_chb
 static void PrintReqURL(imgIRequest* req) {
   if (!req) {
     printf("(null req)\n");
     return;
   }
 
--- a/content/base/src/nsImageLoadingContent.h
+++ b/content/base/src/nsImageLoadingContent.h
@@ -47,17 +47,16 @@
 
 #include "nsIImageLoadingContent.h"
 #include "nsINode.h"
 #include "imgIRequest.h"
 #include "prtypes.h"
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
 #include "nsString.h"
-#include "nsEventStates.h"
 
 class nsIURI;
 class nsIDocument;
 class imgILoader;
 class nsIIOService;
 
 class nsImageLoadingContent : public nsIImageLoadingContent
 {
--- a/content/base/src/nsMappedAttributeElement.h
+++ b/content/base/src/nsMappedAttributeElement.h
@@ -41,17 +41,16 @@
  * nsMappedAttributeElement is the base for elements supporting style mapped
  * attributes via nsMappedAttributes (HTML and MathML).
  */
 
 #ifndef NS_MAPPEDATTRIBUTEELEMENT_H_
 #define NS_MAPPEDATTRIBUTEELEMENT_H_
 
 #include "nsStyledElement.h"
-#include "nsDOMMemoryReporter.h"
 
 class nsMappedAttributes;
 struct nsRuleData;
 
 typedef void (*nsMapRuleToAttributesFunc)(const nsMappedAttributes* aAttributes, 
                                           nsRuleData* aData);
 
 typedef nsStyledElement nsMappedAttributeElementBase;
@@ -61,19 +60,16 @@ class nsMappedAttributeElement : public 
 
 protected:
 
   nsMappedAttributeElement(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsMappedAttributeElementBase(aNodeInfo)
   {}
 
 public:
-  NS_DECL_AND_IMPL_DOM_MEMORY_REPORTER_SIZEOF(nsMappedAttributeElement,
-                                              nsMappedAttributeElementBase)
-
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               PRBool aCompileEventHandlers);
 
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
 
   static void MapNoAttributesInto(const nsMappedAttributes* aAttributes, 
                                   nsRuleData* aRuleData);
--- a/content/base/src/nsMappedAttributes.h
+++ b/content/base/src/nsMappedAttributes.h
@@ -103,22 +103,16 @@ public:
   
 
   // nsIStyleRule 
   virtual void MapRuleInfoInto(nsRuleData* aRuleData);
 #ifdef DEBUG
   virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
 #endif
 
-  PRInt64 SizeOf() const {
-    NS_ASSERTION(mAttrCount == mBufferSize,
-                 "mBufferSize and mAttrCount are expected to be the same.");
-    return sizeof(*this) - sizeof(void*) + mAttrCount * sizeof(InternalAttr);
-  }
-
 private:
   nsMappedAttributes(const nsMappedAttributes& aCopy);
   ~nsMappedAttributes();
 
   struct InternalAttr
   {
     nsAttrName mName;
     nsAttrValue mValue;
--- a/content/base/src/nsNodeInfo.cpp
+++ b/content/base/src/nsNodeInfo.cpp
@@ -50,18 +50,16 @@
 #include "nsDOMString.h"
 #include "nsCRT.h"
 #include "nsContentUtils.h"
 #include "nsReadableUtils.h"
 #include "nsAutoPtr.h"
 #include NEW_H
 #include "nsFixedSizeAllocator.h"
 #include "prprf.h"
-#include "nsIDocument.h"
-#include "nsGkAtoms.h"
 
 static const size_t kNodeInfoPoolSizes[] = {
   sizeof(nsNodeInfo)
 };
 
 static const PRInt32 kNodeInfoPoolInitialSize = 
   (NS_SIZE_IN_HEAP(sizeof(nsNodeInfo))) * 64;
 
--- a/content/base/src/nsObjectLoadingContent.cpp
+++ b/content/base/src/nsObjectLoadingContent.cpp
@@ -91,17 +91,16 @@
 // Concrete classes
 #include "nsFrameLoader.h"
 
 #include "nsObjectLoadingContent.h"
 #include "mozAutoDocUpdate.h"
 #include "nsIContentSecurityPolicy.h"
 #include "nsIChannelPolicy.h"
 #include "nsChannelPolicy.h"
-#include "mozilla/dom/Element.h"
 
 #ifdef PR_LOGGING
 static PRLogModuleInfo* gObjectLog = PR_NewLogModule("objlc");
 #endif
 
 #define LOG(args) PR_LOG(gObjectLog, PR_LOG_DEBUG, args)
 #define LOG_ENABLED() PR_LOG_TEST(gObjectLog, PR_LOG_DEBUG)
 
--- a/content/base/src/nsStyledElement.h
+++ b/content/base/src/nsStyledElement.h
@@ -43,17 +43,16 @@
  * SVG and MathML.
  */
 
 #ifndef __NS_STYLEDELEMENT_H_
 #define __NS_STYLEDELEMENT_H_
 
 #include "nsString.h"
 #include "nsGenericElement.h"
-#include "nsDOMMemoryReporter.h"
 
 namespace mozilla {
 namespace css {
 class StyleRule;
 }
 }
 
 typedef nsGenericElement nsStyledElementBase;
@@ -64,19 +63,16 @@ class nsStyledElementNotElementCSSInline
 protected:
 
   inline nsStyledElementNotElementCSSInlineStyle(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsStyledElementBase(aNodeInfo)
   {}
 
 public:
 
-  NS_DECL_AND_IMPL_DOM_MEMORY_REPORTER_SIZEOF(nsStyledElementNotElementCSSInlineStyle,
-                                              nsStyledElementBase)
-
   // nsIContent interface methods
   virtual nsIAtom* GetClassAttributeName() const;
   virtual nsIAtom* GetIDAttributeName() const;
   virtual nsIAtom* DoGetID() const;
   virtual const nsAttrValue* DoGetClasses() const;
 
   virtual mozilla::css::StyleRule* GetInlineStyleRule();
   NS_IMETHOD SetInlineStyleRule(mozilla::css::StyleRule* aStyleRule, PRBool aNotify);
@@ -114,19 +110,15 @@ protected:
    * first put into a document.  Only has an effect if the old value is a
    * string.  If aForceInDataDoc is true, will reparse even if we're in a data
    * document.
    */
   nsresult  ReparseStyleAttribute(PRBool aForceInDataDoc);
 };
 
 class nsStyledElement : public nsStyledElementNotElementCSSInlineStyle {
-public:
-  NS_DECL_AND_IMPL_DOM_MEMORY_REPORTER_SIZEOF(nsStyledElement,
-                                              nsStyledElementNotElementCSSInlineStyle)
-
 protected:
   inline nsStyledElement(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsStyledElementNotElementCSSInlineStyle(aNodeInfo)
   {}
 };
 
 #endif // __NS_STYLEDELEMENT_H_
--- a/content/base/src/nsTextFragment.h
+++ b/content/base/src/nsTextFragment.h
@@ -42,18 +42,16 @@
  */
 
 #ifndef nsTextFragment_h___
 #define nsTextFragment_h___
 
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsTraceRefcnt.h"
-#include "nsDOMMemoryReporter.h"
-
 class nsString;
 class nsCString;
 
 // XXX should this normalize the code to keep a \u0000 at the end?
 
 // XXX nsTextFragmentPool?
 
 // XXX these need I18N spankage
@@ -76,17 +74,17 @@ class nsCString;
  * A fragment of text. If mIs2b is 1 then the m2b pointer is valid
  * otherwise the m1b pointer is valid. If m1b is used then each byte
  * of data represents a single ucs2 character with the high byte being
  * zero.
  *
  * This class does not have a virtual destructor therefore it is not
  * meant to be subclassed.
  */
-class NS_FINAL_CLASS nsTextFragment {
+class nsTextFragment {
 public:
   static nsresult Init();
   static void Shutdown();
 
   /**
    * Default constructor. Initialize the fragment to be empty.
    */
   nsTextFragment()
@@ -221,31 +219,16 @@ public:
     // which causes crashes because we assume this structure is no more than
     // 32 bits!
     PRUint32 mInHeap : 1;
     PRUint32 mIs2b : 1;
     PRUint32 mIsBidi : 1;
     PRUint32 mLength : 29;
   };
 
-  /**
-   * Returns the size taken in memory by this text fragment.
-   * @return the size taken in memory by this text fragment.
-   */
-  PRInt64 SizeOf() const
-  {
-    PRInt64 size = sizeof(*this);
-
-    if (mState.mInHeap) {
-      size += GetLength() * Is2b() ? sizeof(*m2b) : sizeof(*m1b);
-    }
-
-    return size;
-  }
-
 private:
   void ReleaseText();
 
   union {
     PRUnichar *m2b;
     const char *m1b; // This is const since it can point to shared data
   };
 
--- a/content/base/src/nsTextNode.h
+++ b/content/base/src/nsTextNode.h
@@ -42,17 +42,16 @@
 #include "nsGenericDOMDataNode.h"
 #include "nsIDOMText.h"
 #include "nsContentUtils.h"
 #include "nsIDOMEventListener.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsIAttribute.h"
 #include "nsIDocument.h"
 #include "nsThreadUtils.h"
-#include "nsDOMMemoryReporter.h"
 
 /**
  * Class used to implement DOM text nodes
  */
 class nsTextNode : public nsGenericDOMDataNode,
                    public nsIDOMText
 {
 public:
@@ -66,19 +65,16 @@ public:
   NS_FORWARD_NSIDOMNODE(nsGenericDOMDataNode::)
 
   // nsIDOMCharacterData
   NS_FORWARD_NSIDOMCHARACTERDATA(nsGenericDOMDataNode::)
 
   // nsIDOMText
   NS_FORWARD_NSIDOMTEXT(nsGenericDOMDataNode::)
 
-  // DOM Memory Reporter participant.
-  NS_DECL_AND_IMPL_DOM_MEMORY_REPORTER_SIZEOF(nsTextNode, nsGenericDOMDataNode)
-
   // nsINode
   virtual PRBool IsNodeOfType(PRUint32 aFlags) const;
 
   virtual nsGenericDOMDataNode* CloneDataNode(nsINodeInfo *aNodeInfo,
                                               PRBool aCloneText) const;
 
   nsresult BindToAttribute(nsIAttribute* aAttr);
   nsresult UnbindFromAttribute();
--- a/content/base/src/nsTreeWalker.cpp
+++ b/content/base/src/nsTreeWalker.cpp
@@ -42,18 +42,16 @@
  * Implementation of DOM Traversal's nsIDOMTreeWalker
  */
 
 #include "nsTreeWalker.h"
 
 #include "nsIDOMNode.h"
 #include "nsIDOMNodeFilter.h"
 #include "nsDOMError.h"
-#include "nsINode.h"
-#include "nsIContent.h"
 
 #include "nsContentUtils.h"
 
 /*
  * Factories, constructors and destructors
  */
 
 nsTreeWalker::nsTreeWalker(nsINode *aRoot,
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -3223,26 +3223,16 @@ nsGenericHTMLFrameElement::CopyInnerTo(n
     NS_ENSURE_STATE(fl);
     dest->mFrameLoader = fl;
     static_cast<nsFrameLoader*>(mFrameLoader.get())->CreateStaticClone(fl);
   }
 
   return rv;
 }
 
-PRInt64
-nsGenericHTMLFrameElement::SizeOf() const
-{
-  PRInt64 size = MemoryReporter::GetBasicSize<nsGenericHTMLFrameElement,
-                                              nsGenericHTMLElement>(this);
-  // TODO: need to implement SizeOf() in nsFrameLoader, bug 672539.
-  size += mFrameLoader ? sizeof(*mFrameLoader.get()) : 0;
-  return size;
-}
-
 //----------------------------------------------------------------------
 
 nsresult
 nsGenericHTMLElement::Blur()
 {
   if (!ShouldBlur(this))
     return NS_OK;
 
--- a/content/html/content/src/nsGenericHTMLElement.h
+++ b/content/html/content/src/nsGenericHTMLElement.h
@@ -41,17 +41,16 @@
 #include "nsMappedAttributeElement.h"
 #include "nsIDOMHTMLElement.h"
 #include "nsINameSpaceManager.h"  // for kNameSpaceID_None
 #include "nsIFormControl.h"
 #include "nsIDOMNSHTMLFrameElement.h"
 #include "nsFrameLoader.h"
 #include "nsGkAtoms.h"
 #include "nsContentCreatorFunctions.h"
-#include "nsDOMMemoryReporter.h"
 
 class nsIDOMAttr;
 class nsIDOMEventListener;
 class nsIDOMNodeList;
 class nsIFrame;
 class nsIStyleRule;
 class nsChildContentList;
 class nsDOMCSSDeclaration;
@@ -77,19 +76,16 @@ class nsGenericHTMLElement : public nsGe
 public:
   nsGenericHTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsGenericHTMLElementBase(aNodeInfo)
   {
     NS_ASSERTION(mNodeInfo->NamespaceID() == kNameSpaceID_XHTML,
                  "Unexpected namespace");
   }
 
-  NS_DECL_AND_IMPL_DOM_MEMORY_REPORTER_SIZEOF(nsGenericHTMLElement,
-                                              nsGenericHTMLElementBase)
-
   /** Typesafe, non-refcounting cast from nsIContent.  Cheaper than QI. **/
   static nsGenericHTMLElement* FromContent(nsIContent *aContent)
   {
     if (aContent->IsHTML())
       return static_cast<nsGenericHTMLElement*>(aContent);
     return nsnull;
   }
 
@@ -819,19 +815,16 @@ private:
  */
 class nsGenericHTMLFormElement : public nsGenericHTMLElement,
                                  public nsIFormControl
 {
 public:
   nsGenericHTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsGenericHTMLFormElement();
 
-  NS_DECL_AND_IMPL_DOM_MEMORY_REPORTER_SIZEOF(nsGenericHTMLFormElement,
-                                              nsGenericHTMLElement)
-
   NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
 
   virtual PRBool IsNodeOfType(PRUint32 aFlags) const;
   virtual void SaveSubtreeState();
 
   // nsIFormControl
   virtual mozilla::dom::Element* GetFormElement();
   virtual void SetForm(nsIDOMHTMLFormElement* aForm);
@@ -1008,18 +1001,16 @@ public:
   nsGenericHTMLFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                             mozilla::dom::FromParser aFromParser)
     : nsGenericHTMLElement(aNodeInfo)
   {
     mNetworkCreated = aFromParser == mozilla::dom::FROM_PARSER_NETWORK;
   }
   virtual ~nsGenericHTMLFrameElement();
 
-  NS_DECL_DOM_MEMORY_REPORTER_SIZEOF
-
   // nsISupports
   NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
 
   // nsIDOMNSHTMLFrameElement
   NS_DECL_NSIDOMNSHTMLFRAMEELEMENT
 
   // nsIFrameLoaderOwner
   NS_DECL_NSIFRAMELOADEROWNER
--- a/content/html/content/test/Makefile.in
+++ b/content/html/content/test/Makefile.in
@@ -67,16 +67,17 @@ include $(topsrcdir)/config/rules.mk
 		test_bug696.html \
 		test_bug1297.html \
 		test_bug1366.html \
 		test_bug1400.html \
 		test_bug2082.html \
 		test_bug3348.html \
 		test_bug6296.html \
 		test_bug24958.html \
+		test_bug41464.html \
 		bug100533_load.html \
 		bug100533_iframe.html \
 		test_bug100533.html \
 		image.png \
 		test_bug109445.html \
 		test_bug109445.xhtml \
 		test_bug143220.html \
 		test_bug182279.html \
@@ -173,16 +174,17 @@ include $(topsrcdir)/config/rules.mk
 		test_bug519987.html \
 		test_bug579079.html \
 		test_bug523771.html \
 		form_submit_server.sjs \
 		test_bug529819.html \
 		test_bug529859.html \
 		test_bug535043.html \
 		test_bug547850.html \
+		test_bug457800.html \
 		test_bug536891.html \
 		test_bug536895.html \
 		test_bug458037.xhtml \
 		test_bug556645.html \
 		test_bug555567.html \
 		test_bug557620.html \
 		test_bug456229.html \
 		test_bug546995.html \
--- a/content/html/content/test/forms/test_formnovalidate_attribute.html
+++ b/content/html/content/test/forms/test_formnovalidate_attribute.html
@@ -70,16 +70,17 @@ function checkFormNoValidateAttribute(aE
     "formnovalidate attribute should be enabled");
 
   element.removeAttribute('formnovalidate');
   ok(!element.formNoValidate, "formnovalidate attribute should be disabled");
   is(element.getAttribute('formnovalidate'), null,
     "formnovalidate attribute should be disabled");
 }
 
+checkFormNoValidateAttribute('input');
 checkFormNoValidateAttribute('button');
 
 netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
 var os = Components.classes['@mozilla.org/observer-service;1']
                    .getService(Components.interfaces.nsIObserverService);
 var observers = os.enumerateObservers("invalidformsubmit");
 
 /**
--- a/content/html/content/test/forms/test_input_attributes_reflection.html
+++ b/content/html/content/test/forms/test_input_attributes_reflection.html
@@ -35,40 +35,21 @@ reflectString({
 // .autocomplete
 reflectLimitedEnumerated({
   element: document.createElement("input"),
   attribute: "autocomplete",
   validValues: [ "on", "off" ],
   invalidValues: [ "", "default", "foo", "tulip" ],
 });
 
-// .autofocus
-reflectBoolean({
-  element: document.createElement("input"),
-  attribute: "autofocus",
-});
-
-// .defaultChecked
-reflectBoolean({
-  element: document.createElement("input"),
-  attribute: { idl: "defaultChecked", content: "checked" },
-});
-
-// .checked doesn't reflect a content attribute.
-
-// .dirName
-todo("dirName" in document.createElement("input"),
-     "dirName isn't implemented yet");
-
-// .disabled
-reflectBoolean({
-  element: document.createElement("input"),
-  attribute: "disabled",
-});
-
+// TODO: autofocus (boolean)
+// TODO: defaultChecked (boolean)
+// TODO: checked (boolean)
+// TODO: dirName (not implemented)
+// TODO: disabled (boolean)
 // TODO: form (HTMLFormElement)
 // TODO: files (FileList)
 // TODO: formAction (URL)
 
 // .formEnctype
 reflectLimitedEnumerated({
   element: document.createElement("input"),
   attribute: "formEnctype",
@@ -82,48 +63,32 @@ reflectLimitedEnumerated({
 reflectLimitedEnumerated({
   element: document.createElement("input"),
   attribute: "formMethod",
   validValues: [ "get", "post" ],
   invalidValues: [ "", "foo", "tulip" ],
   defaultValue: "get"
 });
 
-// .formNoValidate
-reflectBoolean({
-  element: document.createElement("input"),
-  attribute: "formNoValidate",
-});
+// TODO: formNoValidate (boolean)
 
 // .formTarget
 reflectString({
   element: document.createElement("input"),
   attribute: "formTarget",
   otherValues: [ "_blank", "_self", "_parent", "_top" ],
 });
 
 // TODO: height (non-negative integer)
-
-// .indeterminate doesn't reflect a content attribute.
-
+// TODO: indeterminate (boolean)
 // TODO: list (HTMLElement)
-
-// .max
-todo("max" in document.createElement("input"), "max isn't implemented yet");
-
+// TODO: max (not implemented)
 // TODO: maxLength (long)
-
-// .min
-todo("min" in document.createElement("input"), "min isn't implemented yet");
-
-// .multiple
-reflectBoolean({
-  element: document.createElement("input"),
-  attribute: "multiple",
-});
+// TODO: min (not implemented)
+// TODO: multiple (boolean)
 
 // .name
 reflectString({
   element: document.createElement("input"),
   attribute: "name",
   otherValues: [ "isindex", "_charset_" ],
 });
 
@@ -136,40 +101,29 @@ reflectString({
 
 // .placeholder
 reflectString({
   element: document.createElement("input"),
   attribute: "placeholder",
   otherValues: [ "foo\nbar", "foo\rbar", "foo\r\nbar" ],
 });
 
-// .readOnly
-reflectBoolean({
-  element: document.createElement("input"),
-  attribute: "readOnly",
-});
-
-// .required
-reflectBoolean({
-  element: document.createElement("input"),
-  attribute: "required",
-});
+// TODO: readOnly (boolean)
+// TODO: required (boolean)
 
 // .size
 reflectUnsignedInt({
   element: document.createElement("input"),
   attribute: "size",
   nonZero: true,
   defaultValue: 20,
 });
 
 // TODO: src (URL)
-
-// .step
-todo("step" in document.createElement("input"), "step isn't implemented yet");
+// TODO: step (not implemented)
 
 // .type
 reflectLimitedEnumerated({
   element: document.createElement("input"),
   attribute: "type",
   validValues: [ "hidden", "text", "search", "tel", "url", "email", "password",
                  "checkbox", "radio", "file", "submit", "image", "reset",
                  "button" ],
@@ -182,31 +136,20 @@ reflectLimitedEnumerated({
 // .defaultValue
 reflectString({
   element: document.createElement("input"),
   attribute: { idl: "defaultValue", content: "value" },
   otherValues: [ "foo\nbar", "foo\rbar", "foo\r\nbar" ],
 });
 
 // .value doesn't reflect a content attribute.
-
-// .valueAsDate
-todo("valueAsDate" in document.createElement("input"),
-     "valueAsDate isn't implemented yet");
-
-// .valueAsNumber
-todo("valueAsNumber" in document.createElement("input"),
-     "valueAsNumber isn't implemented yet");
-
-// .selectedOption
-todo("selectedOption" in document.createElement("input"),
-     "selectedOption isn't implemented yet");
-
+// TODO: valueAsDate (not implemented)
+// TODO: valueAsNumber (not implemented)
+// TODO: selectedOption (not implemented)
 // TODO: width (non-negative integer)
-
 // .willValidate doesn't reflect a content attribute.
 // .validity doesn't reflect a content attribute.
 // .validationMessage doesn't reflect a content attribute.
 // .labels doesn't reflect a content attribute.
 
 </script>
 </pre>
 </body>
--- a/content/html/content/test/forms/test_required_attribute.html
+++ b/content/html/content/test/forms/test_required_attribute.html
@@ -21,16 +21,41 @@ https://bugzilla.mozilla.org/show_bug.cg
   <form>
   </form>
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 345822 **/
 
+function checkRequiredAttribute(element)
+{
+  ok('required' in element, "Element should have the required attribute");
+
+  ok(!element.required, "Element required attribute should be disabled");
+  is(element.getAttribute('required'), null,
+    "Element required attribute should be disabled");
+
+  element.required = true;
+  ok(element.required, "Element required attribute should be enabled");
+  isnot(element.getAttribute('required'), null,
+    "Element required attribute should be enabled");
+
+  element.removeAttribute('required');
+  element.setAttribute('required', '');
+  ok(element.required, "Element required attribute should be enabled");
+  isnot(element.getAttribute('required'), null,
+    "Element required attribute should be enabled");
+
+  element.removeAttribute('required');
+  ok(!element.required, "Element required attribute should be disabled");
+  is(element.getAttribute('required'), null,
+    "Element required attribute should be disabled");
+}
+
 function checkNotSufferingFromBeingMissing(element, doNotApply)
 {
   ok(!element.validity.valueMissing,
     "Element should not suffer from value missing");
   ok(element.validity.valid, "Element should be valid");
   ok(element.checkValidity(), "Element should be valid");
   is(element.validationMessage, "",
     "Validation message should be the empty string");
@@ -294,18 +319,22 @@ function checkInputRequiredValidityForFi
 
   element.required = false;
   checkNotSufferingFromBeingMissing(element);
 
   file.remove(false);
   document.forms[0].removeChild(element);
 }
 
+checkRequiredAttribute(document.createElement('textarea'));
 checkTextareaRequiredValidity();
 
+// Every input element should have the required attribute.
+checkRequiredAttribute(document.createElement('input'));
+
 // The require attribute behavior depend of the input type.
 // First of all, checks for types that make the element barred from
 // constraint validation.
 var typeBarredFromConstraintValidation = ["hidden", "button", "reset", "submit", "image"];
 for each (type in typeRequireNotApply) {
   checkInputRequiredNotApply(type, true);
 }
 
--- a/content/html/content/test/forms/test_textarea_attributes_reflection.html
+++ b/content/html/content/test/forms/test_textarea_attributes_reflection.html
@@ -9,89 +9,28 @@
 </head>
 <body>
 <p id="display"></p>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for HTMLTextAreaElement attributes reflection **/
 
-// .autofocus
-reflectBoolean({
-  element: document.createElement("textarea"),
-  attribute: "autofocus",
+var textarea = document.createElement("textarea");
+
+reflectUnsignedInt({
+  element: textarea,
+  attribute: "rows",
+  nonZero: true,
+  defaultValue: 2,
 });
 
-//.cols
 reflectUnsignedInt({
-  element: document.createElement("textarea"),
+  element: textarea,
   attribute: "cols",
   nonZero: true,
   defaultValue: 20,
 });
 
-todo("dirName" in document.createElement("textarea"),
-     "dirName isn't implemented yet");
-
-// .disabled
-reflectBoolean({
-  element: document.createElement("textarea"),
-  attribute: "disabled",
-});
-
-// TODO: form (HTMLFormElement)
-// TODO: maxLength (long)
-
-// .name
-reflectString({
-  element: document.createElement("textarea"),
-  attribute: "name",
-  otherValues: [ "isindex", "_charset_" ],
-});
-
-// .placeholder
-reflectString({
-  element: document.createElement("textarea"),
-  attribute: "placeholder",
-  otherValues: [ "foo\nbar", "foo\rbar", "foo\r\nbar" ],
-});
-
-// .readOnly
-reflectBoolean({
-  element: document.createElement("textarea"),
-  attribute: "readOnly",
-});
-
-// .required
-reflectBoolean({
-  element: document.createElement("textarea"),
-  attribute: "required",
-});
-
-// .rows
-reflectUnsignedInt({
-  element: document.createElement("textarea"),
-  attribute: "rows",
-  nonZero: true,
-  defaultValue: 2,
-});
-
-// .wrap
-// TODO: make it an enumerated attributes limited to only known values, bug 670869.
-reflectString({
-  element: document.createElement("textarea"),
-  attribute: "wrap",
-  otherValues: [ "soft", "hard" ],
-});
-
-// .type doesn't reflect a content attribute.
-// .defaultValue doesn't reflect a content attribute.
-// .value doesn't reflect a content attribute.
-// .textLength doesn't reflect a content attribute.
-// .willValidate doesn't reflect a content attribute.
-// .validity doesn't reflect a content attribute.
-// .validationMessage doesn't reflect a content attribute.
-// .labels doesn't reflect a content attribute.
-
 </script>
 </pre>
 </body>
 </html>
--- a/content/html/content/test/reflect.js
+++ b/content/html/content/test/reflect.js
@@ -50,29 +50,21 @@ function reflectString(aParameters)
   element.setAttribute(contentAttr, null);
   todo_is(element.getAttribute(contentAttr), "null",
      "null should have been stringified to 'null'");
   todo_is(element[idlAttr], "null",
      "null should have been stringified to 'null'");
   element.removeAttribute(contentAttr);
 
   element[idlAttr] = null;
-  // TODO: remove this ugly hack when null stringification will work as expected.
-  if (element.tagName == "TEXTAREA" && idlAttr == "wrap") {
-    is(element.getAttribute(contentAttr), "null",
-       "null should have been stringified to 'null'");
-    is(element[idlAttr], "null", "null should have been stringified to 'null'");
-    element.removeAttribute(contentAttr);
-  } else {
-    todo_is(element.getAttribute(contentAttr), "null",
-       "null should have been stringified to 'null'");
-    todo_is(element[idlAttr], "null",
-       "null should have been stringified to 'null'");
-    element.removeAttribute(contentAttr);
-  }
+  todo_is(element.getAttribute(contentAttr), "null",
+     "null should have been stringified to 'null'");
+  todo_is(element[idlAttr], "null",
+     "null should have been stringified to 'null'");
+  element.removeAttribute(contentAttr);
 
   // Tests various strings.
   var stringsToTest = [
     // [ test value, expected result ]
     [ "", "" ],
     [ "null", "null" ],
     [ "undefined", "undefined" ],
     [ "foo", "foo" ],
@@ -337,110 +329,8 @@ function reflectLimitedEnumerated(aParam
     todo_is(element[attr], v,
             "Enumerated attributes should be case-insensitive.");
     is(element.getAttribute(attr), v.toUpperCase(),
        "Content attribute should not be lower-cased.");
     element.removeAttribute(attr);
   });
 }
 
-/**
- * Checks that a given attribute is correctly reflected as a boolean.
- *
- * @param aParameters    Object    object containing the parameters, which are:
- *  - element            Element   node to test on
- *  - attribute          String    name of the attribute
- *     OR
- *    attribute          Object    object containing two attributes, 'content' and 'idl'
- */
-function reflectBoolean(aParameters)
-{
-  var element = aParameters.element;
-  var contentAttr = typeof aParameters.attribute === "string"
-                      ? aParameters.attribute : aParameters.attribute.content;
-  var idlAttr = typeof aParameters.attribute === "string"
-                  ? aParameters.attribute : aParameters.attribute.idl;
-
-  ok(idlAttr in element,
-     idlAttr + " should be an IDL attribute of this element");
-  is(typeof element[idlAttr], "boolean",
-     idlAttr + " IDL attribute should be a boolean");
-
-  // Tests when the attribute isn't set.
-  is(element.getAttribute(contentAttr), null,
-     "When not set, the content attribute should be null.");
-  is(element[idlAttr], false,
-     "When not set, the IDL attribute should return false");
-
-  /**
-   * Test various values.
-   * Each value to test is actually an object containing a 'value' property
-   * containing the value to actually test, a 'stringified' property containing
-   * the stringified value and a 'result' property containing the expected
-   * result when the value is set to the IDL attribute.
-   */
-  var valuesToTest = [
-    { value: true, stringified: "true", result: true },
-    { value: false, stringified: "false", result: false },
-    { value: "true", stringified: "true", result: true },
-    { value: "false", stringified: "false", result: true },
-    { value: "foo", stringified: "foo", result: true },
-    { value: idlAttr, stringified: idlAttr, result: true },
-    { value: contentAttr, stringified: contentAttr, result: true },
-    { value: "null", stringified: "null", result: true },
-    { value: "undefined", stringified: "undefined", result: true },
-    { value: "", stringified: "", result: false },
-    { value: undefined, stringified: "undefined", result: false },
-    { value: null, stringified: "null", result: false },
-    { value: +0, stringified: "0", result: false },
-    { value: -0, stringified: "0", result: false },
-    { value: NaN, stringified: "NaN", result: false },
-    { value: 42, stringified: "42", result: true },
-    { value: Infinity, stringified: "Infinity", result: true },
-    { value: -Infinity, stringified: "-Infinity", result: true },
-    // ES5, verse 9.2.
-    { value: { toString: function() { return "foo" } }, stringified: "foo",
-      result: true },
-    { value: { valueOf: function() { return "foo" } },
-      stringified: "[object Object]", result: true },
-    { value: { valueOf: function() { return "quux" }, toString: undefined },
-      stringified: "quux", result: true },
-    { value: { valueOf: function() { return "foo" },
-               toString: function() { return "bar" } }, stringified: "bar",
-      result: true },
-    { value: { valueOf: function() { return false } },
-      stringified: "[object Object]", result: true },
-    { value: { foo: false, bar: false }, stringified: "[object Object]",
-      result: true },
-    { value: { }, stringified: "[object Object]", result: true },
-  ];
-
-  valuesToTest.forEach(function(v) {
-    element.setAttribute(contentAttr, v.value);
-    is(element[idlAttr], true,
-       "IDL attribute should return always return 'true' if the content attribute has been set");
-    if (v.value === null) {
-      // bug 667856
-      todo(element.getAttribute(contentAttr), v.stringified,
-           "Content attribute should return the stringified value it has been set to.");
-    } else {
-      is(element.getAttribute(contentAttr), v.stringified,
-         "Content attribute should return the stringified value it has been set to.");
-    }
-    element.removeAttribute(contentAttr);
-
-    element[idlAttr] = v.value;
-    is(element[idlAttr], v.result, "IDL attribute should return " + v.result);
-    is(element.getAttribute(contentAttr), v.result ? "" : null,
-       v.result ? "Content attribute should return the empty string."
-                : "Content attribute should return null.");
-    is(element.hasAttribute(contentAttr), v.result,
-       v.result ? contentAttr + " should not be present"
-                : contentAttr + " should be present");
-    element.removeAttribute(contentAttr);
-  });
-
-  // Tests after removeAttribute() is called. Should be equivalent with not set.
-  is(element.getAttribute(contentAttr), null,
-     "When not set, the content attribute should be null.");
-  is(element[contentAttr], false,
-     "When not set, the IDL attribute should return false");
-}
new file mode 100644
--- /dev/null
+++ b/content/html/content/test/test_bug41464.html
@@ -0,0 +1,52 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=41464
+-->
+<head>
+  <title>Test for Bug 41464</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=41464">Mozilla Bug 41464</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+<textarea wrap=cheesecake></textarea>  
+</div>
+<pre id="test">
+<script type="application/javascript">
+/** Test for Bug 41464 **/
+var textarea = document.getElementById("content").getElementsByTagName("textarea")[0];
+is(textarea.wrap, "cheesecake");
+is(textarea.hasAttribute("wrap"), true);
+is(textarea.getAttribute("wrap"), "cheesecake");
+
+textarea.setAttribute("wrap", "off");
+is(textarea.wrap, "off");
+is(textarea.hasAttribute("wrap"), true);
+is(textarea.getAttribute("wrap"), "off");
+
+textarea.wrap = "soft";
+is(textarea.wrap, "soft");
+is(textarea.hasAttribute("wrap"), true);
+is(textarea.getAttribute("wrap"), "soft");
+
+textarea.wrap = undefined;
+is(textarea.wrap, "undefined");
+is(textarea.hasAttribute("wrap"), true);
+is(textarea.getAttribute("wrap"), "undefined");
+
+textarea.wrap = null;
+is(textarea.wrap, "null");
+is(textarea.hasAttribute("wrap"), true);
+is(textarea.getAttribute("wrap"), "null");
+
+textarea.removeAttribute("wrap");
+is(textarea.wrap, "");
+is(textarea.hasAttribute("wrap"), false);
+</script>
+</pre>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/content/html/content/test/test_bug457800.html
@@ -0,0 +1,57 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=457800
+-->
+<head>
+  <title>Test for Bug 457800</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=457800">Mozilla Bug 457800</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+  <textarea id="textarea"></textarea>
+</div>
+<pre id="test">
+<script type="application/javascript">
+
+/** Test for Bug 457800 **/
+
+function testPlaceholderForElement(element)
+{
+  // init
+  element.value = ''
+
+  // check if {g,s}etAttribute are working
+  element.setAttribute('placeholder', 'placeholder');
+  is(element.getAttribute('placeholder'), 'placeholder', "element has no placeholder attribute");
+
+  // check if placeholder is working through DOM interface
+  is(element.placeholder, 'placeholder', "can't read placeholder in DOM interface");
+  element.placeholder = 'ph';
+  is(element.placeholder, 'ph', "can't write placeholder in DOM interface");
+
+  // check placeholder and value are not interfering
+  is(element.value, '', "value has changed when placeholder has changed");
+  element.value = 'value';
+  is(element.placeholder, 'ph', "placeholder in DOM interface has changed when value has changed");
+  is(element.getAttribute('placeholder'), 'ph', "placeholder attribute has changed when value has changed");
+
+  // check new lines are managed correctly (shouldn't be shown but kept in the DOM)
+  element.placeholder = 'place\nholder';
+  is(element.placeholder, 'place\nholder', "\\n shouldn't be stripped");
+  is(element.getAttribute('placeholder'), 'place\nholder', "\\n shouldn't be stripped");
+  element.placeholder = 'place\rholder';
+  is(element.placeholder, 'place\rholder', "\\r shouldn't be stripped");
+  is(element.getAttribute('placeholder'), 'place\rholder', "\\r shouldn't be stripped");
+}
+
+testPlaceholderForElement(document.getElementById('textarea'));
+
+</script>
+</pre>
+</body>
+</html>
--- a/content/html/content/test/test_bug546995.html
+++ b/content/html/content/test/test_bug546995.html
@@ -8,16 +8,18 @@ https://bugzilla.mozilla.org/show_bug.cg
   <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=546995">Mozilla Bug 546995</a>
 <p id="display"></p>
 <div id="content" style="display: none">
+  <input id='i'>
+  <textarea id='t'></textarea>
   <select id='s'></select>
   <button id='b'></button>
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 546995 **/
 
@@ -29,15 +31,17 @@ function checkAutofocusIDLAttribute(elem
   ok(!element.autofocus, "autofocus default value is false");
   element.setAttribute('autofocus', 'autofocus');
   ok(element.autofocus, "autofocus should be enabled");
   element.removeAttribute('autofocus');
   ok(!element.autofocus, "autofocus should be disabled");
 }
 
 // TODO: keygen should be added when correctly implemented, see bug 101019.
+checkAutofocusIDLAttribute(document.getElementById('i'));
+checkAutofocusIDLAttribute(document.getElementById('t'));
 checkAutofocusIDLAttribute(document.getElementById('s'));
 checkAutofocusIDLAttribute(document.getElementById('b'));
 
 </script>
 </pre>
 </body>
 </html>
--- a/content/smil/nsSMILMappedAttribute.cpp
+++ b/content/smil/nsSMILMappedAttribute.cpp
@@ -40,17 +40,16 @@
 #include "nsPropertyTable.h"
 #include "nsContentErrors.h" // For NS_PROPTABLE_PROP_OVERWRITTEN
 #include "nsSMILValue.h"
 #include "nsSMILCSSValueType.h"
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsIPresShell.h"
 #include "nsCSSProps.h"
-#include "mozilla/dom/Element.h"
 
 // Callback function, for freeing string buffers stored in property table
 static void
 ReleaseStringBufferPropertyValue(void*    aObject,       /* unused */
                                  nsIAtom* aPropertyName, /* unused */
                                  void*    aPropertyValue,
                                  void*    aData          /* unused */)
 {
--- a/content/xbl/src/nsXBLBinding.cpp
+++ b/content/xbl/src/nsXBLBinding.cpp
@@ -99,18 +99,16 @@
 #include "prprf.h"
 #include "nsNodeUtils.h"
 
 // Nasty hack.  Maybe we could move some of the classinfo utility methods
 // (e.g. WrapNative and ThrowJSException) over to nsContentUtils?
 #include "nsDOMClassInfo.h"
 #include "nsJSUtils.h"
 
-#include "mozilla/dom/Element.h"
-
 // Helper classes
 
 /***********************************************************************/
 //
 // The JS class for XBLBinding
 //
 static void
 XBLFinalize(JSContext *cx, JSObject *obj)
--- a/content/xbl/src/nsXBLPrototypeBinding.cpp
+++ b/content/xbl/src/nsXBLPrototypeBinding.cpp
@@ -69,17 +69,16 @@
 #include "nsXBLProtoImpl.h"
 #include "nsCRT.h"
 #include "nsContentUtils.h"
 
 #include "nsIScriptContext.h"
 
 #include "nsIStyleRuleProcessor.h"
 #include "nsXBLResourceLoader.h"
-#include "mozilla/dom/Element.h"
 
 // Helper Classes =====================================================================
 
 // nsXBLAttributeEntry and helpers.  This class is used to efficiently handle
 // attribute changes in anonymous content.
 
 class nsXBLAttributeEntry {
 public:
--- a/content/xbl/src/nsXBLService.cpp
+++ b/content/xbl/src/nsXBLService.cpp
@@ -84,17 +84,16 @@
 #include "nsIScriptSecurityManager.h"
 #include "nsIScriptError.h"
 
 #ifdef MOZ_XUL
 #include "nsXULPrototypeCache.h"
 #endif
 #include "nsIDOMEventListener.h"
 #include "mozilla/Preferences.h"
-#include "mozilla/dom/Element.h"
 
 using namespace mozilla;
 
 #define NS_MAX_XBL_BINDING_RECURSION 20
 
 static PRBool IsChromeOrResourceURI(nsIURI* aURI)
 {
   PRBool isChrome = PR_FALSE;
--- a/content/xbl/src/nsXBLWindowKeyHandler.cpp
+++ b/content/xbl/src/nsXBLWindowKeyHandler.cpp
@@ -64,17 +64,16 @@
 #include "nsPIWindowRoot.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDocShell.h"
 #include "nsIPresShell.h"
 #include "nsIPrivateDOMEvent.h"
 #include "nsISelectionController.h"
 #include "nsGUIEvent.h"
 #include "mozilla/Preferences.h"
-#include "mozilla/dom/Element.h"
 
 using namespace mozilla;
 
 static nsINativeKeyBindings *sNativeEditorBindings = nsnull;
 
 class nsXBLSpecialDocInfo
 {
 public:
--- a/content/xml/content/src/nsXMLCDATASection.cpp
+++ b/content/xml/content/src/nsXMLCDATASection.cpp
@@ -35,17 +35,16 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMCDATASection.h"
 #include "nsGenericDOMDataNode.h"
 #include "nsGkAtoms.h"
 #include "nsIDocument.h"
 #include "nsContentUtils.h"
-#include "nsDOMMemoryReporter.h"
 
 
 class nsXMLCDATASection : public nsGenericDOMDataNode,
                           public nsIDOMCDATASection
 {
 public:
   nsXMLCDATASection(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsXMLCDATASection();
@@ -57,20 +56,16 @@ public:
   NS_FORWARD_NSIDOMNODE(nsGenericDOMDataNode::)
 
   // nsIDOMCharacterData
   NS_FORWARD_NSIDOMCHARACTERDATA(nsGenericDOMDataNode::)
 
   // nsIDOMText
   NS_FORWARD_NSIDOMTEXT(nsGenericDOMDataNode::)
 
-  // DOM Memory Reporter participant.
-  NS_DECL_AND_IMPL_DOM_MEMORY_REPORTER_SIZEOF(nsXMLCDATASection,
-                                              nsGenericDOMDataNode)
-
   // nsIDOMCDATASection
   // Empty interface
 
   // nsINode
   virtual PRBool IsNodeOfType(PRUint32 aFlags) const;
 
   virtual nsGenericDOMDataNode* CloneDataNode(nsINodeInfo *aNodeInfo,
                                               PRBool aCloneText) const;
--- a/content/xml/content/src/nsXMLProcessingInstruction.h
+++ b/content/xml/content/src/nsXMLProcessingInstruction.h
@@ -57,20 +57,16 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericDOMDataNode::)
 
   // nsIDOMProcessingInstruction
   NS_DECL_NSIDOMPROCESSINGINSTRUCTION
 
-  // DOM Memory Reporter participant.
-  NS_DECL_AND_IMPL_DOM_MEMORY_REPORTER_SIZEOF(nsXMLProcessingInstruction,
-                                              nsGenericDOMDataNode)
-
   // nsINode
   virtual PRBool IsNodeOfType(PRUint32 aFlags) const;
 
   virtual nsGenericDOMDataNode* CloneDataNode(nsINodeInfo *aNodeInfo,
                                               PRBool aCloneText) const;
 
 #ifdef DEBUG
   virtual void List(FILE* out, PRInt32 aIndent) const;
--- a/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp
+++ b/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp
@@ -49,17 +49,16 @@
 #include "nsReadableUtils.h"
 #include "nsString.h"
 #include "nsTextFragment.h"
 #include "txXMLUtils.h"
 #include "txLog.h"
 #include "nsUnicharUtils.h"
 #include "nsAttrName.h"
 #include "nsTArray.h"
-#include "mozilla/dom/Element.h"
 
 const PRUint32 kUnknownIndex = PRUint32(-1);
 
 txXPathTreeWalker::txXPathTreeWalker(const txXPathTreeWalker& aOther)
     : mPosition(aOther.mPosition),
       mCurrentIndex(aOther.mCurrentIndex)
 {
 }
--- a/content/xul/content/src/nsXULPopupListener.cpp
+++ b/content/xul/content/src/nsXULPopupListener.cpp
@@ -66,17 +66,16 @@
 #include "nsServiceManagerUtils.h"
 #include "nsIPrincipal.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsLayoutUtils.h"
 #include "nsFrameManager.h"
 #include "nsHTMLReflowState.h"
 #include "nsIObjectLoadingContent.h"
 #include "mozilla/Preferences.h"
-#include "mozilla/dom/Element.h"
 
 // for event firing in context menus
 #include "nsPresContext.h"
 #include "nsIPresShell.h"
 #include "nsFocusManager.h"
 #include "nsPIDOMWindow.h"
 #include "nsIViewManager.h"
 #include "nsDOMError.h"
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -89,17 +89,16 @@
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMEventListener.h"
 #include "nsIDOMPopStateEvent.h"
 #include "nsIDOMHashChangeEvent.h"
 #include "nsContentUtils.h"
 #include "nsDOMWindowUtils.h"
 #include "nsIDOMGlobalPropertyInitializer.h"
 #include "mozilla/Preferences.h"
-#include "nsLocation.h"
 
 // Window scriptable helper includes
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShellTreeNode.h"
 #include "nsIScriptExternalNameSet.h"
 #include "nsJSUtils.h"
 #include "nsIInterfaceRequestor.h"
--- a/dom/base/nsDOMNavigationTiming.h
+++ b/dom/base/nsDOMNavigationTiming.h
@@ -41,19 +41,19 @@
 #define nsDOMNavigationTiming_h___
 
 #include "nsIDOMPerformanceTiming.h"
 #include "nsIDOMPerformanceNavigation.h"
 #include "nscore.h"
 #include "nsCOMPtr.h"
 #include "nsCOMArray.h"
 #include "TimeStamp.h"
-#include "nsIURI.h"
 
 class nsDOMNavigationTimingClock;
+class nsIURI;
 class nsIDocument;
 
 class nsDOMNavigationTiming
 {
 public:
   nsDOMNavigationTiming();
 
   NS_INLINE_DECL_REFCOUNTING(nsDOMNavigationTiming)
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -237,17 +237,16 @@
 
 #include "mozilla/dom/indexedDB/IDBFactory.h"
 #include "mozilla/dom/indexedDB/IndexedDatabaseManager.h"
 
 #include "nsRefreshDriver.h"
 #include "mozAutoDocUpdate.h"
 
 #include "mozilla/Telemetry.h"
-#include "nsLocation.h"
 
 #ifdef PR_LOGGING
 static PRLogModuleInfo* gDOMLeakPRLog;
 #endif
 
 static const char kStorageEnabled[] = "dom.storage.enabled";
 
 using namespace mozilla;
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -61,16 +61,17 @@
 #include "nsIBrowserDOMWindow.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDOMClientInformation.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIDOMNavigator.h"
 #include "nsIDOMNavigatorGeolocation.h"
 #include "nsIDOMNavigatorDesktopNotification.h"
+#include "nsIDOMLocation.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIDOMJSWindow.h"
 #include "nsIDOMChromeWindow.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIScriptContext.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "nsIScriptTimeoutHandler.h"
@@ -1084,14 +1085,55 @@ protected:
   nsIDocShell* mDocShell; // weak reference
 };
 
 nsresult NS_GetNavigatorUserAgent(nsAString& aUserAgent);
 nsresult NS_GetNavigatorPlatform(nsAString& aPlatform);
 nsresult NS_GetNavigatorAppVersion(nsAString& aAppVersion);
 nsresult NS_GetNavigatorAppName(nsAString& aAppName);
 
+class nsIURI;
+
+//*****************************************************************************
+// nsLocation: Script "location" object
+//*****************************************************************************
+
+class nsLocation : public nsIDOMLocation
+{
+public:
+  nsLocation(nsIDocShell *aDocShell);
+  virtual ~nsLocation();
+
+  NS_DECL_ISUPPORTS
+
+  void SetDocShell(nsIDocShell *aDocShell);
+  nsIDocShell *GetDocShell();
+
+  // nsIDOMLocation
+  NS_DECL_NSIDOMLOCATION
+
+protected:
+  // In the case of jar: uris, we sometimes want the place the jar was
+  // fetched from as the URI instead of the jar: uri itself.  Pass in
+  // PR_TRUE for aGetInnermostURI when that's the case.
+  nsresult GetURI(nsIURI** aURL, PRBool aGetInnermostURI = PR_FALSE);
+  nsresult GetWritableURI(nsIURI** aURL);
+  nsresult SetURI(nsIURI* aURL, PRBool aReplace = PR_FALSE);
+  nsresult SetHrefWithBase(const nsAString& aHref, nsIURI* aBase,
+                           PRBool aReplace);
+  nsresult SetHrefWithContext(JSContext* cx, const nsAString& aHref,
+                              PRBool aReplace);
+
+  nsresult GetSourceBaseURL(JSContext* cx, nsIURI** sourceURL);
+  nsresult GetSourceDocument(JSContext* cx, nsIDocument** aDocument);
+
+  nsresult CheckURL(nsIURI *url, nsIDocShellLoadInfo** aLoadInfo);
+
+  nsString mCachedHash;
+  nsWeakPtr mDocShell;
+};
+
 /* factory function */
 nsresult
 NS_NewScriptGlobalObject(PRBool aIsChrome, PRBool aIsModalContentWindow,
                          nsIScriptGlobalObject **aResult);
 
 #endif /* nsGlobalWindow_h___ */
--- a/dom/base/nsJSUtils.cpp
+++ b/dom/base/nsJSUtils.cpp
@@ -52,17 +52,16 @@
 #include "nsIScriptContext.h"
 #include "nsIScriptObjectOwner.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIServiceManager.h"
 #include "nsIXPConnect.h"
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
 #include "nsIScriptSecurityManager.h"
-#include "nsPIDOMWindow.h"
 
 #include "nsDOMJSUtils.h" // for GetScriptContextFromJSContext
 
 JSBool
 nsJSUtils::GetCallingLocation(JSContext* aContext, const char* *aFilename,
                               PRUint32* aLineno)
 {
   // Get the current filename and line number
--- a/dom/base/nsLocation.cpp
+++ b/dom/base/nsLocation.cpp
@@ -33,17 +33,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * 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 "nsLocation.h"
+#include "nsGlobalWindow.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIScriptContext.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellLoadInfo.h"
 #include "nsIWebNavigation.h"
 #include "nsCDefaultURIFixup.h"
 #include "nsIURIFixup.h"
 #include "nsIURL.h"
@@ -67,17 +67,16 @@
 #include "nsDOMError.h"
 #include "nsDOMClassInfo.h"
 #include "nsCRT.h"
 #include "nsIProtocolHandler.h"
 #include "nsReadableUtils.h"
 #include "nsITextToSubURI.h"
 #include "nsContentUtils.h"
 #include "nsJSUtils.h"
-#include "jsdbgapi.h"
 
 static nsresult
 GetContextFromStack(nsIJSContextStack *aStack, JSContext **aContext)
 {
   nsCOMPtr<nsIJSContextStackIterator>
     iterator(do_CreateInstance("@mozilla.org/js/xpc/ContextStackIterator;1"));
   NS_ENSURE_TRUE(iterator, NS_ERROR_FAILURE);
 
deleted file mode 100644
--- a/dom/base/nsLocation.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 sw=2 et tw=80: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Travis Bogard <travis@netscape.com>
- *   Dan Rosen <dr@netscape.com>
- *   Vidur Apparao <vidur@netscape.com>
- *   Johnny Stenback <jst@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * 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 ***** */
-
-#ifndef nsLocation_h__
-#define nsLocation_h__
-
-#include "nsIDOMLocation.h"
-#include "nsString.h"
-#include "nsWeakReference.h"
-
-
-class nsIURI;
-class nsIDocShell;
-class JSContext;
-class nsIDocument;
-class nsIDocShellLoadInfo;
-
-//*****************************************************************************
-// nsLocation: Script "location" object
-//*****************************************************************************
-
-class nsLocation : public nsIDOMLocation
-{
-public:
-  nsLocation(nsIDocShell *aDocShell);
-  virtual ~nsLocation();
-
-  NS_DECL_ISUPPORTS
-
-  void SetDocShell(nsIDocShell *aDocShell);
-  nsIDocShell *GetDocShell();
-
-  // nsIDOMLocation
-  NS_DECL_NSIDOMLOCATION
-
-protected:
-  // In the case of jar: uris, we sometimes want the place the jar was
-  // fetched from as the URI instead of the jar: uri itself.  Pass in
-  // PR_TRUE for aGetInnermostURI when that's the case.
-  nsresult GetURI(nsIURI** aURL, PRBool aGetInnermostURI = PR_FALSE);
-  nsresult GetWritableURI(nsIURI** aURL);
-  nsresult SetURI(nsIURI* aURL, PRBool aReplace = PR_FALSE);
-  nsresult SetHrefWithBase(const nsAString& aHref, nsIURI* aBase,
-                           PRBool aReplace);
-  nsresult SetHrefWithContext(JSContext* cx, const nsAString& aHref,
-                              PRBool aReplace);
-
-  nsresult GetSourceBaseURL(JSContext* cx, nsIURI** sourceURL);
-  nsresult GetSourceDocument(JSContext* cx, nsIDocument** aDocument);
-
-  nsresult CheckURL(nsIURI *url, nsIDocShellLoadInfo** aLoadInfo);
-
-  nsString mCachedHash;
-  nsWeakPtr mDocShell;
-};
-
-#endif // nsLocation_h__
-
--- a/dom/plugins/base/nsNPAPIPluginInstance.cpp
+++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp
@@ -54,17 +54,16 @@
 #include "nsIDocument.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIScriptContext.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsJSNPRuntime.h"
 #include "nsPluginStreamListenerPeer.h"
 #include "nsSize.h"
 #include "nsNetCID.h"
-#include "nsIContent.h"
 
 using namespace mozilla;
 using namespace mozilla::plugins::parent;
 
 static NS_DEFINE_IID(kIOutputStreamIID, NS_IOUTPUTSTREAM_IID);
 static NS_DEFINE_IID(kIPluginStreamListenerIID, NS_IPLUGINSTREAMLISTENER_IID);
 
 NS_IMPL_ISUPPORTS0(nsNPAPIPluginInstance)
--- a/dom/src/notification/nsDesktopNotification.h
+++ b/dom/src/notification/nsDesktopNotification.h
@@ -52,17 +52,16 @@
 #include "nsString.h"
 #include "nsWeakPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIDOMWindow.h"
 #include "nsThreadUtils.h"
 
 #include "nsDOMEventTargetHelper.h"
 #include "nsIPrivateDOMEvent.h"
-#include "nsIDocument.h"
 
 class AlertServiceObserver;
 
 /*
  * nsDesktopNotificationCenter
  * Object hangs off of the navigator object and hands out nsDOMDesktopNotification objects
  */
 class nsDesktopNotificationCenter : public nsIDOMDesktopNotificationCenter
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -94,17 +94,16 @@
 // Misc
 #include "TextEditorTest.h"
 #include "nsEditorUtils.h"
 #include "nsWSRunObject.h"
 #include "nsGkAtoms.h"
 
 #include "nsIFrame.h"
 #include "nsIParserService.h"
-#include "mozilla/dom/Element.h"
 
 // Some utilities to handle annoying overloading of "A" tag for link and named anchor
 static char hrefText[] = "href";
 static char anchorTxt[] = "anchor";
 static char namedanchorText[] = "namedanchor";
 
 nsIRangeUtils* nsHTMLEditor::sRangeHelper;
 
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -190,18 +190,16 @@ static const char sPrintOptionsContractI
 
 //paint forcing
 #include "prenv.h"
 #include <stdio.h>
 
 //switch to page layout
 #include "nsGfxCIID.h"
 
-#include "mozilla/dom/Element.h"
-
 using namespace mozilla;
 
 #ifdef NS_DEBUG
 
 #undef NOISY_VIEWER
 #else
 #undef NOISY_VIEWER
 #endif
--- a/layout/forms/nsButtonFrameRenderer.cpp
+++ b/layout/forms/nsButtonFrameRenderer.cpp
@@ -40,17 +40,16 @@
 #include "nsGkAtoms.h"
 #include "nsCSSPseudoElements.h"
 #include "nsINameSpaceManager.h"
 #include "nsStyleSet.h"
 #include "nsDisplayList.h"
 #include "nsITheme.h"
 #include "nsThemeConstants.h"
 #include "nsEventStates.h"
-#include "mozilla/dom/Element.h"
 
 #define ACTIVE   "active"
 #define HOVER    "hover"
 #define FOCUS    "focus"
 
 nsButtonFrameRenderer::nsButtonFrameRenderer()
 {
   MOZ_COUNT_CTOR(nsButtonFrameRenderer);
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -108,17 +108,16 @@ static NS_DEFINE_CID(kFrameTraversalCID,
 #include "nsCopySupport.h"
 #include "nsIClipboard.h"
 
 #ifdef IBMBIDI
 #include "nsIBidiKeyboard.h"
 #endif // IBMBIDI
 
 #include "nsDOMError.h"
-#include "mozilla/dom/Element.h"
 
 using namespace mozilla;
 
 //#define DEBUG_TABLE 1
 
 static NS_DEFINE_IID(kCContentIteratorCID, NS_CONTENTITERATOR_CID);
 static NS_DEFINE_IID(kCSubtreeIteratorCID, NS_SUBTREEITERATOR_CID);
 
--- a/layout/inspector/src/inDOMUtils.cpp
+++ b/layout/inspector/src/inDOMUtils.cpp
@@ -54,18 +54,16 @@
 #include "nsXBLBinding.h"
 #include "nsXBLPrototypeBinding.h"
 #include "nsIMutableArray.h"
 #include "nsBindingManager.h"
 #include "nsComputedDOMStyle.h"
 #include "nsEventStateManager.h"
 #include "nsIAtom.h"
 #include "nsIRange.h"
-#include "mozilla/dom/Element.h"
-
 
 ///////////////////////////////////////////////////////////////////////////////
 
 inDOMUtils::inDOMUtils()
 {
 }
 
 inDOMUtils::~inDOMUtils()
--- a/layout/style/nsHTMLStyleSheet.cpp
+++ b/layout/style/nsHTMLStyleSheet.cpp
@@ -523,53 +523,16 @@ nsHTMLStyleSheet::List(FILE* out, PRInt3
   mURL->GetSpec(urlSpec);
   if (!urlSpec.IsEmpty()) {
     fputs(urlSpec.get(), out);
   }
   fputs("\n", out);
 }
 #endif
 
-static
-PLDHashOperator
-GetHashEntryAttributesSize(PLDHashTable* aTable, PLDHashEntryHdr* aEntry,
-                           PRUint32 number, void* aArg)
-{
-  NS_PRECONDITION(aEntry, "The entry should not be null!");
-  NS_PRECONDITION(aArg, "The passed argument should not be null!");
-
-  MappedAttrTableEntry* entry = static_cast<MappedAttrTableEntry*>(aEntry);
-  PRInt64 size = *static_cast<PRInt64*>(aArg);
-
-  NS_ASSERTION(entry->mAttributes, "entry->mAttributes should not be null!");
-  size += entry->mAttributes->SizeOf();
-
-  return PL_DHASH_NEXT;
-}
-
-PRInt64
-nsHTMLStyleSheet::SizeOf() const
-{
-  PRInt64 size = sizeof(*this);
-
-  size += mLinkRule ? sizeof(*mLinkRule.get()) : 0;
-  size += mVisitedRule ? sizeof(*mVisitedRule.get()) : 0;
-  size += mActiveRule ? sizeof(*mActiveRule.get()) : 0;
-  size += mTableQuirkColorRule ? sizeof(*mTableQuirkColorRule.get()) : 0;
-  size += mTableTHRule ? sizeof(*mTableTHRule.get()) : 0;
-
-  if (mMappedAttrTable.ops) {
-    size += PL_DHASH_TABLE_SIZE(&mMappedAttrTable) * sizeof(MappedAttrTableEntry);
-    PL_DHashTableEnumerate(const_cast<PLDHashTable*>(&mMappedAttrTable),
-                           GetHashEntryAttributesSize, &size);
-  }
-
-  return size;
-}
-
 // XXX For convenience and backwards compatibility
 nsresult
 NS_NewHTMLStyleSheet(nsHTMLStyleSheet** aInstancePtrResult, nsIURI* aURL, 
                      nsIDocument* aDocument)
 {
   nsresult rv;
   nsHTMLStyleSheet* sheet;
   if (NS_FAILED(rv = NS_NewHTMLStyleSheet(&sheet)))
@@ -599,9 +562,8 @@ NS_NewHTMLStyleSheet(nsHTMLStyleSheet** 
   NS_ADDREF(it);
   nsresult rv = it->Init();
   if (NS_FAILED(rv))
     NS_RELEASE(it);
 
   *aInstancePtrResult = it; // NS_ADDREF above, or set to null by NS_RELEASE
   return rv;
 }
-
--- a/layout/style/nsHTMLStyleSheet.h
+++ b/layout/style/nsHTMLStyleSheet.h
@@ -96,17 +96,16 @@ public:
   nsresult SetActiveLinkColor(nscolor aColor);
   nsresult SetVisitedLinkColor(nscolor aColor);
 
   // Mapped Attribute management methods
   already_AddRefed<nsMappedAttributes>
     UniqueMappedAttributes(nsMappedAttributes* aMapped);
   void DropMappedAttributes(nsMappedAttributes* aMapped);
 
-  PRInt64 SizeOf() const;
 
 private: 
   // These are not supported and are not implemented! 
   nsHTMLStyleSheet(const nsHTMLStyleSheet& aCopy); 
   nsHTMLStyleSheet& operator=(const nsHTMLStyleSheet& aCopy); 
 
   ~nsHTMLStyleSheet();
 
--- a/layout/xul/base/src/nsButtonBoxFrame.cpp
+++ b/layout/xul/base/src/nsButtonBoxFrame.cpp
@@ -47,18 +47,16 @@
 #include "nsINameSpaceManager.h"
 #include "nsPresContext.h"
 #include "nsIPresShell.h"
 #include "nsGUIEvent.h"
 #include "nsEventStateManager.h"
 #include "nsIDOMElement.h"
 #include "nsDisplayList.h"
 #include "nsContentUtils.h"
-#include "mozilla/dom/Element.h"
-
 
 //
 // NS_NewXULButtonFrame
 //
 // Creates a new Button frame and returns it
 //
 nsIFrame*
 NS_NewButtonBoxFrame (nsIPresShell* aPresShell, nsStyleContext* aContext)
--- a/layout/xul/base/src/nsResizerFrame.cpp
+++ b/layout/xul/base/src/nsResizerFrame.cpp
@@ -55,18 +55,16 @@
 #include "nsIDocShellTreeOwner.h"
 #include "nsIBaseWindow.h"
 #include "nsPIDOMWindow.h"
 #include "nsGUIEvent.h"
 #include "nsEventDispatcher.h"
 #include "nsContentUtils.h"
 #include "nsMenuPopupFrame.h"
 #include "nsIScreenManager.h"
-#include "mozilla/dom/Element.h"
-
 
 //
 // NS_NewResizerFrame
 //
 // Creates a new Resizer frame and returns it
 //
 nsIFrame*
 NS_NewResizerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
--- a/layout/xul/base/src/nsXULTooltipListener.cpp
+++ b/layout/xul/base/src/nsXULTooltipListener.cpp
@@ -56,18 +56,16 @@
 #include "nsIScriptContext.h"
 #include "nsPIDOMWindow.h"
 #ifdef MOZ_XUL
 #include "nsXULPopupManager.h"
 #endif
 #include "nsIRootBox.h"
 #include "nsEventDispatcher.h"
 #include "mozilla/Preferences.h"
-#include "mozilla/dom/Element.h"
-
 
 using namespace mozilla;
 
 nsXULTooltipListener* nsXULTooltipListener::mInstance = nsnull;
 
 //////////////////////////////////////////////////////////////////////////
 //// nsISupports
 
--- a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
+++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
@@ -83,17 +83,16 @@
 #include "nsContentCID.h"
 #include "nsLayoutCID.h"
 #include "nsWidgetsCID.h"
 #include "nsIFormControl.h"
 #include "nsINameSpaceManager.h"
 #include "nsIWindowWatcher.h"
 #include "nsIObserverService.h"
 #include "nsFocusManager.h"
-#include "mozilla/dom/Element.h"
 
 #include "nsTypeAheadFind.h"
 
 NS_INTERFACE_MAP_BEGIN(nsTypeAheadFind)
   NS_INTERFACE_MAP_ENTRY(nsITypeAheadFind)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsITypeAheadFind)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
   NS_INTERFACE_MAP_ENTRY(nsIObserver)
--- a/widget/src/xpwidgets/nsNativeTheme.cpp
+++ b/widget/src/xpwidgets/nsNativeTheme.cpp
@@ -49,17 +49,16 @@
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMXULMenuListElement.h"
 #include "nsILookAndFeel.h"
 #include "nsThemeConstants.h"
 #include "nsIComponentManager.h"
 #include "nsPIDOMWindow.h"
 #include "nsProgressFrame.h"
 #include "nsMenuFrame.h"
-#include "mozilla/dom/Element.h"
 
 nsNativeTheme::nsNativeTheme()
 : mAnimatedContentTimeout(PR_UINT32_MAX)
 {
 }
 
 NS_IMPL_ISUPPORTS1(nsNativeTheme, nsITimerCallback)