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

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

Issue 2421793002: Move layout tree reconstruction code for Text nodes into new function (Closed)
Patch Set: Edits post Elliott's lgtm Created 4 years, 2 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 | « third_party/WebKit/Source/core/dom/Text.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4017f379c8cca22e0fe45e387d703b258ae3d24a..a8d3da8c39c28dd42514d1f5f82c1c6bc9140315 100644
--- a/third_party/WebKit/Source/core/dom/Text.cpp
+++ b/third_party/WebKit/Source/core/dom/Text.cpp
@@ -397,13 +397,17 @@ void Text::recalcTextStyle(StyleRecalcChange change, Text* nextTextSibling) {
layoutItem.setText(dataImpl());
clearNeedsStyleRecalc();
} else if (needsStyleRecalc() || needsWhitespaceLayoutObject()) {
- reattachLayoutTree();
- if (this->layoutObject())
- reattachWhitespaceSiblingsIfNeeded(nextTextSibling);
- clearNeedsReattachLayoutTree();
+ rebuildTextLayoutTree(nextTextSibling);
}
}
+void Text::rebuildTextLayoutTree(Text* nextTextSibling) {
+ reattachLayoutTree();
+ if (layoutObject())
+ reattachWhitespaceSiblingsIfNeeded(nextTextSibling);
+ clearNeedsReattachLayoutTree();
+}
+
// If a whitespace node had no layoutObject and goes through a recalcStyle it
// may need to create one if the parent style now has white-space: pre.
bool Text::needsWhitespaceLayoutObject() {
« no previous file with comments | « third_party/WebKit/Source/core/dom/Text.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698