Title: [96782] trunk/Source/WebCore
- Revision
- 96782
- Author
- [email protected]
- Date
- 2011-10-05 19:27:33 -0700 (Wed, 05 Oct 2011)
Log Message
IsShadowRootFlag should not depend on whether a ShadowRoot is attached to a host.
https://bugs.webkit.org/show_bug.cgi?id=69406
Reviewed by Hajime Morita.
No change in behavior => No new tests.
* dom/Node.cpp:
(WebCore::Node::setShadowHost): Don't twiddle the flag.
* dom/Node.h:
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::ShadowRoot): Set the IsShadowRootFlag on creation.
* dom/TreeScope.cpp:
(WebCore::TreeScope::TreeScope): Let ShadowRoot set creation flags.
* dom/TreeScope.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (96781 => 96782)
--- trunk/Source/WebCore/ChangeLog 2011-10-06 02:15:38 UTC (rev 96781)
+++ trunk/Source/WebCore/ChangeLog 2011-10-06 02:27:33 UTC (rev 96782)
@@ -1,3 +1,21 @@
+2011-10-05 Dominic Cooney <[email protected]>
+
+ IsShadowRootFlag should not depend on whether a ShadowRoot is attached to a host.
+ https://bugs.webkit.org/show_bug.cgi?id=69406
+
+ Reviewed by Hajime Morita.
+
+ No change in behavior => No new tests.
+
+ * dom/Node.cpp:
+ (WebCore::Node::setShadowHost): Don't twiddle the flag.
+ * dom/Node.h:
+ * dom/ShadowRoot.cpp:
+ (WebCore::ShadowRoot::ShadowRoot): Set the IsShadowRootFlag on creation.
+ * dom/TreeScope.cpp:
+ (WebCore::TreeScope::TreeScope): Let ShadowRoot set creation flags.
+ * dom/TreeScope.h:
+
2011-10-05 Chris Rogers <[email protected]>
Define a log2f() function for Windows in wtf/MathExtras.h
Modified: trunk/Source/WebCore/dom/Node.cpp (96781 => 96782)
--- trunk/Source/WebCore/dom/Node.cpp 2011-10-06 02:15:38 UTC (rev 96781)
+++ trunk/Source/WebCore/dom/Node.cpp 2011-10-06 02:27:33 UTC (rev 96782)
@@ -568,12 +568,7 @@
void Node::setShadowHost(Element* host)
{
- ASSERT(!parentNode() && !isSVGShadowRoot());
- if (host)
- setFlag(IsShadowRootFlag);
- else
- clearFlag(IsShadowRootFlag);
-
+ ASSERT(!parentNode() && isShadowRoot());
setParent(host);
}
Modified: trunk/Source/WebCore/dom/Node.h (96781 => 96782)
--- trunk/Source/WebCore/dom/Node.h 2011-10-06 02:15:38 UTC (rev 96781)
+++ trunk/Source/WebCore/dom/Node.h 2011-10-06 02:27:33 UTC (rev 96782)
@@ -640,9 +640,10 @@
CreateComment = DefaultNodeFlags | IsCommentFlag,
CreateContainer = DefaultNodeFlags | IsContainerFlag,
CreateElement = CreateContainer | IsElementFlag,
+ CreateShadowRoot = CreateContainer | IsShadowRootFlag,
CreateStyledElement = CreateElement | IsStyledElementFlag,
CreateHTMLElement = CreateStyledElement | IsHTMLFlag,
- CreateSVGElement = CreateStyledElement | IsSVGFlag,
+ CreateSVGElement = CreateStyledElement | IsSVGFlag,
};
Node(Document*, ConstructionType);
Modified: trunk/Source/WebCore/dom/ShadowRoot.cpp (96781 => 96782)
--- trunk/Source/WebCore/dom/ShadowRoot.cpp 2011-10-06 02:15:38 UTC (rev 96781)
+++ trunk/Source/WebCore/dom/ShadowRoot.cpp 2011-10-06 02:27:33 UTC (rev 96782)
@@ -37,7 +37,7 @@
namespace WebCore {
ShadowRoot::ShadowRoot(Document* document)
- : TreeScope(document)
+ : TreeScope(document, CreateShadowRoot)
, m_applyAuthorSheets(false)
{
ASSERT(document);
Modified: trunk/Source/WebCore/dom/TreeScope.cpp (96781 => 96782)
--- trunk/Source/WebCore/dom/TreeScope.cpp 2011-10-06 02:15:38 UTC (rev 96781)
+++ trunk/Source/WebCore/dom/TreeScope.cpp 2011-10-06 02:27:33 UTC (rev 96782)
@@ -36,8 +36,8 @@
using namespace HTMLNames;
-TreeScope::TreeScope(Document* document)
- : ContainerNode(document)
+TreeScope::TreeScope(Document* document, ConstructionType constructionType)
+ : ContainerNode(document, constructionType)
, m_parentTreeScope(0)
, m_numNodeListCaches(0)
{
Modified: trunk/Source/WebCore/dom/TreeScope.h (96781 => 96782)
--- trunk/Source/WebCore/dom/TreeScope.h 2011-10-06 02:15:38 UTC (rev 96781)
+++ trunk/Source/WebCore/dom/TreeScope.h 2011-10-06 02:27:33 UTC (rev 96782)
@@ -65,7 +65,7 @@
virtual bool applyAuthorSheets() const;
protected:
- TreeScope(Document*);
+ TreeScope(Document*, ConstructionType = CreateContainer);
virtual ~TreeScope();
void destroyTreeScopeData();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes