| 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 14174575961fc7206f750c4432cc5ba811aef590..f006b3599c546c7bbaed5fb9e3eb3af2c2365211 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutText.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutText.cpp
|
| @@ -150,7 +150,7 @@ static void makeCapitalized(String* string, UChar previous) {
|
| }
|
|
|
| LayoutText::LayoutText(Node* node, PassRefPtr<StringImpl> str)
|
| - : LayoutObject(!node || node->isDocumentNode() ? 0 : node),
|
| + : LayoutObject(node),
|
| m_hasTab(false),
|
| m_linesDirty(false),
|
| m_containsReversedText(false),
|
| @@ -163,15 +163,11 @@ LayoutText::LayoutText(Node* node, PassRefPtr<StringImpl> str)
|
| m_firstTextBox(nullptr),
|
| m_lastTextBox(nullptr) {
|
| ASSERT(m_text);
|
| - // FIXME: Some clients of LayoutText (and subclasses) pass Document as node to
|
| - // create anonymous layoutObject.
|
| - // They should be switched to passing null and using setDocumentForAnonymous.
|
| - if (node && node->isDocumentNode())
|
| - setDocumentForAnonymous(toDocument(node));
|
| -
|
| setIsText();
|
|
|
| - view()->frameView()->incrementVisuallyNonEmptyCharacterCount(m_text.length());
|
| + DCHECK(!node || !node->isDocumentNode());
|
| + if (node)
|
| + frameView()->incrementVisuallyNonEmptyCharacterCount(m_text.length());
|
| }
|
|
|
| #if DCHECK_IS_ON()
|
| @@ -2031,6 +2027,12 @@ PassRefPtr<AbstractInlineTextBox> LayoutText::firstAbstractInlineTextBox() {
|
| m_firstTextBox);
|
| }
|
|
|
| +LayoutText* LayoutText::createEmptyAnonymous(Document& doc) {
|
| + LayoutText* text = new LayoutText(nullptr, StringImpl::empty);
|
| + text->setDocumentForAnonymous(&doc);
|
| + return text;
|
| +}
|
| +
|
| void LayoutText::invalidateDisplayItemClients(
|
| PaintInvalidationReason invalidationReason) const {
|
| ObjectPaintInvalidator paintInvalidator(*this);
|
|
|