Diff
Modified: trunk/Source/WebCore/ChangeLog (292693 => 292694)
--- trunk/Source/WebCore/ChangeLog 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/ChangeLog 2022-04-11 04:22:48 UTC (rev 292694)
@@ -1,3 +1,16 @@
+2022-04-10 Commit Queue <commit-qu...@webkit.org>
+
+ Unreviewed, reverting r292690.
+ https://bugs.webkit.org/show_bug.cgi?id=239060
+
+ fast/multicol tests are randomly failing
+
+ Reverted changeset:
+
+ "[LBSE] Activate SVG transform support through layers"
+ https://bugs.webkit.org/show_bug.cgi?id=237711
+ https://commits.webkit.org/r292690
+
2022-04-10 Chris Dumez <cdu...@apple.com>
Update listMarkerTextForNodeAndPosition() to return a StringView instead of a String
Modified: trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp (292693 => 292694)
--- trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp 2022-04-11 04:22:48 UTC (rev 292694)
@@ -1533,17 +1533,6 @@
return *this;
}
-TransformationMatrix& TransformationMatrix::multiplyAffineTransform(const AffineTransform& matrix)
-{
- if (matrix.isIdentity())
- return *this;
-
- if (matrix.isIdentityOrTranslation())
- return translate(matrix.e(), matrix.f());
-
- return multiply(matrix.toTransformationMatrix());
-}
-
void TransformationMatrix::multVecMatrix(double x, double y, double& resultX, double& resultY) const
{
resultX = m_matrix[3][0] + x * m_matrix[0][0] + y * m_matrix[1][0];
Modified: trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h (292693 => 292694)
--- trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h 2022-04-11 04:22:48 UTC (rev 292694)
@@ -249,8 +249,6 @@
// this = mat * this.
WEBCORE_EXPORT TransformationMatrix& multiply(const TransformationMatrix&);
- // Identical to multiply(TransformationMatrix&), but saving a AffineTransform -> TransformationMatrix roundtrip for identity or translation matrices.
- TransformationMatrix& multiplyAffineTransform(const AffineTransform&);
WEBCORE_EXPORT TransformationMatrix& scale(double);
WEBCORE_EXPORT TransformationMatrix& scaleNonUniform(double sx, double sy);
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (292693 => 292694)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2022-04-11 04:22:48 UTC (rev 292694)
@@ -667,6 +667,13 @@
quads.append(localToAbsoluteQuad(localRect, UseTransforms, wasFixed));
}
+void RenderBox::updateLayerTransform()
+{
+ // Transform-origin depends on box size, so we need to update the layer transform after layout.
+ if (hasLayer())
+ layer()->updateTransform();
+}
+
void RenderBox::applyTransform(TransformationMatrix& t, const RenderStyle& style, const FloatRect& boundingBox, OptionSet<RenderStyle::TransformOperationOption> options) const
{
style.applyTransform(t, boundingBox, options);
Modified: trunk/Source/WebCore/rendering/RenderBox.h (292693 => 292694)
--- trunk/Source/WebCore/rendering/RenderBox.h 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/rendering/RenderBox.h 2022-04-11 04:22:48 UTC (rev 292694)
@@ -218,6 +218,7 @@
void addOverflowFromChild(const RenderBox* child) { addOverflowFromChild(child, child->locationOffset()); }
void addOverflowFromChild(const RenderBox* child, const LayoutSize& delta);
+ void updateLayerTransform();
void applyTransform(TransformationMatrix&, const RenderStyle&, const FloatRect& boundingBox, OptionSet<RenderStyle::TransformOperationOption> = RenderStyle::allTransformOperations) const override;
LayoutSize contentSize() const { return { contentWidth(), contentHeight() }; }
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (292693 => 292694)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2022-04-11 04:22:48 UTC (rev 292694)
@@ -552,9 +552,6 @@
{
auto& renderer = layer.renderer();
return renderer.hasTransformRelatedProperty()
-#if ENABLE(LAYER_BASED_SVG_ENGINE)
- || renderer.hasSVGTransform()
-#endif
|| renderer.hasClipPath()
|| renderer.hasFilter()
|| renderer.hasMask()
@@ -1360,13 +1357,19 @@
if (!m_transform)
return { };
+ // FIXME: [LBSE] Upstream transform support for RenderSVGModelObject derived renderers
+ if (!is<RenderBox>(renderer()))
+ return { };
+
+ auto& renderBox = downcast<RenderBox>(renderer());
+
// m_transform includes transform-origin and is affected by the choice of the transform-box.
// Therefore we can only use the cached m_transform, if the animation doesn't alter transform-box or excludes transform-origin.
// Query the animatedStyle() to obtain the current transformation, when accelerated transform animations are running.
- auto styleable = Styleable::fromRenderer(renderer());
+ auto styleable = Styleable::fromRenderer(renderBox);
if ((styleable && styleable->isRunningAcceleratedTransformAnimation()) || !options.contains(RenderStyle::TransformOperationOption::TransformOrigin)) {
- std::unique_ptr<RenderStyle> animatedStyle = renderer().animatedStyle();
+ std::unique_ptr<RenderStyle> animatedStyle = renderBox.animatedStyle();
TransformationMatrix transform;
updateTransformFromStyle(transform, *animatedStyle, options);
Modified: trunk/Source/WebCore/rendering/RenderLayerModelObject.cpp (292693 => 292694)
--- trunk/Source/WebCore/rendering/RenderLayerModelObject.cpp 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/rendering/RenderLayerModelObject.cpp 2022-04-11 04:22:48 UTC (rev 292694)
@@ -31,7 +31,6 @@
#include "RenderLayerScrollableArea.h"
#include "RenderSVGModelObject.h"
#include "RenderView.h"
-#include "SVGGraphicsElement.h"
#include "Settings.h"
#include "StyleScrollSnapPoints.h"
#include "TransformState.h"
@@ -232,13 +231,6 @@
layer()->backing()->suspendAnimations(time);
}
-void RenderLayerModelObject::updateLayerTransform()
-{
- // Transform-origin depends on box size, so we need to update the layer transform after layout.
- if (hasLayer())
- layer()->updateTransform();
-}
-
#if ENABLE(LAYER_BASED_SVG_ENGINE)
std::optional<LayoutRect> RenderLayerModelObject::computeVisibleRectInSVGContainer(const LayoutRect& rect, const RenderLayerModelObject* container, RenderObject::VisibleRectContext context) const
{
@@ -324,38 +316,6 @@
container->mapLocalToContainer(ancestorContainer, transformState, mode, wasFixed);
}
-
-void RenderLayerModelObject::applySVGTransform(TransformationMatrix& transform, SVGGraphicsElement& graphicsElement, const RenderStyle& style, const FloatRect& boundingBox, OptionSet<RenderStyle::TransformOperationOption> options) const
-{
- // This check does not use style.hasTransformRelatedProperty() on purpose -- we only want to know if either the 'transform' property, an
- // offset path, or the individual transform operations are set (perspective / transform-style: preserve-3d are not relevant here).
- bool hasCSSTransform = style.hasTransform() || style.rotate() || style.translate() || style.scale();
-
- bool affectedByTransformOrigin = false;
- std::optional<AffineTransform> svgTransform;
-
- if (hasCSSTransform)
- affectedByTransformOrigin = style.affectedByTransformOrigin();
- else if (auto affineTransform = graphicsElement.animatedLocalTransform(); !affineTransform.isIdentity()) {
- svgTransform = affineTransform;
- affectedByTransformOrigin = affineTransform.a() != 1 || affineTransform.b() || affineTransform.c() || affineTransform.d() != 1;
- }
-
- if (!hasCSSTransform && !svgTransform.has_value())
- return;
-
- FloatPoint3D originTranslate;
- if (options.contains(RenderStyle::TransformOperationOption::TransformOrigin) && affectedByTransformOrigin)
- originTranslate = style.applyTransformOrigin(transform, boundingBox);
-
- // CSS transforms take precedence over SVG transforms.
- if (hasCSSTransform)
- style.applyCSSTransform(transform, boundingBox, options);
- else
- transform.multiplyAffineTransform(svgTransform.value());
-
- style.unapplyTransformOrigin(transform, originTranslate);
-}
#endif
bool rendererNeedsPixelSnapping(const RenderLayerModelObject& renderer)
Modified: trunk/Source/WebCore/rendering/RenderLayerModelObject.h (292693 => 292694)
--- trunk/Source/WebCore/rendering/RenderLayerModelObject.h 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/rendering/RenderLayerModelObject.h 2022-04-11 04:22:48 UTC (rev 292694)
@@ -28,7 +28,6 @@
class KeyframeList;
class RenderLayer;
-class SVGGraphicsElement;
struct LayerRepaintRects {
LayoutRect clippedOverflowRect;
@@ -76,12 +75,8 @@
// Provides the SVG implementation for mapLocalToContainer().
// This lives in RenderLayerModelObject, which is the common base-class for all SVG renderers.
void mapLocalToSVGContainer(const RenderLayerModelObject* ancestorContainer, TransformState&, OptionSet<MapCoordinatesMode>, bool* wasFixed) const;
-
- void applySVGTransform(TransformationMatrix&, SVGGraphicsElement&, const RenderStyle&, const FloatRect& boundingBox, OptionSet<RenderStyle::TransformOperationOption>) const;
#endif
- void updateLayerTransform();
-
virtual void applyTransform(TransformationMatrix&, const RenderStyle&, const FloatRect& boundingBox, OptionSet<RenderStyle::TransformOperationOption> = RenderStyle::allTransformOperations) const = 0;
protected:
Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (292693 => 292694)
--- trunk/Source/WebCore/rendering/RenderObject.cpp 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp 2022-04-11 04:22:48 UTC (rev 292694)
@@ -1987,14 +1987,6 @@
ensureRareData().setHasOutlineAutoAncestor(hasOutlineAutoAncestor);
}
-#if ENABLE(LAYER_BASED_SVG_ENGINE)
-void RenderObject::setHasSVGTransform(bool hasSVGTransform)
-{
- if (hasSVGTransform || hasRareData())
- ensureRareData().setHasSVGTransform(hasSVGTransform);
-}
-#endif
-
void RenderObject::setPaintContainmentApplies(bool paintContainmentApplies)
{
if (paintContainmentApplies || hasRareData())
Modified: trunk/Source/WebCore/rendering/RenderObject.h (292693 => 292694)
--- trunk/Source/WebCore/rendering/RenderObject.h 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/rendering/RenderObject.h 2022-04-11 04:22:48 UTC (rev 292694)
@@ -416,12 +416,6 @@
bool hasOutlineAutoAncestor() const { return m_bitfields.hasRareData() && rareData().hasOutlineAutoAncestor(); }
bool paintContainmentApplies() const { return m_bitfields.hasRareData() && rareData().paintContainmentApplies(); }
-#if ENABLE(LAYER_BASED_SVG_ENGINE)
- bool hasSVGTransform() const { return m_bitfields.hasRareData() && rareData().hasSVGTransform(); }
-#else
- bool hasSVGTransform() const { return false; }
-#endif
-
bool isExcludedFromNormalLayout() const { return m_bitfields.isExcludedFromNormalLayout(); }
void setIsExcludedFromNormalLayout(bool excluded) { m_bitfields.setIsExcludedFromNormalLayout(excluded); }
bool isExcludedAndPlacedInBorder() const { return isExcludedFromNormalLayout() && isLegend(); }
@@ -456,7 +450,7 @@
bool hasPotentiallyScrollableOverflow() const;
bool hasTransformRelatedProperty() const { return m_bitfields.hasTransformRelatedProperty(); } // Transform, perspective or transform-style: preserve-3d.
- bool hasTransform() const { return hasTransformRelatedProperty() && (style().hasTransform() || style().translate() || style().scale() || style().rotate() || hasSVGTransform()); }
+ bool hasTransform() const { return hasTransformRelatedProperty() && (style().hasTransform() || style().translate() || style().scale() || style().rotate()); }
bool hasTransformOrPespective() const { return hasTransformRelatedProperty() && (hasTransform() || style().hasPerspective()); }
inline bool preservesNewline() const;
@@ -521,9 +515,6 @@
void setIsRenderFragmentedFlow(bool = true);
void setHasOutlineAutoAncestor(bool = true);
void setPaintContainmentApplies(bool = true);
-#if ENABLE(LAYER_BASED_SVG_ENGINE)
- void setHasSVGTransform(bool = true);
-#endif
// Hook so that RenderTextControl can return the line height of its inner renderer.
// For other renderers, the value is the same as lineHeight(false).
@@ -953,9 +944,6 @@
ADD_BOOLEAN_BITFIELD(isRenderFragmentedFlow, IsRenderFragmentedFlow);
ADD_BOOLEAN_BITFIELD(hasOutlineAutoAncestor, HasOutlineAutoAncestor);
ADD_BOOLEAN_BITFIELD(paintContainmentApplies, PaintContainmentApplies);
-#if ENABLE(LAYER_BASED_SVG_ENGINE)
- ADD_BOOLEAN_BITFIELD(hasSVGTransform, HasSVGTransform);
-#endif
// From RenderElement
std::unique_ptr<ReferencedSVGResources> referencedSVGResources;
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp (292693 => 292694)
--- trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp 2022-04-11 04:22:48 UTC (rev 292694)
@@ -52,36 +52,6 @@
RenderSVGContainer::~RenderSVGContainer() = default;
-// Helper class, move to its own file once utilized in more than one place.
-class SVGLayerTransformUpdater {
- WTF_MAKE_NONCOPYABLE(SVGLayerTransformUpdater);
-public:
- SVGLayerTransformUpdater(RenderLayerModelObject& renderer)
- : m_renderer(renderer)
- {
- if (!m_renderer.hasLayer())
- return;
-
- m_transformReferenceBox = m_renderer.transformReferenceBoxRect();
- m_renderer.updateLayerTransform();
- }
-
-
- ~SVGLayerTransformUpdater()
- {
- if (!m_renderer.hasLayer())
- return;
- if (m_renderer.transformReferenceBoxRect() == m_transformReferenceBox)
- return;
-
- m_renderer.updateLayerTransform();
- }
-
-private:
- RenderLayerModelObject& m_renderer;
- FloatRect m_transformReferenceBox;
-};
-
void RenderSVGContainer::layout()
{
StackStats::LayoutCheckPoint layoutCheckPoint;
@@ -94,10 +64,13 @@
// Update layer transform before laying out children (SVG needs access to the transform matrices during layout for on-screen text font-size calculations).
// Eventually re-update if the transform reference box, relevant for transform-origin, has changed during layout.
{
- SVGLayerTransformUpdater updateTransform(*this);
+ // FIXME: [LBSE] Upstream SVGLayerTransformUpdater
+ // SVGLayerTransformUpdater transformUpdater(*this);
layoutChildren();
}
+ updateLayerInformation();
+
// Invalidate all resources of this client if our layout changed.
if (everHadLayout() && needsLayout())
SVGResourcesCache::clientLayoutChanged(*this);
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGContainer.h (292693 => 292694)
--- trunk/Source/WebCore/rendering/svg/RenderSVGContainer.h 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGContainer.h 2022-04-11 04:22:48 UTC (rev 292694)
@@ -55,6 +55,7 @@
virtual void layoutChildren();
bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override;
+ virtual void updateLayerInformation() { }
virtual void calculateViewport();
virtual bool pointIsInsideViewportClip(const FloatPoint&) { return true; }
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp (292693 => 292694)
--- trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp 2022-04-11 04:22:48 UTC (rev 292694)
@@ -36,7 +36,6 @@
#include "RenderGeometryMap.h"
#include "RenderLayer.h"
#include "RenderLayerModelObject.h"
-#include "RenderSVGModelObjectInlines.h"
#include "RenderSVGResource.h"
#include "RenderView.h"
#include "SVGElementInlines.h"
@@ -60,13 +59,15 @@
void RenderSVGModelObject::updateFromStyle()
{
RenderLayerModelObject::updateFromStyle();
+ setHasTransformRelatedProperty(style().hasTransformRelatedProperty());
- bool hasSVGTransform = false;
- if (is<SVGGraphicsElement>(element()))
- hasSVGTransform = !downcast<SVGGraphicsElement>(element()).animatedLocalTransform().isIdentity();
+ AffineTransform transform;
+ if (is<SVGGraphicsElement>(nodeForNonAnonymous()))
+ transform = downcast<SVGGraphicsElement>(nodeForNonAnonymous()).animatedLocalTransform();
- setHasTransformRelatedProperty(style().hasTransformRelatedProperty() || hasSVGTransform);
- setHasSVGTransform(hasSVGTransform);
+ // FIXME: [LBSE] Upstream RenderObject changes
+ // if (!transform.isIdentity())
+ // setHasSVGTransform();
}
FloatRect RenderSVGModelObject::borderBoxRectInFragmentEquivalent(RenderFragmentContainer*, RenderBox::RenderBoxFragmentInfoFlags) const
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp (292693 => 292694)
--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp 2022-04-11 04:22:48 UTC (rev 292694)
@@ -396,7 +396,8 @@
{
RenderReplaced::updateFromStyle();
- setHasSVGTransform();
+ // FIXME: [LBSE] Upstream RenderObject changes
+ // setHasSVGTransform();
if (shouldApplyViewportClip())
setHasNonVisibleOverflow();
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp (292693 => 292694)
--- trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp 2022-04-11 04:22:48 UTC (rev 292694)
@@ -154,7 +154,8 @@
setLayoutRect(enclosingLayoutRect(m_fillBoundingBox));
}
- updateLayerTransform();
+ // FIXME: [LBSE] Upstream SVGLayerTransformUpdater
+ // SVGRenderSupport::updateLayerTransform(*this);
// Invalidate all resources of this client if our layout changed.
if (everHadLayout() && selfNeedsLayout())
@@ -535,7 +536,8 @@
void RenderSVGShape::applyTransform(TransformationMatrix& transform, const RenderStyle& style, const FloatRect& boundingBox, OptionSet<RenderStyle::TransformOperationOption> options) const
{
- applySVGTransform(transform, graphicsElement(), style, boundingBox, options);
+ // FIXME: [LBSE] Upstream CSS/SVG transform support
+ style.applyTransform(transform, boundingBox, options);
}
}
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGShape.h (292693 => 292694)
--- trunk/Source/WebCore/rendering/svg/RenderSVGShape.h 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGShape.h 2022-04-11 04:22:48 UTC (rev 292694)
@@ -82,7 +82,7 @@
FloatRect computeMarkerBoundingBox(const SVGBoundingBoxComputation::DecorationOptions&) const;
- void applyTransform(TransformationMatrix&, const RenderStyle&, const FloatRect& boundingBox, OptionSet<RenderStyle::TransformOperationOption> = RenderStyle::allTransformOperations) const final;
+ void applyTransform(TransformationMatrix&, const RenderStyle&, const FloatRect& boundingBox, OptionSet<RenderStyle::TransformOperationOption> = RenderStyle::allTransformOperations) const override;
protected:
void element() const = delete;
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.cpp (292693 => 292694)
--- trunk/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.cpp 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.cpp 2022-04-11 04:22:48 UTC (rev 292694)
@@ -97,13 +97,15 @@
{
RenderSVGContainer::updateFromStyle();
- if (associatedUseElement(graphicsElement()))
- setHasSVGTransform();
+ // FIXME: [LBSE] Upstream CSS/SVG transform support
+ // if (associatedUseElement(graphicsElement()))
+ // setHasSVGTransform();
}
void RenderSVGTransformableContainer::applyTransform(TransformationMatrix& transform, const RenderStyle& style, const FloatRect& boundingBox, OptionSet<RenderStyle::TransformOperationOption> options) const
{
- applySVGTransform(transform, graphicsElement(), style, boundingBox, options);
+ // FIXME: [LBSE] Upstream CSS/SVG transform support
+ style.applyTransform(transform, boundingBox, options);
}
void RenderSVGTransformableContainer::styleWillChange(StyleDifference diff, const RenderStyle& newStyle)
Modified: trunk/Source/WebCore/svg/SVGGraphicsElement.cpp (292693 => 292694)
--- trunk/Source/WebCore/svg/SVGGraphicsElement.cpp 2022-04-11 01:32:25 UTC (rev 292693)
+++ trunk/Source/WebCore/svg/SVGGraphicsElement.cpp 2022-04-11 04:22:48 UTC (rev 292694)
@@ -73,15 +73,6 @@
AffineTransform SVGGraphicsElement::animatedLocalTransform() const
{
-#if ENABLE(LAYER_BASED_SVG_ENGINE)
- // LBSE handles transforms via RenderLayer, no need to handle CSS transforms here.
- if (document().settings().layerBasedSVGEngineEnabled()) {
- if (m_supplementalTransform)
- return *m_supplementalTransform * transform().concatenate();
- return transform().concatenate();
- }
-#endif
-
AffineTransform matrix;
auto* style = renderer() ? &renderer()->style() : nullptr;