Bug 811449 part 2. Combine the forward-declares and includes in Element.h. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 14 Nov 2012 14:10:07 -0800
changeset 113295 ff05c0955ca82b31afde110a34883e8cd3ff67d3
parent 113294 b86df83428cc71255b0091132e6734c215677608
child 113296 ea21cee0a1510f906bc9a3c997e6d85bb0e45a8a
push id23864
push userryanvm@gmail.com
push dateThu, 15 Nov 2012 02:43:16 +0000
treeherdermozilla-central@7845cfa93e3f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs811449
milestone19.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
Bug 811449 part 2. Combine the forward-declares and includes in Element.h. r=peterv This is just moving includes and forward-declares and some inline implementations around. No substantive changes.
content/base/public/Element.h
--- a/content/base/public/Element.h
+++ b/content/base/public/Element.h
@@ -12,23 +12,74 @@
 
 #ifndef mozilla_dom_Element_h__
 #define mozilla_dom_Element_h__
 
 #include "mozilla/dom/FragmentOrElement.h" // for base class
 #include "nsChangeHint.h"                  // for enum
 #include "nsEventStates.h"                 // for member
 #include "mozilla/dom/DirectionalityUtils.h"
+#include "nsCOMPtr.h"
+#include "nsAutoPtr.h"
+#include "nsIDOMElement.h"
+#include "nsIDOMDocumentFragment.h"
+#include "nsILinkHandler.h"
+#include "nsNodeUtils.h"
+#include "nsAttrAndChildArray.h"
+#include "mozFlushType.h"
+#include "nsDOMAttributeMap.h"
+#include "nsIWeakReference.h"
+#include "nsCycleCollectionParticipant.h"
+#include "nsIDocument.h"
+#include "nsIDOMNodeSelector.h"
+#include "nsIDOMXPathNSResolver.h"
+#include "nsPresContext.h"
+#include "nsDOMClassInfoID.h" // DOMCI_DATA
+#include "nsIDOMTouchEvent.h"
+#include "nsIInlineEventHandlers.h"
+#include "mozilla/CORSMode.h"
+#include "mozilla/Attributes.h"
+#include "nsContentUtils.h"
+#include "nsINodeList.h"
+#include "mozilla/ErrorResult.h"
+#include "nsIScrollableFrame.h"
+#include "nsIDOMAttr.h"
+#include "nsISMILAttr.h"
+#include "nsClientRect.h"
+#include "nsIDOMDOMTokenList.h"
 
+class nsIDOMEventListener;
+class nsIFrame;
+class nsIDOMNamedNodeMap;
+class nsIDOMCSSStyleDeclaration;
+class nsIURI;
+class nsINodeInfo;
+class nsIControllers;
+class nsEventChainVisitor;
+class nsEventListenerManager;
+class nsIScrollableFrame;
+class nsAttrValueOrString;
+class ContentUnbinder;
+class nsClientRect;
+class nsClientRectList;
+class nsIHTMLCollection;
+class nsContentList;
+class nsDOMTokenList;
+struct nsRect;
 class nsEventStateManager;
 class nsFocusManager;
 class nsGlobalWindow;
 class nsICSSDeclaration;
 class nsISMILAttr;
 
+already_AddRefed<nsContentList>
+NS_GetContentList(nsINode* aRootNode,
+                  int32_t  aMatchNameSpaceId,
+                  const nsAString& aTagname);
+
 #define ELEMENT_FLAG_BIT(n_) NODE_FLAG_BIT(NODE_TYPE_SPECIFIC_BITS_OFFSET + (n_))
 
 // Element-specific flags
 enum {
   // Set if the element has a pending style change.
   ELEMENT_HAS_PENDING_RESTYLE =                 ELEMENT_FLAG_BIT(0),
 
   // Set if the element is a potential restyle root (that is, has a style
@@ -339,89 +390,16 @@ private:
   nsEventStates mState;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(Element, NS_ELEMENT_IID)
 
 } // namespace dom
 } // namespace mozilla
 
-inline mozilla::dom::Element* nsINode::AsElement()
-{
-  MOZ_ASSERT(IsElement());
-  return static_cast<mozilla::dom::Element*>(this);
-}
-
-inline const mozilla::dom::Element* nsINode::AsElement() const
-{
-  MOZ_ASSERT(IsElement());
-  return static_cast<const mozilla::dom::Element*>(this);
-}
-
-inline bool nsINode::HasAttributes() const
-{
-  return IsElement() && AsElement()->GetAttrCount() > 0;
-}
-
-#include "nsCOMPtr.h"
-#include "nsAutoPtr.h"
-#include "mozilla/dom/FragmentOrElement.h"
-#include "mozilla/dom/Element.h"
-#include "nsIDOMElement.h"
-#include "nsIDOMDocumentFragment.h"
-#include "nsILinkHandler.h"
-#include "nsNodeUtils.h"
-#include "nsAttrAndChildArray.h"
-#include "mozFlushType.h"
-#include "nsDOMAttributeMap.h"
-#include "nsIWeakReference.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsIDocument.h"
-#include "nsIDOMNodeSelector.h"
-#include "nsIDOMXPathNSResolver.h"
-#include "nsPresContext.h"
-#include "nsDOMClassInfoID.h" // DOMCI_DATA
-#include "nsIDOMTouchEvent.h"
-#include "nsIInlineEventHandlers.h"
-#include "mozilla/CORSMode.h"
-#include "mozilla/Attributes.h"
-#include "nsContentUtils.h"
-#include "nsINodeList.h"
-#include "mozilla/ErrorResult.h"
-#include "nsIScrollableFrame.h"
-#include "nsIDOMAttr.h"
-#include "nsISMILAttr.h"
-#include "nsClientRect.h"
-#include "nsIDOMDOMTokenList.h"
-
-class nsIDOMEventListener;
-class nsIFrame;
-class nsIDOMNamedNodeMap;
-class nsICSSDeclaration;
-class nsIDOMCSSStyleDeclaration;
-class nsIURI;
-class nsINodeInfo;
-class nsIControllers;
-class nsEventChainVisitor;
-class nsEventListenerManager;
-class nsIScrollableFrame;
-class nsAttrValueOrString;
-class ContentUnbinder;
-class nsClientRect;
-class nsClientRectList;
-class nsIHTMLCollection;
-class nsContentList;
-class nsDOMTokenList;
-struct nsRect;
-
-already_AddRefed<nsContentList>
-NS_GetContentList(nsINode* aRootNode,
-                  int32_t  aMatchNameSpaceId,
-                  const nsAString& aTagname);
-
 /**
  * A generic base class for DOM elements, implementing many nsIContent,
  * nsIDOMNode and nsIDOMElement methods.
  */
 class nsGenericElement : public mozilla::dom::Element
 {
 public:
   nsGenericElement(already_AddRefed<nsINodeInfo> aNodeInfo);
@@ -1116,16 +1094,33 @@ private:
    * Get this element's client area rect in app units.
    * @return the frame's client area
    */
   nsRect GetClientAreaRect();
 
   nsIScrollableFrame* GetScrollFrame(nsIFrame **aStyledFrame = nullptr);
 };
 
+inline mozilla::dom::Element* nsINode::AsElement()
+{
+  MOZ_ASSERT(IsElement());
+  return static_cast<mozilla::dom::Element*>(this);
+}
+
+inline const mozilla::dom::Element* nsINode::AsElement() const
+{
+  MOZ_ASSERT(IsElement());
+  return static_cast<const mozilla::dom::Element*>(this);
+}
+
+inline bool nsINode::HasAttributes() const
+{
+  return IsElement() && AsElement()->GetAttrCount() > 0;
+}
+
 /**
  * Macros to implement Clone(). _elementName is the class for which to implement
  * Clone.
  */
 #define NS_IMPL_ELEMENT_CLONE(_elementName)                                 \
 nsresult                                                                    \
 _elementName::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const        \
 {                                                                           \