Commit 496526b8 authored by chrishtr@chromium.org's avatar chrishtr@chromium.org

Fix markAncestorsWithChildNeedsStyleInvalidation to actually mark only ancestors.

Make corresponding fix to StyleInvalidator to not break invalidations in
which the document element itself needed invalidation.

Review URL: https://codereview.chromium.org/201443011

git-svn-id: svn://svn.chromium.org/blink/trunk@169788 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 3c0f9e06
...@@ -18,10 +18,8 @@ namespace WebCore { ...@@ -18,10 +18,8 @@ namespace WebCore {
void StyleInvalidator::invalidate() void StyleInvalidator::invalidate()
{ {
if (Element* documentElement = m_document.documentElement()) { if (Element* documentElement = m_document.documentElement())
if (documentElement->childNeedsStyleInvalidation()) invalidate(*documentElement);
invalidate(*documentElement);
}
m_document.clearChildNeedsStyleInvalidation(); m_document.clearChildNeedsStyleInvalidation();
m_document.clearNeedsStyleInvalidation(); m_document.clearNeedsStyleInvalidation();
m_pendingInvalidationMap.clear(); m_pendingInvalidationMap.clear();
......
...@@ -648,8 +648,7 @@ void Node::setNeedsStyleInvalidation() ...@@ -648,8 +648,7 @@ void Node::setNeedsStyleInvalidation()
void Node::markAncestorsWithChildNeedsStyleInvalidation() void Node::markAncestorsWithChildNeedsStyleInvalidation()
{ {
Node* node = this; for (Node* node = parentOrShadowHostNode(); node && !node->childNeedsStyleInvalidation(); node = node->parentOrShadowHostNode())
for (; node && !node->childNeedsStyleInvalidation(); node = node->parentOrShadowHostNode())
node->setChildNeedsStyleInvalidation(); node->setChildNeedsStyleInvalidation();
if (document().childNeedsStyleInvalidation()) if (document().childNeedsStyleInvalidation())
document().scheduleStyleRecalc(); document().scheduleStyleRecalc();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment