| Differences between
and this patch
- a/Source/WebCore/ChangeLog +38 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2022-02-22  Nikolas Zimmermann  <nzimmermann@igalia.com>
2
3
        [LBSE] Begin layer-aware RenderSVGTransformableContainer implementation
4
        https://bugs.webkit.org/show_bug.cgi?id=237024
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Create RenderSVGContainer based on the downstream LBSE implementation.
9
10
        This patch does not yet enable the creation of RenderSVGContainer
11
        renderers if LBSE is enabled, since the derived classes, such as
12
        RenderSVGHiddenContainer / RenderSVGViewportContainer / ..., are still
13
        missing in LBSE.
14
15
        Covered by existing tests, no change in behaviour.
16
17
        * Sources.txt: Add RenderSVGTransformableContainer.* to build.
18
        * WebCore.xcodeproj/project.pbxproj: Ditto.
19
        * rendering/RenderObject.h:
20
        (WebCore::RenderObject::isSVGTransformableContainer const):
21
        * rendering/svg/RenderSVGTransformableContainer.cpp: Added.
22
        (WebCore::RenderSVGTransformableContainer::RenderSVGTransformableContainer):
23
        (WebCore::associatedUseElement):
24
        (WebCore::RenderSVGTransformableContainer::extraContainerTranslation const):
25
        (WebCore::RenderSVGTransformableContainer::calculateViewport):
26
        (WebCore::RenderSVGTransformableContainer::layoutChildren):
27
        (WebCore::RenderSVGTransformableContainer::updateFromStyle):
28
        (WebCore::RenderSVGTransformableContainer::applyTransform const):
29
        (WebCore::RenderSVGTransformableContainer::styleWillChange):
30
        (WebCore::RenderSVGTransformableContainer::graphicsElement const):
31
        * rendering/svg/RenderSVGTransformableContainer.h: Added.
32
        * rendering/svg/SVGContainerLayout.cpp:
33
        (WebCore::SVGContainerLayout::transformToRootChanged):
34
        * svg/SVGElement.cpp: Create renderer for <g> elements in LBSE mode.
35
        (WebCore::createSVGLayerAwareElementSet):
36
        * svg/SVGGElement.cpp: Diteto.
37
        (WebCore::SVGGElement::createElementRenderer):
38
1
2022-02-22  Nikolas Zimmermann  <nzimmermann@igalia.com>
39
2022-02-22  Nikolas Zimmermann  <nzimmermann@igalia.com>
2
40
3
        [LBSE] Rename RenderSVGTransformableContainer -> LegacyRenderSVGTransformableContainer
41
        [LBSE] Rename RenderSVGTransformableContainer -> LegacyRenderSVGTransformableContainer
- a/Source/WebCore/Sources.txt +1 lines
Lines 2511-2516 rendering/svg/RenderSVGShape.cpp a/Source/WebCore/Sources.txt_sec1
2511
rendering/svg/RenderSVGTSpan.cpp
2511
rendering/svg/RenderSVGTSpan.cpp
2512
rendering/svg/RenderSVGText.cpp
2512
rendering/svg/RenderSVGText.cpp
2513
rendering/svg/RenderSVGTextPath.cpp
2513
rendering/svg/RenderSVGTextPath.cpp
2514
rendering/svg/RenderSVGTransformableContainer.cpp
2514
rendering/svg/RenderSVGViewportContainer.cpp
2515
rendering/svg/RenderSVGViewportContainer.cpp
2515
rendering/svg/SVGBoundingBoxComputation.cpp
2516
rendering/svg/SVGBoundingBoxComputation.cpp
2516
rendering/svg/SVGContainerLayout.cpp
2517
rendering/svg/SVGContainerLayout.cpp
- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +6 lines
Lines 1263-1268 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
1263
		436708E312D9CA4B00044234 /* RenderSVGResourceSolidColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708A412D9CA4B00044234 /* RenderSVGResourceSolidColor.h */; };
1263
		436708E312D9CA4B00044234 /* RenderSVGResourceSolidColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708A412D9CA4B00044234 /* RenderSVGResourceSolidColor.h */; };
1264
		436708E512D9CA4B00044234 /* LegacyRenderSVGRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708A612D9CA4B00044234 /* LegacyRenderSVGRoot.h */; };
1264
		436708E512D9CA4B00044234 /* LegacyRenderSVGRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708A612D9CA4B00044234 /* LegacyRenderSVGRoot.h */; };
1265
		436708E512D9DB4B00044234 /* RenderSVGRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708A612D9DB4B00044234 /* RenderSVGRoot.h */; };
1265
		436708E512D9DB4B00044234 /* RenderSVGRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708A612D9DB4B00044234 /* RenderSVGRoot.h */; };
1266
		436707E724C9CA4B10044234 /* RenderSVGTransformableContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 436718BB12D9CA4B00042234 /* RenderSVGTransformableContainer.h */; };
1266
		436708E912D9CA4B00044234 /* LegacyRenderSVGTransformableContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708AA12D9CA4B00044234 /* LegacyRenderSVGTransformableContainer.h */; };
1267
		436708E912D9CA4B00044234 /* LegacyRenderSVGTransformableContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708AA12D9CA4B00044234 /* LegacyRenderSVGTransformableContainer.h */; };
1267
		436708EB12D9CA4B00044234 /* RenderSVGViewportContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708AC12D9CA4B00044234 /* RenderSVGViewportContainer.h */; };
1268
		436708EB12D9CA4B00044234 /* RenderSVGViewportContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708AC12D9CA4B00044234 /* RenderSVGViewportContainer.h */; };
1268
		436708EE12D9CA4B00044234 /* SVGMarkerData.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708AF12D9CA4B00044234 /* SVGMarkerData.h */; };
1269
		436708EE12D9CA4B00044234 /* SVGMarkerData.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708AF12D9CA4B00044234 /* SVGMarkerData.h */; };
Lines 9091-9097 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
9091
		436708A512D9CA5C00044234 /* RenderSVGRoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGRoot.cpp; sourceTree = "<group>"; };
9092
		436708A512D9CA5C00044234 /* RenderSVGRoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGRoot.cpp; sourceTree = "<group>"; };
9092
		436708A612D9CA4B00044234 /* LegacyRenderSVGRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyRenderSVGRoot.h; sourceTree = "<group>"; };
9093
		436708A612D9CA4B00044234 /* LegacyRenderSVGRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyRenderSVGRoot.h; sourceTree = "<group>"; };
9093
		436708A612D9DB4B00044234 /* RenderSVGRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGRoot.h; sourceTree = "<group>"; };
9094
		436708A612D9DB4B00044234 /* RenderSVGRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGRoot.h; sourceTree = "<group>"; };
9095
		436708B812C9CA4C00011434 /* RenderSVGTransformableContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGTransformableContainer.cpp; sourceTree = "<group>"; };
9094
		436708A912D9CA4B00044234 /* LegacyRenderSVGTransformableContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyRenderSVGTransformableContainer.cpp; sourceTree = "<group>"; };
9096
		436708A912D9CA4B00044234 /* LegacyRenderSVGTransformableContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyRenderSVGTransformableContainer.cpp; sourceTree = "<group>"; };
9097
		436718BB12D9CA4B00042234 /* RenderSVGTransformableContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGTransformableContainer.h; sourceTree = "<group>"; };
9095
		436708AA12D9CA4B00044234 /* LegacyRenderSVGTransformableContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyRenderSVGTransformableContainer.h; sourceTree = "<group>"; };
9098
		436708AA12D9CA4B00044234 /* LegacyRenderSVGTransformableContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyRenderSVGTransformableContainer.h; sourceTree = "<group>"; };
9096
		436708AB12D9CA4B00044234 /* RenderSVGViewportContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGViewportContainer.cpp; sourceTree = "<group>"; };
9099
		436708AB12D9CA4B00044234 /* RenderSVGViewportContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGViewportContainer.cpp; sourceTree = "<group>"; };
9097
		436708AC12D9CA4B00044234 /* RenderSVGViewportContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGViewportContainer.h; sourceTree = "<group>"; };
9100
		436708AC12D9CA4B00044234 /* RenderSVGViewportContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGViewportContainer.h; sourceTree = "<group>"; };
Lines 19126-19131 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
19126
				0854B0071255E4E600B9CDD0 /* RenderSVGText.h */,
19129
				0854B0071255E4E600B9CDD0 /* RenderSVGText.h */,
19127
				0854B0081255E4E600B9CDD0 /* RenderSVGTextPath.cpp */,
19130
				0854B0081255E4E600B9CDD0 /* RenderSVGTextPath.cpp */,
19128
				0854B0091255E4E600B9CDD0 /* RenderSVGTextPath.h */,
19131
				0854B0091255E4E600B9CDD0 /* RenderSVGTextPath.h */,
19132
				436708B812C9CA4C00011434 /* RenderSVGTransformableContainer.cpp */,
19133
				436718BB12D9CA4B00042234 /* RenderSVGTransformableContainer.h */,
19129
				0854B00B1255E4E600B9CDD0 /* RenderSVGTSpan.h */,
19134
				0854B00B1255E4E600B9CDD0 /* RenderSVGTSpan.h */,
19130
				436708AB12D9CA4B00044234 /* RenderSVGViewportContainer.cpp */,
19135
				436708AB12D9CA4B00044234 /* RenderSVGViewportContainer.cpp */,
19131
				436708AC12D9CA4B00044234 /* RenderSVGViewportContainer.h */,
19136
				436708AC12D9CA4B00044234 /* RenderSVGViewportContainer.h */,
Lines 36976-36981 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
36976
				CDF747F7270F83B4107DEEEC /* RenderSVGShapeInlines.h in Headers */,
36981
				CDF747F7270F83B4107DEEEC /* RenderSVGShapeInlines.h in Headers */,
36977
				0854B0191255E4E600B9CDD0 /* RenderSVGText.h in Headers */,
36982
				0854B0191255E4E600B9CDD0 /* RenderSVGText.h in Headers */,
36978
				0854B01B1255E4E600B9CDD0 /* RenderSVGTextPath.h in Headers */,
36983
				0854B01B1255E4E600B9CDD0 /* RenderSVGTextPath.h in Headers */,
36984
				436707E724C9CA4B10044234 /* RenderSVGTransformableContainer.h in Headers */,
36979
				0854B01D1255E4E600B9CDD0 /* RenderSVGTSpan.h in Headers */,
36985
				0854B01D1255E4E600B9CDD0 /* RenderSVGTSpan.h in Headers */,
36980
				436708EB12D9CA4B00044234 /* RenderSVGViewportContainer.h in Headers */,
36986
				436708EB12D9CA4B00044234 /* RenderSVGViewportContainer.h in Headers */,
36981
				A8DF4AEB0980C42C0052981B /* RenderTable.h in Headers */,
36987
				A8DF4AEB0980C42C0052981B /* RenderTable.h in Headers */,
- a/Source/WebCore/rendering/RenderObject.h +1 lines
Lines 330-335 public: a/Source/WebCore/rendering/RenderObject.h_sec1
330
    virtual bool isSVGRoot() const { return false; }
330
    virtual bool isSVGRoot() const { return false; }
331
    virtual bool isSVGContainer() const { return false; }
331
    virtual bool isSVGContainer() const { return false; }
332
    virtual bool isLegacySVGContainer() const { return false; }
332
    virtual bool isLegacySVGContainer() const { return false; }
333
    virtual bool isSVGTransformableContainer() const { return false; }
333
    virtual bool isLegacySVGTransformableContainer() const { return false; }
334
    virtual bool isLegacySVGTransformableContainer() const { return false; }
334
    virtual bool isSVGViewportContainer() const { return false; }
335
    virtual bool isSVGViewportContainer() const { return false; }
335
    virtual bool isSVGGradientStop() const { return false; }
336
    virtual bool isSVGGradientStop() const { return false; }
- a/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.cpp +122 lines
Line 0 a/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.cpp_sec1
1
/*
2
 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
3
 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
4
 * Copyright (C) 2009 Google, Inc.
5
 *
6
 * This library is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU Library General Public
8
 * License as published by the Free Software Foundation; either
9
 * version 2 of the License, or (at your option) any later version.
10
 *
11
 * This library is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 * Library General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Library General Public License
17
 * along with this library; see the file COPYING.LIB.  If not, write to
18
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19
 * Boston, MA 02110-1301, USA.
20
 */
21
22
#include "config.h"
23
#include "RenderSVGTransformableContainer.h"
24
25
#include "RenderSVGModelObjectInlines.h"
26
#include "SVGContainerLayout.h"
27
#include "SVGElementTypeHelpers.h"
28
#include "SVGGElement.h"
29
#include "SVGGraphicsElement.h"
30
#include "SVGPathData.h"
31
#include "SVGUseElement.h"
32
#include <wtf/IsoMallocInlines.h>
33
34
namespace WebCore {
35
36
WTF_MAKE_ISO_ALLOCATED_IMPL(RenderSVGTransformableContainer);
37
38
RenderSVGTransformableContainer::RenderSVGTransformableContainer(SVGGraphicsElement& element, RenderStyle&& style)
39
    : RenderSVGContainer(element, WTFMove(style))
40
{
41
}
42
43
inline SVGUseElement* associatedUseElement(SVGGraphicsElement& element)
44
{
45
    // If we're either the renderer for a <use> element, or for any <g> element inside the shadow
46
    // tree, that was created during the use/symbol/svg expansion in SVGUseElement. These containers
47
    // need to respect the translations induced by their corresponding use elements x/y attributes.
48
    if (is<SVGUseElement>(element))
49
        return &downcast<SVGUseElement>(element);
50
51
    if (element.isInShadowTree() && is<SVGGElement>(element)) {
52
        SVGElement* correspondingElement = element.correspondingElement();
53
        if (is<SVGUseElement>(correspondingElement))
54
            return downcast<SVGUseElement>(correspondingElement);
55
    }
56
57
    return nullptr;
58
}
59
60
FloatPoint RenderSVGTransformableContainer::extraContainerTranslation() const
61
{
62
    if (auto* useElement = associatedUseElement(graphicsElement())) {
63
        // FIXME: [LBSE] Upstream SVGLengthContext changes
64
        // const auto& lengthContext = useElement->lengthContext();
65
        SVGLengthContext lengthContext(useElement);
66
        return { useElement->x().value(lengthContext), useElement->y().value(lengthContext) };
67
    }
68
69
    return { };
70
}
71
72
void RenderSVGTransformableContainer::calculateViewport()
73
{
74
    RenderSVGContainer::calculateViewport();
75
76
    // FIXME: [LBSE] Upstream SVGLengthContext changes
77
    // if (auto* useElement = associatedUseElement(graphicsElement()))
78
    //    useElement->updateLengthContext();
79
80
    m_supplementalLocalToParentTransform.makeIdentity();
81
82
    auto translation = extraContainerTranslation();
83
    m_supplementalLocalToParentTransform.translate(translation.x(), translation.y());
84
85
    m_didTransformToRootUpdate = m_hadTransformUpdate || SVGContainerLayout::transformToRootChanged(parent());
86
}
87
88
void RenderSVGTransformableContainer::layoutChildren()
89
{
90
    RenderSVGContainer::layoutChildren();
91
    m_didTransformToRootUpdate = false;
92
}
93
94
void RenderSVGTransformableContainer::updateFromStyle()
95
{
96
    RenderSVGContainer::updateFromStyle();
97
98
    // FIXME: [LBSE] Upstream CSS/SVG transform support
99
    // if (associatedUseElement(graphicsElement()))
100
    //    setHasSVGTransform();
101
}
102
103
void RenderSVGTransformableContainer::applyTransform(TransformationMatrix& transform, const FloatRect& boundingBox, OptionSet<RenderStyle::TransformOperationOption> options) const
104
{
105
    // FIXME: [LBSE] Upstream CSS/SVG transform support
106
    RenderSVGContainer::applyTransform(transform, boundingBox, options);
107
}
108
109
void RenderSVGTransformableContainer::styleWillChange(StyleDifference diff, const RenderStyle& newStyle)
110
{
111
    const RenderStyle* oldStyle = hasInitializedStyle() ? &style() : nullptr;
112
    if (oldStyle && oldStyle->transform() != newStyle.transform())
113
        setHadTransformUpdate();
114
    RenderSVGContainer::styleWillChange(diff, newStyle);
115
}
116
117
SVGGraphicsElement& RenderSVGTransformableContainer::graphicsElement() const
118
{
119
    return downcast<SVGGraphicsElement>(RenderSVGContainer::element());
120
}
121
122
}
- a/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.h +57 lines
Line 0 a/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.h_sec1
1
/*
2
 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
3
 * Copyright (C) 2009 Google, Inc.
4
 *
5
 * This library is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU Library General Public
7
 * License as published by the Free Software Foundation; either
8
 * version 2 of the License, or (at your option) any later version.
9
 *
10
 * This library is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 * Library General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU Library General Public License
16
 * along with this library; see the file COPYING.LIB.  If not, write to
17
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
 * Boston, MA 02110-1301, USA.
19
 */
20
21
#pragma once
22
23
#include "RenderSVGContainer.h"
24
25
namespace WebCore {
26
27
class SVGGraphicsElement;
28
29
class RenderSVGTransformableContainer final : public RenderSVGContainer {
30
    WTF_MAKE_ISO_ALLOCATED(RenderSVGTransformableContainer);
31
public:
32
    RenderSVGTransformableContainer(SVGGraphicsElement&, RenderStyle&&);
33
34
    bool isSVGTransformableContainer() const override { return true; }
35
    void setHadTransformUpdate(bool value = true) { m_hadTransformUpdate = value; }
36
    bool didTransformToRootUpdate() const { return m_didTransformToRootUpdate; }
37
38
private:
39
    SVGGraphicsElement& graphicsElement() const;
40
41
    void element() const = delete;
42
43
    void layoutChildren() final;
44
    void calculateViewport() final;
45
    FloatPoint extraContainerTranslation() const;
46
    void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, OptionSet<RenderStyle::TransformOperationOption> = RenderStyle::allTransformOperations) const final;
47
    void styleWillChange(StyleDifference, const RenderStyle& newStyle) override;
48
49
    void updateFromStyle() final;
50
    AffineTransform m_supplementalLocalToParentTransform;
51
    bool m_didTransformToRootUpdate { false };
52
    bool m_hadTransformUpdate { false };
53
};
54
55
} // namespace WebCore
56
57
SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderSVGTransformableContainer, isSVGTransformableContainer())
- a/Source/WebCore/rendering/svg/SVGContainerLayout.cpp -4 / +4 lines
Lines 39-44 a/Source/WebCore/rendering/svg/SVGContainerLayout.cpp_sec1
39
#include "RenderSVGRoot.h"
39
#include "RenderSVGRoot.h"
40
#include "RenderSVGShape.h"
40
#include "RenderSVGShape.h"
41
#include "RenderSVGText.h"
41
#include "RenderSVGText.h"
42
#include "RenderSVGTransformableContainer.h"
42
#include "RenderSVGViewportContainer.h"
43
#include "RenderSVGViewportContainer.h"
43
#include "SVGRenderSupport.h"
44
#include "SVGRenderSupport.h"
44
#include "SVGRenderingContext.h"
45
#include "SVGRenderingContext.h"
Lines 271-281 bool SVGContainerLayout::layoutSizeOfNearestViewportChanged() const a/Source/WebCore/rendering/svg/SVGContainerLayout.cpp_sec2
271
bool SVGContainerLayout::transformToRootChanged(const RenderObject* ancestor)
272
bool SVGContainerLayout::transformToRootChanged(const RenderObject* ancestor)
272
{
273
{
273
    while (ancestor) {
274
    while (ancestor) {
274
        // FIXME: [LBSE] Upstream RenderSVGTransformableContainer changes
275
        if (is<RenderSVGTransformableContainer>(*ancestor))
275
        // if (is<RenderSVGTransformableContainer>(*ancestor))
276
            return downcast<const RenderSVGTransformableContainer>(*ancestor).didTransformToRootUpdate();
276
        //     return downcast<const RenderSVGTransformableContainer>(*ancestor).didTransformToRootUpdate();
277
277
278
        // FIXME: [LBSE] Upstream RenderSVGTransformableContainer changes
278
        // FIXME: [LBSE] Upstream RenderSVGViewportContainer changes
279
        // if (is<RenderSVGViewportContainer>(*ancestor))
279
        // if (is<RenderSVGViewportContainer>(*ancestor))
280
        //     return downcast<const RenderSVGViewportContainer>(*ancestor).didTransformToRootUpdate();
280
        //     return downcast<const RenderSVGViewportContainer>(*ancestor).didTransformToRootUpdate();
281
281
- a/Source/WebCore/svg/SVGElement.cpp -1 / +1 lines
Lines 531-537 static MemoryCompactLookupOnlyRobinHoodHashSet<AtomString> createSVGLayerAwareEl a/Source/WebCore/svg/SVGElement.cpp_sec1
531
    // List of all SVG elements whose renderers support the layer aware layout / painting / hit-testing mode ('LBSE-mode').
531
    // List of all SVG elements whose renderers support the layer aware layout / painting / hit-testing mode ('LBSE-mode').
532
    using namespace SVGNames;
532
    using namespace SVGNames;
533
    MemoryCompactLookupOnlyRobinHoodHashSet<AtomString> set;
533
    MemoryCompactLookupOnlyRobinHoodHashSet<AtomString> set;
534
    for (auto& tag : { rectTag.get() })
534
    for (auto& tag : { gTag.get(), rectTag.get() })
535
        set.add(tag.localName());
535
        set.add(tag.localName());
536
    return set;
536
    return set;
537
}
537
}
- a/Source/WebCore/svg/SVGGElement.cpp +7 lines
Lines 25-30 a/Source/WebCore/svg/SVGGElement.cpp_sec1
25
#include "LegacyRenderSVGTransformableContainer.h"
25
#include "LegacyRenderSVGTransformableContainer.h"
26
#include "RenderSVGHiddenContainer.h"
26
#include "RenderSVGHiddenContainer.h"
27
#include "RenderSVGResource.h"
27
#include "RenderSVGResource.h"
28
#include "RenderSVGTransformableContainer.h"
28
#include "SVGNames.h"
29
#include "SVGNames.h"
29
#include <wtf/IsoMallocInlines.h>
30
#include <wtf/IsoMallocInlines.h>
30
#include <wtf/NeverDestroyed.h>
31
#include <wtf/NeverDestroyed.h>
Lines 51-56 Ref<SVGGElement> SVGGElement::create(Document& document) a/Source/WebCore/svg/SVGGElement.cpp_sec2
51
52
52
RenderPtr<RenderElement> SVGGElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
53
RenderPtr<RenderElement> SVGGElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
53
{
54
{
55
#if ENABLE(LAYER_BASED_SVG_ENGINE)
56
    // FIXME: [LBSE] Support hidden containers
57
    if (document().settings().layerBasedSVGEngineEnabled())
58
        return createRenderer<RenderSVGTransformableContainer>(*this, WTFMove(style));
59
#endif
60
54
    // SVG 1.1 testsuite explicitly uses constructs like <g display="none"><linearGradient>
61
    // SVG 1.1 testsuite explicitly uses constructs like <g display="none"><linearGradient>
55
    // We still have to create renderers for the <g> & <linearGradient> element, though the
62
    // We still have to create renderers for the <g> & <linearGradient> element, though the
56
    // subtree may be hidden - we only want the resource renderers to exist so they can be
63
    // subtree may be hidden - we only want the resource renderers to exist so they can be

Return to Bug 237024