| Differences between
and this patch
- a/Source/WebCore/ChangeLog +38 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2022-03-04  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::additionalContainerTranslation 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: Ditto.
37
        (WebCore::SVGGElement::createElementRenderer):
38
1
2022-03-04  Kimmo Kinnunen  <kkinnunen@apple.com>
39
2022-03-04  Kimmo Kinnunen  <kkinnunen@apple.com>
2
40
3
        Iteration to search for least active WebGLRenderingContextBase could use min_element
41
        Iteration to search for least active WebGLRenderingContextBase could use min_element
- 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 9096-9102 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
9096
		436708A512D9CA5C00044234 /* RenderSVGRoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGRoot.cpp; sourceTree = "<group>"; };
9097
		436708A512D9CA5C00044234 /* RenderSVGRoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGRoot.cpp; sourceTree = "<group>"; };
9097
		436708A612D9CA4B00044234 /* LegacyRenderSVGRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyRenderSVGRoot.h; sourceTree = "<group>"; };
9098
		436708A612D9CA4B00044234 /* LegacyRenderSVGRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyRenderSVGRoot.h; sourceTree = "<group>"; };
9098
		436708A612D9DB4B00044234 /* RenderSVGRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGRoot.h; sourceTree = "<group>"; };
9099
		436708A612D9DB4B00044234 /* RenderSVGRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGRoot.h; sourceTree = "<group>"; };
9100
		436708B812C9CA4C00011434 /* RenderSVGTransformableContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGTransformableContainer.cpp; sourceTree = "<group>"; };
9099
		436708A912D9CA4B00044234 /* LegacyRenderSVGTransformableContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyRenderSVGTransformableContainer.cpp; sourceTree = "<group>"; };
9101
		436708A912D9CA4B00044234 /* LegacyRenderSVGTransformableContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyRenderSVGTransformableContainer.cpp; sourceTree = "<group>"; };
9102
		436718BB12D9CA4B00042234 /* RenderSVGTransformableContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGTransformableContainer.h; sourceTree = "<group>"; };
9100
		436708AA12D9CA4B00044234 /* LegacyRenderSVGTransformableContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyRenderSVGTransformableContainer.h; sourceTree = "<group>"; };
9103
		436708AA12D9CA4B00044234 /* LegacyRenderSVGTransformableContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyRenderSVGTransformableContainer.h; sourceTree = "<group>"; };
9101
		436708AB12D9CA4B00044234 /* RenderSVGViewportContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGViewportContainer.cpp; sourceTree = "<group>"; };
9104
		436708AB12D9CA4B00044234 /* RenderSVGViewportContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGViewportContainer.cpp; sourceTree = "<group>"; };
9102
		436708AC12D9CA4B00044234 /* RenderSVGViewportContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGViewportContainer.h; sourceTree = "<group>"; };
9105
		436708AC12D9CA4B00044234 /* RenderSVGViewportContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGViewportContainer.h; sourceTree = "<group>"; };
Lines 19150-19155 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
19150
				0854B0071255E4E600B9CDD0 /* RenderSVGText.h */,
19153
				0854B0071255E4E600B9CDD0 /* RenderSVGText.h */,
19151
				0854B0081255E4E600B9CDD0 /* RenderSVGTextPath.cpp */,
19154
				0854B0081255E4E600B9CDD0 /* RenderSVGTextPath.cpp */,
19152
				0854B0091255E4E600B9CDD0 /* RenderSVGTextPath.h */,
19155
				0854B0091255E4E600B9CDD0 /* RenderSVGTextPath.h */,
19156
				436708B812C9CA4C00011434 /* RenderSVGTransformableContainer.cpp */,
19157
				436718BB12D9CA4B00042234 /* RenderSVGTransformableContainer.h */,
19153
				0854B00B1255E4E600B9CDD0 /* RenderSVGTSpan.h */,
19158
				0854B00B1255E4E600B9CDD0 /* RenderSVGTSpan.h */,
19154
				436708AB12D9CA4B00044234 /* RenderSVGViewportContainer.cpp */,
19159
				436708AB12D9CA4B00044234 /* RenderSVGViewportContainer.cpp */,
19155
				436708AC12D9CA4B00044234 /* RenderSVGViewportContainer.h */,
19160
				436708AC12D9CA4B00044234 /* RenderSVGViewportContainer.h */,
Lines 37009-37014 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
37009
				CDF747F7270F83B4107DEEEC /* RenderSVGShapeInlines.h in Headers */,
37014
				CDF747F7270F83B4107DEEEC /* RenderSVGShapeInlines.h in Headers */,
37010
				0854B0191255E4E600B9CDD0 /* RenderSVGText.h in Headers */,
37015
				0854B0191255E4E600B9CDD0 /* RenderSVGText.h in Headers */,
37011
				0854B01B1255E4E600B9CDD0 /* RenderSVGTextPath.h in Headers */,
37016
				0854B01B1255E4E600B9CDD0 /* RenderSVGTextPath.h in Headers */,
37017
				436707E724C9CA4B10044234 /* RenderSVGTransformableContainer.h in Headers */,
37012
				0854B01D1255E4E600B9CDD0 /* RenderSVGTSpan.h in Headers */,
37018
				0854B01D1255E4E600B9CDD0 /* RenderSVGTSpan.h in Headers */,
37013
				436708EB12D9CA4B00044234 /* RenderSVGViewportContainer.h in Headers */,
37019
				436708EB12D9CA4B00044234 /* RenderSVGViewportContainer.h in Headers */,
37014
				A8DF4AEB0980C42C0052981B /* RenderTable.h in Headers */,
37020
				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 +126 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
 * Copyright (c) 2020, 2021, 2022 Igalia S.L.
6
 *
7
 * This library is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU Library General Public
9
 * License as published by the Free Software Foundation; either
10
 * version 2 of the License, or (at your option) any later version.
11
 *
12
 * This library is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 * Library General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Library General Public License
18
 * along with this library; see the file COPYING.LIB.  If not, write to
19
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20
 * Boston, MA 02110-1301, USA.
21
 */
22
23
#include "config.h"
24
#include "RenderSVGTransformableContainer.h"
25
26
#if ENABLE(LAYER_BASED_SVG_ENGINE)
27
#include "RenderSVGModelObjectInlines.h"
28
#include "SVGContainerLayout.h"
29
#include "SVGElementTypeHelpers.h"
30
#include "SVGGElement.h"
31
#include "SVGGraphicsElement.h"
32
#include "SVGPathData.h"
33
#include "SVGUseElement.h"
34
#include <wtf/IsoMallocInlines.h>
35
36
namespace WebCore {
37
38
WTF_MAKE_ISO_ALLOCATED_IMPL(RenderSVGTransformableContainer);
39
40
RenderSVGTransformableContainer::RenderSVGTransformableContainer(SVGGraphicsElement& element, RenderStyle&& style)
41
    : RenderSVGContainer(element, WTFMove(style))
42
{
43
}
44
45
inline SVGUseElement* associatedUseElement(SVGGraphicsElement& element)
46
{
47
    // If we're either the renderer for a <use> element, or for any <g> element inside the shadow
48
    // tree, that was created during the use/symbol/svg expansion in SVGUseElement. These containers
49
    // need to respect the translations induced by their corresponding use elements x/y attributes.
50
    if (is<SVGUseElement>(element))
51
        return &downcast<SVGUseElement>(element);
52
53
    if (element.isInShadowTree() && is<SVGGElement>(element)) {
54
        SVGElement* correspondingElement = element.correspondingElement();
55
        if (is<SVGUseElement>(correspondingElement))
56
            return downcast<SVGUseElement>(correspondingElement);
57
    }
58
59
    return nullptr;
60
}
61
62
FloatPoint RenderSVGTransformableContainer::additionalContainerTranslation() const
63
{
64
    if (auto* useElement = associatedUseElement(graphicsElement())) {
65
        // FIXME: [LBSE] Upstream SVGLengthContext changes
66
        // const auto& lengthContext = useElement->lengthContext();
67
        SVGLengthContext lengthContext(useElement);
68
        return { useElement->x().value(lengthContext), useElement->y().value(lengthContext) };
69
    }
70
71
    return { };
72
}
73
74
void RenderSVGTransformableContainer::calculateViewport()
75
{
76
    RenderSVGContainer::calculateViewport();
77
78
    // FIXME: [LBSE] Upstream SVGLengthContext changes
79
    // if (auto* useElement = associatedUseElement(graphicsElement()))
80
    //    useElement->updateLengthContext();
81
82
    m_supplementalLocalToParentTransform.makeIdentity();
83
84
    auto translation = additionalContainerTranslation();
85
    m_supplementalLocalToParentTransform.translate(translation.x(), translation.y());
86
87
    m_didTransformToRootUpdate = m_hadTransformUpdate || SVGContainerLayout::transformToRootChanged(parent());
88
}
89
90
void RenderSVGTransformableContainer::layoutChildren()
91
{
92
    RenderSVGContainer::layoutChildren();
93
    m_didTransformToRootUpdate = false;
94
}
95
96
void RenderSVGTransformableContainer::updateFromStyle()
97
{
98
    RenderSVGContainer::updateFromStyle();
99
100
    // FIXME: [LBSE] Upstream CSS/SVG transform support
101
    // if (associatedUseElement(graphicsElement()))
102
    //    setHasSVGTransform();
103
}
104
105
void RenderSVGTransformableContainer::applyTransform(TransformationMatrix& transform, const FloatRect& boundingBox, OptionSet<RenderStyle::TransformOperationOption> options) const
106
{
107
    // FIXME: [LBSE] Upstream CSS/SVG transform support
108
    RenderSVGContainer::applyTransform(transform, boundingBox, options);
109
}
110
111
void RenderSVGTransformableContainer::styleWillChange(StyleDifference diff, const RenderStyle& newStyle)
112
{
113
    const RenderStyle* oldStyle = hasInitializedStyle() ? &style() : nullptr;
114
    if (oldStyle && oldStyle->transform() != newStyle.transform())
115
        setHadTransformUpdate();
116
    RenderSVGContainer::styleWillChange(diff, newStyle);
117
}
118
119
SVGGraphicsElement& RenderSVGTransformableContainer::graphicsElement() const
120
{
121
    return downcast<SVGGraphicsElement>(RenderSVGContainer::element());
122
}
123
124
}
125
126
#endif // ENABLE(LAYER_BASED_SVG_ENGINE)
- a/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.h +61 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
 * Copyright (c) 2020, 2021, 2022 Igalia S.L.
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
#pragma once
23
24
#if ENABLE(LAYER_BASED_SVG_ENGINE)
25
#include "RenderSVGContainer.h"
26
27
namespace WebCore {
28
29
class SVGGraphicsElement;
30
31
class RenderSVGTransformableContainer final : public RenderSVGContainer {
32
    WTF_MAKE_ISO_ALLOCATED(RenderSVGTransformableContainer);
33
public:
34
    RenderSVGTransformableContainer(SVGGraphicsElement&, RenderStyle&&);
35
36
    bool isSVGTransformableContainer() const final { return true; }
37
    void setHadTransformUpdate(bool value = true) { m_hadTransformUpdate = value; }
38
    bool didTransformToRootUpdate() const { return m_didTransformToRootUpdate; }
39
40
private:
41
    SVGGraphicsElement& graphicsElement() const;
42
43
    void element() const = delete;
44
45
    void layoutChildren() final;
46
    void calculateViewport() final;
47
    FloatPoint additionalContainerTranslation() const;
48
    void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, OptionSet<RenderStyle::TransformOperationOption> = RenderStyle::allTransformOperations) const final;
49
    void styleWillChange(StyleDifference, const RenderStyle& newStyle) final;
50
    void updateFromStyle() final;
51
52
    AffineTransform m_supplementalLocalToParentTransform;
53
    bool m_didTransformToRootUpdate { false };
54
    bool m_hadTransformUpdate { false };
55
};
56
57
} // namespace WebCore
58
59
SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderSVGTransformableContainer, isSVGTransformableContainer())
60
61
#endif // ENABLE(LAYER_BASED_SVG_ENGINE)
- 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