Chromium Code Reviews| 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 a8d3da8c39c28dd42514d1f5f82c1c6bc9140315..4ae2f4ec57022b5c82141283a69f7da2bf4e78d3 100644 |
| --- a/third_party/WebKit/Source/core/dom/Text.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Text.cpp |
| @@ -395,16 +395,23 @@ void Text::recalcTextStyle(StyleRecalcChange change, Text* nextTextSibling) { |
| layoutItem.setStyle(document().ensureStyleResolver().styleForText(this)); |
| if (needsStyleRecalc()) |
| layoutItem.setText(dataImpl()); |
| - clearNeedsStyleRecalc(); |
| } else if (needsStyleRecalc() || needsWhitespaceLayoutObject()) { |
| - rebuildTextLayoutTree(nextTextSibling); |
| + setNeedsReattachLayoutTree(); |
| } |
| + clearNeedsStyleRecalc(); |
| } |
| -void Text::rebuildTextLayoutTree(Text* nextTextSibling) { |
|
nainar
2016/11/03 00:17:10
If bugs finishes his patch before this needs to la
|
| +void Text::rebuildTextLayoutTree() { |
| + DCHECK(!needsStyleRecalc()); |
| + DCHECK(!childNeedsStyleRecalc()); |
| + DCHECK(needsReattachLayoutTree()); |
| + |
| reattachLayoutTree(); |
| - if (layoutObject()) |
| - reattachWhitespaceSiblingsIfNeeded(nextTextSibling); |
| + if (layoutObject()) { |
| + // TODO(bugsnash): This is a performance regression - bugsnash is working on |
| + // alleviating this regression |
| + reattachWhitespaceSiblingsIfNeeded(nextTextSibling()); |
| + } |
| clearNeedsReattachLayoutTree(); |
| } |