summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/rendering/svg/RenderSVGText.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/svg/RenderSVGText.cpp')
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGText.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/Source/WebCore/rendering/svg/RenderSVGText.cpp b/Source/WebCore/rendering/svg/RenderSVGText.cpp
index dad0b70..56d9306 100644
--- a/Source/WebCore/rendering/svg/RenderSVGText.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGText.cpp
@@ -33,7 +33,7 @@
#include "GraphicsContext.h"
#include "HitTestRequest.h"
#include "PointerEventsHitRules.h"
-#include "RenderLayer.h"
+#include "RenderSVGInlineText.h"
#include "RenderSVGResource.h"
#include "RenderSVGRoot.h"
#include "SVGLengthList.h"
@@ -91,6 +91,18 @@ void RenderSVGText::mapLocalToContainer(RenderBoxModelObject* repaintContainer,
SVGRenderSupport::mapLocalToContainer(this, repaintContainer, fixed, useTransforms, transformState);
}
+static inline void recursiveUpdateScaledFont(RenderObject* start)
+{
+ for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) {
+ if (child->isSVGInlineText()) {
+ toRenderSVGInlineText(child)->updateScaledFont();
+ continue;
+ }
+
+ recursiveUpdateScaledFont(child);
+ }
+}
+
void RenderSVGText::layout()
{
ASSERT(needsLayout());
@@ -104,6 +116,13 @@ void RenderSVGText::layout()
updateCachedBoundariesInParents = true;
}
+ // If the root layout size changed (eg. window size changes) or the positioning values change, recompute the on-screen font size.
+ if (m_needsPositioningValuesUpdate || SVGRenderSupport::findTreeRootObject(this)->isLayoutSizeChanged()) {
+ recursiveUpdateScaledFont(this);
+ m_needsPositioningValuesUpdate = true;
+ updateCachedBoundariesInParents = true;
+ }
+
if (m_needsPositioningValuesUpdate) {
// Perform SVG text layout phase one (see SVGTextLayoutAttributesBuilder for details).
SVGTextLayoutAttributesBuilder layoutAttributesBuilder;