Skip to content

Commit

Permalink
Remove ENABLE_LAYER_BASED_SVG_ENGINE build flag
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=271738

Reviewed by Michael Catanzaro and Said Abou-Hallawa.

All ports are building with `ENABLE_LAYER_BASED_SVG_ENGINE` as `ON`. Remove the
build option and use the runtime option for controlling use.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WTF/wtf/PlatformEnable.h:
* Source/WTF/wtf/PlatformEnableCocoa.h:
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
* Source/WebCore/dom/Element.cpp:
* Source/WebCore/loader/ImageLoader.cpp:
* Source/WebCore/loader/cache/CachedImage.cpp:
* Source/WebCore/page/LocalFrameView.cpp:
* Source/WebCore/page/SettingsBase.cpp:
* Source/WebCore/page/SettingsBase.h:
* Source/WebCore/rendering/ReferencedSVGResources.cpp:
* Source/WebCore/rendering/ReferencedSVGResources.h:
* Source/WebCore/rendering/RenderBox.cpp:
* Source/WebCore/rendering/RenderElement.cpp:
* Source/WebCore/rendering/RenderElement.h:
* Source/WebCore/rendering/RenderLayer.cpp:
* Source/WebCore/rendering/RenderLayer.h:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
* Source/WebCore/rendering/RenderLayerInlines.h:
* Source/WebCore/rendering/RenderLayerModelObject.cpp:
* Source/WebCore/rendering/RenderLayerModelObject.h:
* Source/WebCore/rendering/RenderObject.cpp:
* Source/WebCore/rendering/RenderObject.h:
* Source/WebCore/rendering/RenderTreeAsText.cpp:
* Source/WebCore/rendering/RenderView.cpp:
* Source/WebCore/rendering/TransformOperationData.cpp:
* Source/WebCore/rendering/svg/RenderSVGBlock.cpp:
* Source/WebCore/rendering/svg/RenderSVGBlock.h:
* Source/WebCore/rendering/svg/RenderSVGContainer.cpp:
* Source/WebCore/rendering/svg/RenderSVGContainer.h:
* Source/WebCore/rendering/svg/RenderSVGEllipse.cpp:
* Source/WebCore/rendering/svg/RenderSVGEllipse.h:
* Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp:
* Source/WebCore/rendering/svg/RenderSVGForeignObject.h:
* Source/WebCore/rendering/svg/RenderSVGGradientStop.cpp:
* Source/WebCore/rendering/svg/RenderSVGHiddenContainer.cpp:
* Source/WebCore/rendering/svg/RenderSVGHiddenContainer.h:
* Source/WebCore/rendering/svg/RenderSVGImage.cpp:
* Source/WebCore/rendering/svg/RenderSVGImage.h:
* Source/WebCore/rendering/svg/RenderSVGInline.cpp:
* Source/WebCore/rendering/svg/RenderSVGInline.h:
* Source/WebCore/rendering/svg/RenderSVGInlineText.cpp:
* Source/WebCore/rendering/svg/RenderSVGModelObject.cpp:
* Source/WebCore/rendering/svg/RenderSVGModelObject.h:
* Source/WebCore/rendering/svg/RenderSVGPath.cpp:
* Source/WebCore/rendering/svg/RenderSVGPath.h:
* Source/WebCore/rendering/svg/RenderSVGRect.cpp:
* Source/WebCore/rendering/svg/RenderSVGRect.h:
* Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp:
* Source/WebCore/rendering/svg/RenderSVGResourceClipper.h:
* Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp:
* Source/WebCore/rendering/svg/RenderSVGResourceContainer.h:
* Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp:
* Source/WebCore/rendering/svg/RenderSVGResourceGradient.h:
* Source/WebCore/rendering/svg/RenderSVGResourceGradientInlines.h:
* Source/WebCore/rendering/svg/RenderSVGResourceLinearGradient.cpp:
* Source/WebCore/rendering/svg/RenderSVGResourceLinearGradient.h:
* Source/WebCore/rendering/svg/RenderSVGResourceLinearGradientInlines.h:
* Source/WebCore/rendering/svg/RenderSVGResourceMarker.cpp:
* Source/WebCore/rendering/svg/RenderSVGResourceMarker.h:
* Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp:
* Source/WebCore/rendering/svg/RenderSVGResourceMasker.h:
* Source/WebCore/rendering/svg/RenderSVGResourcePaintServer.cpp:
* Source/WebCore/rendering/svg/RenderSVGResourcePaintServer.h:
* Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp:
* Source/WebCore/rendering/svg/RenderSVGResourcePattern.h:
* Source/WebCore/rendering/svg/RenderSVGResourcePatternInlines.h:
* Source/WebCore/rendering/svg/RenderSVGResourceRadialGradient.cpp:
* Source/WebCore/rendering/svg/RenderSVGResourceRadialGradient.h:
* Source/WebCore/rendering/svg/RenderSVGResourceRadialGradientInlines.h:
* Source/WebCore/rendering/svg/RenderSVGRoot.cpp:
* Source/WebCore/rendering/svg/RenderSVGRoot.h:
* Source/WebCore/rendering/svg/RenderSVGShape.cpp:
* Source/WebCore/rendering/svg/RenderSVGShape.h:
* Source/WebCore/rendering/svg/RenderSVGShapeInlines.h:
* Source/WebCore/rendering/svg/RenderSVGText.cpp:
* Source/WebCore/rendering/svg/RenderSVGText.h:
* Source/WebCore/rendering/svg/RenderSVGTextPath.cpp:
* Source/WebCore/rendering/svg/RenderSVGTransformableContainer.cpp:
* Source/WebCore/rendering/svg/RenderSVGTransformableContainer.h:
* Source/WebCore/rendering/svg/RenderSVGViewportContainer.cpp:
* Source/WebCore/rendering/svg/RenderSVGViewportContainer.h:
* Source/WebCore/rendering/svg/SVGBoundingBoxComputation.cpp:
* Source/WebCore/rendering/svg/SVGBoundingBoxComputation.h:
* Source/WebCore/rendering/svg/SVGContainerLayout.cpp:
* Source/WebCore/rendering/svg/SVGContainerLayout.h:
* Source/WebCore/rendering/svg/SVGInlineTextBox.cpp:
* Source/WebCore/rendering/svg/SVGInlineTextBox.h:
* Source/WebCore/rendering/svg/SVGLayerTransformComputation.h:
* Source/WebCore/rendering/svg/SVGLayerTransformUpdater.h:
* Source/WebCore/rendering/svg/SVGPaintServerHandling.h:
* Source/WebCore/rendering/svg/SVGRenderSupport.cpp:
* Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp:
* Source/WebCore/rendering/svg/SVGRenderingContext.cpp:
* Source/WebCore/rendering/svg/SVGResourcesCache.cpp:
* Source/WebCore/rendering/svg/SVGResourcesCycleSolver.cpp:
* Source/WebCore/rendering/svg/SVGRootInlineBox.cpp:
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGForeignObject.cpp:
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGForeignObject.h:
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResource.cpp:
* Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:
* Source/WebCore/rendering/updating/RenderTreeBuilderSVG.cpp:
* Source/WebCore/rendering/updating/RenderTreeBuilderSVG.h:
* Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:
* Source/WebCore/style/StyleAdjuster.cpp:
* Source/WebCore/svg/SVGAElement.cpp:
* Source/WebCore/svg/SVGAnimateMotionElement.cpp:
* Source/WebCore/svg/SVGCircleElement.cpp:
* Source/WebCore/svg/SVGClipPathElement.cpp:
* Source/WebCore/svg/SVGDefsElement.cpp:
* Source/WebCore/svg/SVGElement.cpp:
* Source/WebCore/svg/SVGEllipseElement.cpp:
* Source/WebCore/svg/SVGFEImageElement.cpp:
* Source/WebCore/svg/SVGForeignObjectElement.cpp:
* Source/WebCore/svg/SVGGElement.cpp:
* Source/WebCore/svg/SVGGeometryElement.cpp:
* Source/WebCore/svg/SVGGradientElement.cpp:
* Source/WebCore/svg/SVGGraphicsElement.cpp:
* Source/WebCore/svg/SVGImageElement.cpp:
* Source/WebCore/svg/SVGLineElement.cpp:
* Source/WebCore/svg/SVGLinearGradientElement.cpp:
* Source/WebCore/svg/SVGLocatable.cpp:
* Source/WebCore/svg/SVGMarkerElement.cpp:
* Source/WebCore/svg/SVGMaskElement.cpp:
* Source/WebCore/svg/SVGPathElement.cpp:
* Source/WebCore/svg/SVGPatternElement.cpp:
* Source/WebCore/svg/SVGPolyElement.cpp:
* Source/WebCore/svg/SVGRadialGradientElement.cpp:
* Source/WebCore/svg/SVGRectElement.cpp:
* Source/WebCore/svg/SVGSVGElement.cpp:
* Source/WebCore/svg/SVGSwitchElement.cpp:
* Source/WebCore/svg/SVGSymbolElement.cpp:
* Source/WebCore/svg/SVGUseElement.cpp:
* Source/WebCore/svg/graphics/SVGImage.cpp:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsMac.cmake:
* Source/cmake/OptionsPlayStation.cmake:
* Source/cmake/OptionsWPE.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Tools/Scripts/webkitperl/FeatureList.pm:

Canonical link: https://commits.webkit.org/276817@main
  • Loading branch information
donny-dont committed Mar 29, 2024
1 parent 780bd12 commit 9d4b244
Show file tree
Hide file tree
Showing 141 changed files with 18 additions and 719 deletions.
1 change: 0 additions & 1 deletion Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3547,7 +3547,6 @@ LayerBasedSVGEngineEnabled:
status: unstable
humanReadableName: "Layer-based SVG Engine (LBSE)"
humanReadableDescription: "Enable next-generation layer-based SVG Engine (LBSE)"
condition: ENABLE(LAYER_BASED_SVG_ENGINE)
webcoreOnChange: layerBasedSVGEngineEnabledChanged
defaultValue:
WebCore:
Expand Down
4 changes: 0 additions & 4 deletions Source/WTF/wtf/PlatformEnable.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,6 @@
#define ENABLE_KINETIC_SCROLLING 0
#endif

#if !defined(ENABLE_LAYER_BASED_SVG_ENGINE)
#define ENABLE_LAYER_BASED_SVG_ENGINE 0
#endif

#if !defined(ENABLE_LLVM_PROFILE_GENERATION)
#define ENABLE_LLVM_PROFILE_GENERATION 0
#endif
Expand Down
4 changes: 0 additions & 4 deletions Source/WTF/wtf/PlatformEnableCocoa.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,6 @@
#define ENABLE_LAUNCHD_BLOCKING_IN_WEBCONTENT 1
#endif

#if !defined(ENABLE_LAYER_BASED_SVG_ENGINE)
#define ENABLE_LAYER_BASED_SVG_ENGINE 1
#endif

#if !defined(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER)
#define ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER 1
#endif
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,6 @@ Path AccessibilityRenderObject::elementPath() const
return path;
}

#if ENABLE(LAYER_BASED_SVG_ENGINE)
if (auto* renderSVGShape = dynamicDowncast<RenderSVGShape>(*m_renderer); renderSVGShape && renderSVGShape->hasPath()) {
Path path = renderSVGShape->path();

Expand All @@ -970,7 +969,6 @@ Path AccessibilityRenderObject::elementPath() const
}
return path;
}
#endif

return { };
}
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/dom/Element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1669,10 +1669,8 @@ inline bool shouldObtainBoundsFromBoxModel(const Element* element)
if (is<RenderBoxModelObject>(element->renderer()))
return true;

#if ENABLE(LAYER_BASED_SVG_ENGINE)
if (is<RenderSVGModelObject>(element->renderer()))
return true;
#endif

return false;
}
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/loader/ImageLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,8 @@ RenderImageResource* ImageLoader::renderImageResource()
if (auto* svgImage = dynamicDowncast<LegacyRenderSVGImage>(*renderer))
return &svgImage->imageResource();

#if ENABLE(LAYER_BASED_SVG_ENGINE)
if (auto* svgImage = dynamicDowncast<RenderSVGImage>(*renderer))
return &svgImage->imageResource();
#endif

#if ENABLE(VIDEO)
if (auto* renderVideo = dynamicDowncast<RenderVideo>(*renderer))
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/loader/cache/CachedImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ CachedImage::~CachedImage()
void CachedImage::load(CachedResourceLoader& loader)
{
m_skippingRevalidationDocument = loader.document();
#if ENABLE(LAYER_BASED_SVG_ENGINE)
m_layerBasedSVGEngineEnabled = loader.document() ? loader.document()->settings().layerBasedSVGEngineEnabled() : false;
#endif

if (loader.shouldPerformImageLoad(url()))
CachedResource::load(loader);
Expand Down
6 changes: 0 additions & 6 deletions Source/WebCore/page/LocalFrameView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,6 @@ void LocalFrameView::applyOverflowToViewport(const RenderElement& renderer, Scro
Overflow overflowX = renderer.style().overflowX();
Overflow overflowY = renderer.style().overflowY();

#if ENABLE(LAYER_BASED_SVG_ENGINE)
if (CheckedPtr renderSVGRoot = dynamicDowncast<RenderSVGRoot>(renderer)) {
// FIXME: evaluate if we can allow overflow for these cases too.
// Overflow is always hidden when stand-alone SVG documents are embedded.
Expand All @@ -616,7 +615,6 @@ void LocalFrameView::applyOverflowToViewport(const RenderElement& renderer, Scro
overflowY = Overflow::Hidden;
}
}
#endif

if (CheckedPtr legacyRenderSVGRoot = dynamicDowncast<LegacyRenderSVGRoot>(renderer)) {
// FIXME: evaluate if we can allow overflow for these cases too.
Expand Down Expand Up @@ -1215,12 +1213,10 @@ void LocalFrameView::forceLayoutParentViewIfNeeded()
return;
}

#if ENABLE(LAYER_BASED_SVG_ENGINE)
if (auto* svgRoot = dynamicDowncast<RenderSVGRoot>(contentBox)) {
if (svgRoot->everHadLayout() && !svgRoot->needsLayout())
return;
}
#endif

LOG(Layout, "LocalFrameView %p forceLayoutParentViewIfNeeded scheduling layout on parent LocalFrameView %p", this, &ownerRenderer->view().frameView());

Expand Down Expand Up @@ -1353,10 +1349,8 @@ RenderBox* LocalFrameView::embeddedContentBox() const
if (auto* svgRoot = dynamicDowncast<LegacyRenderSVGRoot>(firstChild))
return svgRoot;

#if ENABLE(LAYER_BASED_SVG_ENGINE)
if (auto* svgRoot = dynamicDowncast<RenderSVGRoot>(firstChild))
return svgRoot;
#endif

return nullptr;
}
Expand Down
4 changes: 0 additions & 4 deletions Source/WebCore/page/SettingsBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,6 @@ void SettingsBase::mockCaptureDevicesEnabledChanged()

#endif

#if ENABLE(LAYER_BASED_SVG_ENGINE)

void SettingsBase::layerBasedSVGEngineEnabledChanged()
{
if (!m_page)
Expand All @@ -445,8 +443,6 @@ void SettingsBase::layerBasedSVGEngineEnabledChanged()
}
}

#endif

void SettingsBase::userStyleSheetLocationChanged()
{
if (m_page)
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/page/SettingsBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ class SettingsBase {
#if ENABLE(MEDIA_STREAM)
void mockCaptureDevicesEnabledChanged();
#endif
#if ENABLE(LAYER_BASED_SVG_ENGINE)
void layerBasedSVGEngineEnabledChanged();
#endif
#if HAVE(AVCONTENTKEYSPECIFIER)
void sampleBufferContentKeySessionSupportEnabledChanged();
#endif
Expand Down
9 changes: 0 additions & 9 deletions Source/WebCore/rendering/ReferencedSVGResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ void CSSSVGResourceElementClient::resourceChanged(SVGElement& element)
if (m_clientRenderer.renderTreeBeingDestroyed())
return;

#if ENABLE(LAYER_BASED_SVG_ENGINE)
if (!m_clientRenderer.document().settings().layerBasedSVGEngineEnabled()) {
m_clientRenderer.repaint();
return;
Expand All @@ -79,9 +78,6 @@ void CSSSVGResourceElementClient::resourceChanged(SVGElement& element)
pathClientRenderer->updateMarkerPositions();

m_clientRenderer.repaintOldAndNewPositionsForSVGRenderer();
#else
m_clientRenderer.repaint();
#endif
}

WTF_MAKE_ISO_ALLOCATED_IMPL(ReferencedSVGResources);
Expand Down Expand Up @@ -134,7 +130,6 @@ ReferencedSVGResources::SVGElementIdentifierAndTagPairs ReferencedSVGResources::
}
}

#if ENABLE(LAYER_BASED_SVG_ENGINE)
if (!document.settings().layerBasedSVGEngineEnabled())
return referencedResources;

Expand Down Expand Up @@ -182,7 +177,6 @@ ReferencedSVGResources::SVGElementIdentifierAndTagPairs ReferencedSVGResources::
if (!resourceID.isEmpty())
referencedResources.append({ resourceID, { SVGNames::linearGradientTag, SVGNames::radialGradientTag, SVGNames::patternTag } });
}
#endif

return referencedResources;
}
Expand Down Expand Up @@ -231,8 +225,6 @@ RefPtr<SVGElement> ReferencedSVGResources::elementForResourceIDs(TreeScope& tree
return nullptr;
}


#if ENABLE(LAYER_BASED_SVG_ENGINE)
RefPtr<SVGClipPathElement> ReferencedSVGResources::referencedClipPathElement(TreeScope& treeScope, const ReferencePathOperation& clipPath)
{
if (clipPath.fragment().isEmpty())
Expand Down Expand Up @@ -273,7 +265,6 @@ RefPtr<SVGElement> ReferencedSVGResources::referencedPaintServerElement(TreeScop

return elementForResourceIDs(treeScope, resourceID, { SVGNames::linearGradientTag, SVGNames::radialGradientTag, SVGNames::patternTag });
}
#endif

RefPtr<SVGFilterElement> ReferencedSVGResources::referencedFilterElement(TreeScope& treeScope, const ReferenceFilterOperation& referenceFilter)
{
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/rendering/ReferencedSVGResources.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,11 @@ class ReferencedSVGResources {

static LegacyRenderSVGResourceContainer* referencedRenderResource(TreeScope&, const AtomString& fragment);

#if ENABLE(LAYER_BASED_SVG_ENGINE)
// LBSE: All element based.
static RefPtr<SVGClipPathElement> referencedClipPathElement(TreeScope&, const ReferencePathOperation&);
static RefPtr<SVGMarkerElement> referencedMarkerElement(TreeScope&, const String&);
static RefPtr<SVGMaskElement> referencedMaskElement(TreeScope&, const StyleImage&);
static RefPtr<SVGElement> referencedPaintServerElement(TreeScope&, const String&);
#endif

private:
static RefPtr<SVGElement> elementForResourceID(TreeScope&, const AtomString& resourceID, const SVGQualifiedName& tagName);
Expand Down
4 changes: 0 additions & 4 deletions Source/WebCore/rendering/RenderBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1549,10 +1549,8 @@ bool RenderBox::hitTestClipPath(const HitTestLocation& hitTestLocation, const La
auto hitTestLocationInLocalCoordinates = hitTestLocation.point() - offsetFromHitTestRoot;

auto hitsClipContent = [&](Element& element) -> bool {
#if ENABLE(LAYER_BASED_SVG_ENGINE)
if (CheckedPtr clipper = dynamicDowncast<RenderSVGResourceClipper>(element.renderer()))
return clipper->hitTestClipContent( FloatRect { borderBoxRect() }, hitTestLocationInLocalCoordinates);
#endif
CheckedRef clipper = downcast<LegacyRenderSVGResourceClipper>(*element.renderer());
return clipper->hitTestClipContent( FloatRect { borderBoxRect() }, FloatPoint { hitTestLocationInLocalCoordinates });
};
Expand Down Expand Up @@ -1959,12 +1957,10 @@ void RenderBox::paintClippingMask(PaintInfo& paintInfo, const LayoutPoint& paint

LayoutRect paintRect = LayoutRect(paintOffset, size());

#if ENABLE(LAYER_BASED_SVG_ENGINE)
if (document().settings().layerBasedSVGEngineEnabled() && style().clipPath() && style().clipPath()->type() == PathOperation::Reference) {
paintSVGClippingMask(paintInfo, paintRect);
return;
}
#endif

paintInfo.context().fillRect(snappedIntRect(paintRect), Color::black);
}
Expand Down
12 changes: 0 additions & 12 deletions Source/WebCore/rendering/RenderElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,6 @@ RenderLayer* RenderElement::layerNextSibling(RenderLayer& parentLayer) const

bool RenderElement::layerCreationAllowedForSubtree() const
{
#if ENABLE(LAYER_BASED_SVG_ENGINE)
// In LBSE layers are always created regardless of there position in the render tree.
// Consider the SVG document fragment: "<defs><mask><rect transform="scale(2)".../>"
// To paint the <rect> into the mask image, the rect needs to be transformed -
Expand All @@ -771,7 +770,6 @@ bool RenderElement::layerCreationAllowedForSubtree() const
// elements (such as LegacyRenderSVGResourceClipper, RenderSVGResourceMasker, etc.)
if (document().settings().layerBasedSVGEngineEnabled())
return true;
#endif

RenderElement* parentRenderer = parent();
while (parentRenderer) {
Expand Down Expand Up @@ -997,10 +995,8 @@ void RenderElement::styleDidChange(StyleDifference diff, const RenderStyle* oldS

if (diff >= StyleDifference::Repaint) {
updateReferencedSVGResources();
#if ENABLE(LAYER_BASED_SVG_ENGINE)
if (oldStyle && diff <= StyleDifference::RepaintLayer)
repaintClientsOfReferencedSVGResources();
#endif
}

if (!m_parent)
Expand Down Expand Up @@ -1529,10 +1525,8 @@ bool RenderElement::isVisibleInDocumentRect(const IntRect& documentRect) const

bool RenderElement::isInsideEntirelyHiddenLayer() const
{
#if ENABLE(LAYER_BASED_SVG_ENGINE)
if (isSVGLayerAwareRenderer() && document().settings().layerBasedSVGEngineEnabled() && enclosingLayer()->enclosingSVGHiddenOrResourceContainer())
return true;
#endif
return style().usedVisibility() != Visibility::Visible && !enclosingLayer()->hasVisibleContent();
}

Expand Down Expand Up @@ -2205,7 +2199,6 @@ void RenderElement::updateReferencedSVGResources()
clearReferencedSVGResources();
}

#if ENABLE(LAYER_BASED_SVG_ENGINE)
void RenderElement::repaintRendererOrClientsOfReferencedSVGResources() const
{
auto* enclosingResourceContainer = lineageOfType<RenderSVGResourceContainer>(*this).first();
Expand Down Expand Up @@ -2257,7 +2250,6 @@ void RenderElement::repaintOldAndNewPositionsForSVGRenderer() const

repaint();
}
#endif

#if ENABLE(TEXT_AUTOSIZING)
static RenderObject::BlockContentHeightType includeNonFixedHeight(const RenderObject& renderer)
Expand Down Expand Up @@ -2419,23 +2411,19 @@ FloatRect RenderElement::referenceBoxRect(CSSBoxType boxType) const
// and at the same time alter the CTM in RenderLayer::paintLayerByApplyingTransform() by
// including a translation to the enclosing transformed ancestor ('offsetFromAncestor').
// Avoid that, and move by -nominalSVGLayoutLocation().
#if ENABLE(LAYER_BASED_SVG_ENGINE)
if (isSVGLayerAwareRenderer() && !isRenderSVGRoot() && document().settings().layerBasedSVGEngineEnabled())
referenceBox.moveBy(-downcast<RenderLayerModelObject>(*this).nominalSVGLayoutLocation());
#endif
return referenceBox;
};

auto determineSVGViewport = [&]() {
RefPtr viewportElement = downcast<SVGElement>(element());

#if ENABLE(LAYER_BASED_SVG_ENGINE)
// RenderSVGViewportContainer is the only possible anonymous renderer in the SVG tree.
if (!viewportElement && document().settings().layerBasedSVGEngineEnabled()) {
ASSERT(isAnonymous());
viewportElement = &downcast<RenderSVGViewportContainer>(*this).svgSVGElement();
}
#endif

// FIXME: [LBSE] Upstream: Cache the immutable SVGLengthContext per SVGElement, to avoid the repeated RenderSVGRoot size queries in determineViewport().
ASSERT(viewportElement);
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/rendering/RenderElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,9 @@ class RenderElement : public RenderObject {
// Repaint only if our old bounds and new bounds are different. The caller may pass in newBounds and newOutlineBox if they are known.
bool repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repaintContainer, RequiresFullRepaint, const RepaintRects& oldRects, const RepaintRects& newRects);

#if ENABLE(LAYER_BASED_SVG_ENGINE)
void repaintClientsOfReferencedSVGResources() const;
void repaintRendererOrClientsOfReferencedSVGResources() const;
void repaintOldAndNewPositionsForSVGRenderer() const;
#endif

bool borderImageIsLoadedAndCanBeRendered() const;
bool isVisibleIgnoringGeometry() const;
Expand Down
Loading

0 comments on commit 9d4b244

Please sign in to comment.