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

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: Addressing Bugs' comments 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..ed0e9ab696fbd124539e3a23db3be4ac80a00147 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) {
esprehn 2016/10/27 02:06:07 DCHECK(needsReattachLayoutTree()) at the top of th
nainar 2016/10/27 03:32:14 We can't assert that here as we aren't setting nee
+ reattachLayoutTree();
+ if (this->layoutObject())
esprehn 2016/10/27 02:06:07 remove this->, there's no name conflict now that y
nainar 2016/10/27 03:32:14 Done.
+ 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