…layout https://bugs.webkit.org/show_bug.cgi?id=245918 <rdar://100647287> Reviewed by Nikolas Zimmermann. The transform-origin depends on the size of the shape, but <g> (LegacyRenderSVGContainer) only gets the final bounds after laying out the children and updating the cached boundaries. Make sure we recompute the transforms again after calling updateCachedBoundaries(), but only recompute when transformReferenceBoxRect() was changed. Test: css/css-transforms/transform-box/fill-box-002.html * LayoutTests/TestExpectations: * Source/WebCore/rendering/svg/LegacyRenderSVGContainer.cpp: (WebCore::LegacyRenderSVGContainer::layout): * Source/WebCore/rendering/svg/LegacyRenderSVGTransformableContainer.cpp: (WebCore::LegacyRenderSVGTransformableContainer::calculateLocalTransform): * Source/WebCore/rendering/svg/LegacyRenderSVGTransformableContainer.h: Canonical link: https://commits.webkit.org/255060@main
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -63,6 +63,12 @@ bool LegacyRenderSVGTransformableContainer::calculateLocalTransform() | ||
m_lastTranslation = translation; | ||
} | ||
|
||
auto referenceBoxRect = transformReferenceBoxRect(); | ||
if (referenceBoxRect != m_lastTransformReferenceBoxRect) { | ||
m_lastTransformReferenceBoxRect = referenceBoxRect; | ||
m_needsTransformUpdate = true; | ||
} | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
nt1m
Author
Member
|
||
|
||
m_didTransformToRootUpdate = m_needsTransformUpdate || SVGRenderSupport::transformToRootChanged(parent()); | ||
if (!m_needsTransformUpdate) | ||
return false; | ||
It is strange that we run this code even if
m_needsTransformUpdate
is true. Also I think we should run it only if the layout depends on thereferenceBoxRect()
. I think this happens only iftransform-origin
attribute has a percentage lengths.