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

Unified Diff: third_party/WebKit/Source/core/dom/Text.cpp

Issue 2473743003: Call Element::rebuildLayoutTree from Document::updateStyle directly (Closed)
Patch Set: Make needsAttach() only check if getStyleChangeType flag is NeedsReattachStyleChange and add a Layo… Created 3 years, 9 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
Index: third_party/WebKit/Source/core/dom/Text.cpp
diff --git a/third_party/WebKit/Source/core/dom/Text.cpp b/third_party/WebKit/Source/core/dom/Text.cpp
index c77bf86cff8aad5f0ca9e407265d14f89eab2877..f69b8552c899c41d59a2d26db83f4be95856723f 100644
--- a/third_party/WebKit/Source/core/dom/Text.cpp
+++ b/third_party/WebKit/Source/core/dom/Text.cpp
@@ -400,14 +400,23 @@ void Text::recalcTextStyle(StyleRecalcChange change, Text* nextTextSibling) {
layoutItem.setText(dataImpl());
clearNeedsStyleRecalc();
} else if (needsStyleRecalc() || needsWhitespaceLayoutObject()) {
- rebuildTextLayoutTree(nextTextSibling);
+ StyleReattachData styleReattachData;
+ styleReattachData.nextTextSibling = nextTextSibling;
+ document().addStyleReattachData(*this, styleReattachData);
+ setNeedsReattachLayoutTree();
}
}
-void Text::rebuildTextLayoutTree(Text* nextTextSibling) {
+void Text::rebuildTextLayoutTree() {
+ DCHECK(!childNeedsStyleRecalc());
+ DCHECK(needsReattachLayoutTree());
+ DCHECK(parentNode());
+
reattachLayoutTree();
- if (layoutObject())
- reattachWhitespaceSiblingsIfNeeded(nextTextSibling);
+ if (layoutObject()) {
+ reattachWhitespaceSiblingsIfNeeded(
+ document().getStyleReattachData(*this).nextTextSibling);
+ }
clearNeedsReattachLayoutTree();
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/Text.h ('k') | third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698