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

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp

Issue 1865923002: Invalidate text metrics when the <text> subtree is mutated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/LayoutTests/TestExpectations ('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/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)
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698