Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp |
| index 899e1708cfc4e5208cb27eb0e8e16bea1f71afc0..9d0d385cb0e269e935a80a827aca59d1012112f9 100644 |
| --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp |
| +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp |
| @@ -79,6 +79,14 @@ LayoutSVGText::~LayoutSVGText() |
| ASSERT(m_layoutAttributes.isEmpty()); |
| } |
| +void LayoutSVGText::willBeDestroyed() |
| +{ |
| + m_layoutAttributes.clear(); |
| + m_layoutAttributesBuilder.clearTextPositioningElements(); |
| + |
| + LayoutSVGBlock::willBeDestroyed(); |
| +} |
| + |
| bool LayoutSVGText::isChildAllowed(LayoutObject* child, const ComputedStyle&) const |
| { |
| return child->isSVGInline() || (child->isText() && SVGLayoutSupport::isLayoutableTextNode(child)); |
| @@ -123,14 +131,7 @@ void LayoutSVGText::subtreeChildWasAdded() |
| // The positioning elements cache depends on the size of each text layoutObject in the |
| // subtree. If this changes, clear the cache. It will be rebuilt on the next layout. |
| invalidatePositioningValues(LayoutInvalidationReason::ChildChanged); |
|
pdr.
2016/04/06 23:31:40
setNeedsTextMetricsUpdate() requires that we mark
fs
2016/04/07 09:00:00
I didn't want to fold this call into invalidatePos
|
| -} |
| - |
| -void LayoutSVGText::willBeDestroyed() |
| -{ |
| - m_layoutAttributes.clear(); |
| - m_layoutAttributesBuilder.clearTextPositioningElements(); |
| - |
| - LayoutSVGBlock::willBeDestroyed(); |
| + setNeedsTextMetricsUpdate(); |
|
pdr.
2016/04/06 23:31:40
No tests seem fail without the change, but I don't
fs
2016/04/07 09:00:00
I think we do need it in subtreeChildWillBeRemoved
|
| } |
| void LayoutSVGText::subtreeChildWillBeRemoved() |
| @@ -159,6 +160,7 @@ void LayoutSVGText::subtreeTextDidChange() |
| // the subtree. If this changes, clear the cache and mark it for rebuilding |
| // in the next layout. |
| invalidatePositioningValues(LayoutInvalidationReason::TextChanged); |
| + setNeedsTextMetricsUpdate(); |
| } |
| static inline void updateFontInAllDescendants(LayoutSVGText& textRoot, SVGTextLayoutAttributesBuilder* builder = nullptr) |