Index: third_party/WebKit/Source/core/layout/LayoutText.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutText.cpp b/third_party/WebKit/Source/core/layout/LayoutText.cpp |
index a9c752da008b776c0b185fa9edad9f12291e07f9..a8e43ab43b0774ba9b7a11cb1fa9eae68923289d 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutText.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutText.cpp |
@@ -34,6 +34,7 @@ |
#include "core/layout/LayoutTableCell.h" |
#include "core/layout/LayoutTextCombine.h" |
#include "core/layout/LayoutView.h" |
+#include "core/layout/TextAutosizer.h" |
#include "core/layout/api/LineLayoutBox.h" |
#include "core/layout/line/AbstractInlineTextBox.h" |
#include "core/layout/line/EllipsisBox.h" |
@@ -209,6 +210,10 @@ void LayoutText::styleDidChange(StyleDifference diff, |
// This is an optimization that kicks off font load before layout. |
if (!text().containsOnlyWhitespace()) |
newStyle.font().willUseFontData(text()); |
+ |
+ TextAutosizer* textAutosizer = document().textAutosizer(); |
+ if (!oldStyle && textAutosizer) |
pdr.
2016/11/20 06:38:13
This approach of calling newNodeAdded for each nod
cathiechentx
2016/11/22 08:14:47
Actually this approach isn't as slow as it looks l
|
+ textAutosizer->newNodeAdded(this); |
} |
void LayoutText::removeAndDestroyTextBoxes() { |
@@ -1666,6 +1671,10 @@ void LayoutText::setText(PassRefPtr<StringImpl> text, bool force) { |
if (AXObjectCache* cache = document().existingAXObjectCache()) |
cache->textChanged(this); |
+ |
+ TextAutosizer* textAutosizer = document().textAutosizer(); |
+ if (textAutosizer) |
+ textAutosizer->newNodeAdded(this); |
} |
void LayoutText::dirtyOrDeleteLineBoxesIfNeeded(bool fullLayout) { |