Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Unified Diff: trunk/Source/core/dom/Node.cpp

Issue 16336010: Revert 150924 "Node::lazyAttach shouldn't lie about being attached" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/Source/core/dom/Node.h ('k') | trunk/Source/core/dom/Text.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/core/dom/Node.cpp
===================================================================
--- trunk/Source/core/dom/Node.cpp (revision 151673)
+++ trunk/Source/core/dom/Node.cpp (working copy)
@@ -864,19 +864,15 @@
markAncestorsWithChildNeedsStyleRecalc();
}
-void Node::lazyAttach()
+void Node::lazyAttach(ShouldSetAttached shouldSetAttached)
{
- // It's safe to synchronously attach here because we're in the middle of style recalc
- // while it's not safe to mark nodes as needing style recalc except in the loop in
- // Element::recalcStyle because we may mark an ancestor as not needing recalc and
- // then the node would never get updated. One place this currently happens is
- // HTMLObjectElement::renderFallbackContent which may call lazyAttach from inside
- // attach which was triggered by a recalcStyle.
- if (document()->inStyleRecalc()) {
- attach();
- return;
+ for (Node* n = this; n; n = NodeTraversal::next(n, this)) {
+ if (n->hasChildNodes())
+ n->setChildNeedsStyleRecalc();
+ n->setStyleChange(FullStyleChange);
+ if (shouldSetAttached == SetAttached)
+ n->setAttached();
}
- setStyleChange(FullStyleChange);
markAncestorsWithChildNeedsStyleRecalc();
}
« no previous file with comments | « trunk/Source/core/dom/Node.h ('k') | trunk/Source/core/dom/Text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698