WebKit Bugzilla
Attachment 349105 Details for
Bug 189392
: ShadowRoot should have its own node flag
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Cleanup
bug-189392-20180906195134.patch (text/plain), 7.17 KB, created by
Ryosuke Niwa
on 2018-09-06 19:51:35 PDT
(
hide
)
Description:
Cleanup
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2018-09-06 19:51:35 PDT
Size:
7.17 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 235774) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,29 @@ >+2018-09-06 Ryosuke Niwa <rniwa@webkit.org> >+ >+ ShadowRoot should have its own node flag >+ https://bugs.webkit.org/show_bug.cgi?id=189392 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added IsShadowRootFlag and IsDocumentNodeFlag, and removed IsDocumentFragmentFlag and IsStyledElementFlag. >+ Also re-ordered flags to group flags used by subclasses below ones directly used by Node in >+ accordinate with the comment. >+ >+ No new tests since there should be no behavioral change. >+ >+ * dom/ContainerNode.h: >+ (WebCore::Node::isTreeScope const): Deleted. >+ * dom/Node.h: >+ (WebCore::Node::isStyledElement const): Check if this is a HTML, SVG, or MathML element instead. >+ (WebCore::Node::isDocumentNode const): Simply check IsDocumentNodeFlag. >+ (WebCore::Node::isTreeScope const): Check if this is a document or a shadow root Instead of comparing >+ the tree scope to this. >+ (WebCore::Node::isDocumentFragment const): Check if this is a container node which is neither document, >+ element, nor shadow root. >+ (WebCore::Node::isShadowRoot const): Simply check IsShadowRootFlag. This is the change needed to fix >+ the blockign bug 166748. >+ (WebCore::Node::flagIsShadowRoot): Added. Will be used in the bug 166748. >+ > 2018-09-06 Simon Fraser <simon.fraser@apple.com> > > Fix the build for non-Cocoa platforms after r235772. >Index: Source/WebCore/dom/ContainerNode.h >=================================================================== >--- Source/WebCore/dom/ContainerNode.h (revision 235764) >+++ Source/WebCore/dom/ContainerNode.h (working copy) >@@ -192,11 +192,6 @@ inline Node* Node::lastChild() const > return downcast<ContainerNode>(*this).lastChild(); > } > >-inline bool Node::isTreeScope() const >-{ >- return &treeScope().rootNode() == this; >-} >- > inline Node& Node::rootNode() const > { > if (isInTreeScope()) >Index: Source/WebCore/dom/Node.h >=================================================================== >--- Source/WebCore/dom/Node.h (revision 235764) >+++ Source/WebCore/dom/Node.h (working copy) >@@ -212,7 +212,7 @@ public: > #if ENABLE(VIDEO_TRACK) > virtual bool isWebVTTElement() const { return false; } > #endif >- bool isStyledElement() const { return getFlag(IsStyledElementFlag); } >+ bool isStyledElement() const { return getFlag(IsHTMLFlag) || getFlag(IsSVGFlag) || getFlag(IsMathMLFlag); } > virtual bool isAttributeNode() const { return false; } > virtual bool isCharacterDataNode() const { return false; } > virtual bool isFrameOwnerElement() const { return false; } >@@ -222,10 +222,10 @@ public: > virtual bool isImageControlsButtonElement() const { return false; } > #endif > >- bool isDocumentNode() const { return getFlag(IsContainerFlag) && !getFlag(IsElementFlag) && !getFlag(IsDocumentFragmentFlag); } >- bool isTreeScope() const; >- bool isDocumentFragment() const { return getFlag(IsDocumentFragmentFlag); } >- bool isShadowRoot() const { return isDocumentFragment() && isTreeScope(); } >+ bool isDocumentNode() const { return getFlag(IsDocumentNodeFlag); } >+ bool isTreeScope() const { return getFlag(IsDocumentNodeFlag) || getFlag(IsShadowRootFlag); } >+ bool isDocumentFragment() const { return getFlag(IsContainerFlag) && !(getFlag(IsElementFlag) || getFlag(IsShadowRootFlag) || getFlag(IsDocumentNodeFlag)); } >+ bool isShadowRoot() const { return getFlag(IsShadowRootFlag); } > > bool hasCustomStyleResolveCallbacks() const { return getFlag(HasCustomStyleResolveCallbacksFlag); } > >@@ -538,6 +538,7 @@ public: > static int32_t flagIsText() { return IsTextFlag; } > static int32_t flagIsContainer() { return IsContainerFlag; } > static int32_t flagIsElement() { return IsElementFlag; } >+ static int32_t flagIsShadowRoot() { return IsShadowRootFlag; } > static int32_t flagIsHTML() { return IsHTMLFlag; } > static int32_t flagIsLink() { return IsLinkFlag; } > static int32_t flagHasFocusWithin() { return HasFocusWithin; } >@@ -555,19 +556,20 @@ protected: > IsTextFlag = 1, > IsContainerFlag = 1 << 1, > IsElementFlag = 1 << 2, >- IsStyledElementFlag = 1 << 3, >- IsHTMLFlag = 1 << 4, >- IsSVGFlag = 1 << 5, >- DescendantsAffectedByPreviousSiblingFlag = 1 << 6, >- ChildNeedsStyleRecalcFlag = 1 << 7, >- IsConnectedFlag = 1 << 8, >- IsLinkFlag = 1 << 9, >- IsUserActionElement = 1 << 10, >- HasRareDataFlag = 1 << 11, >- IsDocumentFragmentFlag = 1 << 12, >+ IsHTMLFlag = 1 << 3, >+ IsSVGFlag = 1 << 4, >+ IsMathMLFlag = 1 << 5, >+ IsConnectedFlag = 1 << 6, >+ IsInShadowTreeFlag = 1 << 7, >+ IsDocumentNodeFlag = 1 << 8, >+ IsShadowRootFlag = 1 << 9, >+ HasRareDataFlag = 1 << 10, >+ HasEventTargetDataFlag = 1 << 11, > > // These bits are used by derived classes, pulled up here so they can > // be stored in the same memory word as the Node bits above. >+ ChildNeedsStyleRecalcFlag = 1 << 12, // ContainerNode >+ > IsParsingChildrenFinishedFlag = 1 << 13, // Element > StyleValidityShift = 14, > StyleValidityMask = 3 << StyleValidityShift, >@@ -576,10 +578,10 @@ protected: > HasFocusWithin = 1 << 18, > HasSyntheticAttrChildNodesFlag = 1 << 19, > HasCustomStyleResolveCallbacksFlag = 1 << 20, >- HasEventTargetDataFlag = 1 << 21, >+ DescendantsAffectedByPreviousSiblingFlag = 1 << 21, > IsCustomElement = 1 << 22, >- IsInShadowTreeFlag = 1 << 23, >- IsMathMLFlag = 1 << 24, >+ IsLinkFlag = 1 << 23, >+ IsUserActionElement = 1 << 24, > > ChildrenAffectedByFirstChildRulesFlag = 1 << 25, > ChildrenAffectedByLastChildRulesFlag = 1 << 26, >@@ -609,14 +611,13 @@ protected: > CreateContainer = DefaultNodeFlags | IsContainerFlag, > CreateElement = CreateContainer | IsElementFlag, > CreatePseudoElement = CreateElement | IsConnectedFlag, >- CreateShadowRoot = CreateContainer | IsDocumentFragmentFlag | IsInShadowTreeFlag, >- CreateDocumentFragment = CreateContainer | IsDocumentFragmentFlag, >- CreateStyledElement = CreateElement | IsStyledElementFlag, >- CreateHTMLElement = CreateStyledElement | IsHTMLFlag, >- CreateSVGElement = CreateStyledElement | IsSVGFlag | HasCustomStyleResolveCallbacksFlag, >- CreateDocument = CreateContainer | IsConnectedFlag, >+ CreateShadowRoot = CreateContainer | IsShadowRootFlag | IsInShadowTreeFlag, >+ CreateDocumentFragment = CreateContainer, >+ CreateHTMLElement = CreateElement | IsHTMLFlag, >+ CreateSVGElement = CreateElement | IsSVGFlag | HasCustomStyleResolveCallbacksFlag, >+ CreateMathMLElement = CreateElement | IsMathMLFlag, >+ CreateDocument = CreateContainer | IsDocumentNodeFlag | IsConnectedFlag, > CreateEditingText = CreateText | IsEditingTextOrUndefinedCustomElementFlag, >- CreateMathMLElement = CreateStyledElement | IsMathMLFlag > }; > Node(Document&, ConstructionType); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189392
:
349105
|
349107