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

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

Issue 2740823005: Track lastTextNode during rebuildLayoutTree. (Closed)
Patch Set: Missing reset of lastTextNode for elements. 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
« 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 f69b8552c899c41d59a2d26db83f4be95856723f..7644a6c95033d2e55349be50882a91f80e2913c3 100644
--- a/third_party/WebKit/Source/core/dom/Text.cpp
+++ b/third_party/WebKit/Source/core/dom/Text.cpp
@@ -392,7 +392,7 @@ void Text::reattachLayoutTreeIfNeeded(const AttachContext& context) {
CharacterData::attachLayoutTree(reattachContext);
}
-void Text::recalcTextStyle(StyleRecalcChange change, Text* nextTextSibling) {
+void Text::recalcTextStyle(StyleRecalcChange change) {
if (LayoutTextItem layoutItem = LayoutTextItem(this->layoutObject())) {
if (change != NoChange || needsStyleRecalc())
layoutItem.setStyle(document().ensureStyleResolver().styleForText(this));
@@ -400,23 +400,18 @@ void Text::recalcTextStyle(StyleRecalcChange change, Text* nextTextSibling) {
layoutItem.setText(dataImpl());
clearNeedsStyleRecalc();
} else if (needsStyleRecalc() || needsWhitespaceLayoutObject()) {
- StyleReattachData styleReattachData;
- styleReattachData.nextTextSibling = nextTextSibling;
- document().addStyleReattachData(*this, styleReattachData);
setNeedsReattachLayoutTree();
}
}
-void Text::rebuildTextLayoutTree() {
+void Text::rebuildTextLayoutTree(Text* nextTextSibling) {
DCHECK(!childNeedsStyleRecalc());
DCHECK(needsReattachLayoutTree());
DCHECK(parentNode());
reattachLayoutTree();
- if (layoutObject()) {
- reattachWhitespaceSiblingsIfNeeded(
- document().getStyleReattachData(*this).nextTextSibling);
- }
+ if (layoutObject())
+ reattachWhitespaceSiblingsIfNeeded(nextTextSibling);
clearNeedsReattachLayoutTree();
}
« 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