Bug 1295852 - Part 1: Add nsINode methods for testing whether a node is a ::before/::after generated content container. r=bholley
authorCameron McCormack <cam@mcc.id.au>
Fri, 19 Aug 2016 11:16:45 +0800
changeset 309999 14d293a0db977a757ca5bb7166527ee7f5f2843f
parent 309998 dab9f89ca163b8b948a096428405ba25530a31cd
child 310000 acee0d460e3997b6f71e11fd513f73c3bba4f887
push id30575
push userryanvm@gmail.com
push dateFri, 19 Aug 2016 13:46:06 +0000
treeherdermozilla-central@3da4d64410c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1295852
milestone51.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 1295852 - Part 1: Add nsINode methods for testing whether a node is a ::before/::after generated content container. r=bholley MozReview-Commit-ID: 662ltv2rv0V
dom/base/nsIContent.h
--- a/dom/base/nsIContent.h
+++ b/dom/base/nsIContent.h
@@ -322,16 +322,28 @@ public:
     return IsMathMLElement() && IsNodeInternal(aFirst, aArgs...);
   }
   inline bool IsActiveChildrenElement() const
   {
     return mNodeInfo->Equals(nsGkAtoms::children, kNameSpaceID_XBL) &&
            GetBindingParent();
   }
 
+  bool IsGeneratedContentContainerForBefore() const
+  {
+    return IsRootOfNativeAnonymousSubtree() &&
+           mNodeInfo->NameAtom() == nsGkAtoms::mozgeneratedcontentbefore;
+  }
+
+  bool IsGeneratedContentContainerForAfter() const
+  {
+    return IsRootOfNativeAnonymousSubtree() &&
+           mNodeInfo->NameAtom() == nsGkAtoms::mozgeneratedcontentafter;
+  }
+
   /**
    * Set attribute values. All attribute values are assumed to have a
    * canonical string representation that can be used for these
    * methods. The SetAttr method is assumed to perform a translation
    * of the canonical form into the underlying content specific
    * form.
    *
    * @param aNameSpaceID the namespace of the attribute