Title: [217875] trunk/Source/WebCore
Revision
217875
Author
[email protected]
Date
2017-06-06 23:49:51 -0700 (Tue, 06 Jun 2017)

Log Message

Use a dedicated node flag to identify a Document node
https://bugs.webkit.org/show_bug.cgi?id=173037

Reviewed by Chris Dumez.

Use a Node flag to identify a Document node instead of checking this == document() which loads TreeScope.

* dom/Document.h:
(WebCore::Node::isDocumentNode): Deleted.
* dom/Node.h:
(WebCore::Node::isDocumentNode):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (217874 => 217875)


--- trunk/Source/WebCore/ChangeLog	2017-06-07 04:19:52 UTC (rev 217874)
+++ trunk/Source/WebCore/ChangeLog	2017-06-07 06:49:51 UTC (rev 217875)
@@ -1,3 +1,17 @@
+2017-06-06  Ryosuke Niwa  <[email protected]>
+
+        Use a dedicated node flag to identify a Document node
+        https://bugs.webkit.org/show_bug.cgi?id=173037
+
+        Reviewed by Chris Dumez.
+
+        Use a Node flag to identify a Document node instead of checking this == document() which loads TreeScope.
+
+        * dom/Document.h:
+        (WebCore::Node::isDocumentNode): Deleted.
+        * dom/Node.h:
+        (WebCore::Node::isDocumentNode):
+
 2017-06-06  Dan Bernstein  <[email protected]>
 
         Fixed building with the macOS 10.13 Apple Internal SDK when targeting macOS 10.12.

Modified: trunk/Source/WebCore/dom/Document.h (217874 => 217875)


--- trunk/Source/WebCore/dom/Document.h	2017-06-07 04:19:52 UTC (rev 217874)
+++ trunk/Source/WebCore/dom/Document.h	2017-06-07 06:49:51 UTC (rev 217875)
@@ -1812,11 +1812,6 @@
 
 // These functions are here because they require the Document class definition and we want to inline them.
 
-inline bool Node::isDocumentNode() const
-{
-    return this == &document();
-}
-
 inline ScriptExecutionContext* Node::scriptExecutionContext() const
 {
     return &document().contextDocument();

Modified: trunk/Source/WebCore/dom/Node.h (217874 => 217875)


--- trunk/Source/WebCore/dom/Node.h	2017-06-07 04:19:52 UTC (rev 217874)
+++ trunk/Source/WebCore/dom/Node.h	2017-06-07 06:49:51 UTC (rev 217875)
@@ -223,7 +223,7 @@
     virtual bool isImageControlsButtonElement() const { return false; }
 #endif
 
-    bool isDocumentNode() const;
+    bool isDocumentNode() const { return getFlag(IsDocumentNodeFlag); }
     bool isTreeScope() const;
     bool isDocumentFragment() const { return getFlag(IsDocumentFragmentFlag); }
     bool isShadowRoot() const { return isDocumentFragment() && isTreeScope(); }
@@ -574,6 +574,7 @@
         IsStyledElementFlag = 1 << 3,
         IsHTMLFlag = 1 << 4,
         IsSVGFlag = 1 << 5,
+        IsDocumentNodeFlag = 1 << 6,
         ChildNeedsStyleRecalcFlag = 1 << 7,
         IsConnectedFlag = 1 << 8,
         IsLinkFlag = 1 << 9,
@@ -625,7 +626,7 @@
         CreateStyledElement = CreateElement | IsStyledElementFlag, 
         CreateHTMLElement = CreateStyledElement | IsHTMLFlag,
         CreateSVGElement = CreateStyledElement | IsSVGFlag | HasCustomStyleResolveCallbacksFlag,
-        CreateDocument = CreateContainer | IsConnectedFlag,
+        CreateDocument = CreateContainer | IsDocumentNodeFlag | IsConnectedFlag,
         CreateEditingText = CreateText | IsEditingTextOrUndefinedCustomElementFlag,
         CreateMathMLElement = CreateStyledElement | IsMathMLFlag
     };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to