Reviewers: Timothy Loh, ojan,
Description:
Don't mark Text with ChildNeedsStyleRecalc.
Text can't have children, marking them with this bit just means leaving
dirty bits in the tree. Only ContainerNode needs this bit set.
BUG=492730
Please review this at
https://codereview.chromium.org/1149893021/
Base URL: svn://
svn.chromium.org/blink/trunk
Affected files (+3, -4 lines):
M Source/core/dom/ContainerNode.cpp
M Source/core/dom/Node.h
M Source/core/dom/Node.cpp
Index: Source/core/dom/ContainerNode.cpp
diff --git a/Source/core/dom/ContainerNode.cpp
b/Source/core/dom/ContainerNode.cpp
index
cfbe083d297fa80cef24edb9d062aa92c1ab508d..ec3ba338725a265d9b278c5938748c7ea6ad9b4d
100644
--- a/Source/core/dom/ContainerNode.cpp
+++ b/Source/core/dom/ContainerNode.cpp
@@ -852,7 +852,7 @@ void ContainerNode::attach(const AttachContext& context)
void ContainerNode::detach(const AttachContext& context)
{
detachChildren(context);
- clearChildNeedsStyleRecalc();
+ setChildNeedsStyleRecalc();
Node::detach(context);
}
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index
56fb995d78a7033954fdda8b5b547b0d8d05500c..eef69a897008bc9610bbd1a4f4d8e68ccaf53cd9
100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -975,7 +975,6 @@ void Node::detach(const AttachContext& context)
}
setStyleChange(NeedsReattachStyleChange);
- setChildNeedsStyleRecalc();
document().styleEngine().styleInvalidator().clearInvalidation(*this);
clearChildNeedsStyleInvalidation();
Index: Source/core/dom/Node.h
diff --git a/Source/core/dom/Node.h b/Source/core/dom/Node.h
index
6d6f3dc507ec4ce9d219c11181de03e8b705b593..7d1ea14ccd552d288052ba2669cac13fe3b98a0b
100644
--- a/Source/core/dom/Node.h
+++ b/Source/core/dom/Node.h
@@ -739,7 +739,7 @@ private:
HasEventTargetDataFlag = 1 << 26,
AlreadySpellCheckedFlag = 1 << 27,
- DefaultNodeFlags = IsFinishedParsingChildrenFlag |
ChildNeedsStyleRecalcFlag | NeedsReattachStyleChange
+ DefaultNodeFlags = IsFinishedParsingChildrenFlag |
NeedsReattachStyleChange
};
// 3 bits remaining.
@@ -753,7 +753,7 @@ protected:
enum ConstructionType {
CreateOther = DefaultNodeFlags,
CreateText = DefaultNodeFlags | IsTextFlag,
- CreateContainer = DefaultNodeFlags | IsContainerFlag,
+ CreateContainer = DefaultNodeFlags | ChildNeedsStyleRecalcFlag |
IsContainerFlag,
CreateElement = CreateContainer | IsElementFlag,
CreateShadowRoot = CreateContainer | IsDocumentFragmentFlag |
IsInShadowTreeFlag,
CreateDocumentFragment = CreateContainer | IsDocumentFragmentFlag,