Diff
Modified: trunk/Source/WebCore/ChangeLog (286541 => 286542)
--- trunk/Source/WebCore/ChangeLog 2021-12-06 08:13:26 UTC (rev 286541)
+++ trunk/Source/WebCore/ChangeLog 2021-12-06 14:28:26 UTC (rev 286542)
@@ -1,3 +1,54 @@
+2021-12-06 Nikolas Zimmermann <nzimmerm...@igalia.com>
+
+ [LBSE] Add RenderObject::isSVGRootOrLegacySVGRoot() helper
+ https://bugs.webkit.org/show_bug.cgi?id=233870
+
+ Reviewed by Rob Buis.
+
+ Preparations to begin a new RenderSVGRoot implementation for the
+ layer-based SVG engine (LBSE).
+
+ Add a helper function to identify either legacy SVG or LBSE root
+ render objects (LegacyRenderSVGRoot and the upcoming RenderSVGRoot).
+
+ Covered by existing tests, no change in behavior.
+
+ * accessibility/AXObjectCache.cpp:
+ (WebCore::createFromRenderer):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::boundingBoxRect const):
+ (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
+ * dom/Element.cpp:
+ (WebCore::Element::boundingAbsoluteRectWithoutLayout):
+ * inspector/InspectorOverlay.cpp:
+ (WebCore::buildRendererHighlight):
+ * layout/integration/LayoutIntegrationCoverage.cpp:
+ (WebCore::LayoutIntegration::canUseForChild):
+ * rendering/RenderGeometryMap.cpp:
+ (WebCore::canMapBetweenRenderersViaLayers):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::beginTransparencyLayers):
+ (WebCore::RenderLayer::calculateClipRects const):
+ * rendering/RenderLayer.h:
+ (WebCore::RenderLayer::canUseOffsetFromAncestor const):
+ * rendering/RenderObject.cpp:
+ (WebCore::objectIsRelayoutBoundary):
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::isLegacySVGRoot const):
+ (WebCore::RenderObject::isSVGRootOrLegacySVGRoot const):
+ * rendering/RenderReplaced.cpp:
+ (WebCore::hasIntrinsicSize):
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::layout):
+ * rendering/svg/LegacyRenderSVGRoot.h:
+ * rendering/svg/SVGRenderSupport.cpp:
+ (WebCore::layoutSizeOfNearestViewportChanged):
+ * rendering/svg/SVGRenderingContext.cpp:
+ (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
+ (WebCore::SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem):
+ * rendering/updating/RenderTreeBuilder.cpp:
+ (WebCore::RenderTreeBuilder::reportVisuallyNonEmptyContent):
+
2021-12-06 Antti Koivisto <an...@apple.com>
[LFC][Integration] Use end bits in text box iterator
Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (286541 => 286542)
--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp 2021-12-06 08:13:26 UTC (rev 286541)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp 2021-12-06 14:28:26 UTC (rev 286542)
@@ -87,7 +87,6 @@
#include "HTMLSelectElement.h"
#include "HTMLTextFormControlElement.h"
#include "InlineRunAndOffset.h"
-#include "LegacyRenderSVGRoot.h"
#include "MathMLElement.h"
#include "Page.h"
#include "Range.h"
@@ -547,7 +546,7 @@
return AccessibilityMediaObject::create(renderer);
#endif
- if (is<LegacyRenderSVGRoot>(*renderer))
+ if (renderer->isSVGRootOrLegacySVGRoot())
return AccessibilitySVGRoot::create(renderer);
if (is<SVGElement>(node))
Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (286541 => 286542)
--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2021-12-06 08:13:26 UTC (rev 286541)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2021-12-06 14:28:26 UTC (rev 286542)
@@ -856,7 +856,7 @@
Vector<FloatQuad> quads;
bool isSVGRoot = false;
- if (obj->isSVGRoot())
+ if (obj->isSVGRootOrLegacySVGRoot())
isSVGRoot = true;
if (is<RenderText>(*obj))
@@ -3011,7 +3011,7 @@
if (headingLevel())
return AccessibilityRole::Heading;
- if (m_renderer->isSVGRoot())
+ if (m_renderer->isSVGRootOrLegacySVGRoot())
return AccessibilityRole::SVGRoot;
if (isStyleFormatGroup()) {
Modified: trunk/Source/WebCore/dom/Element.cpp (286541 => 286542)
--- trunk/Source/WebCore/dom/Element.cpp 2021-12-06 08:13:26 UTC (rev 286541)
+++ trunk/Source/WebCore/dom/Element.cpp 2021-12-06 14:28:26 UTC (rev 286542)
@@ -1714,7 +1714,7 @@
{
RenderObject* renderer = this->renderer();
Vector<FloatQuad> quads;
- if (isSVGElement() && renderer && !renderer->isSVGRoot()) {
+ if (isSVGElement() && renderer && !renderer->isSVGRootOrLegacySVGRoot()) {
// Get the bounding rectangle from the SVG model.
SVGElement& svgElement = downcast<SVGElement>(*this);
if (auto localRect = svgElement.getBoundingBox())
Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (286541 => 286542)
--- trunk/Source/WebCore/inspector/InspectorOverlay.cpp 2021-12-06 08:13:26 UTC (rev 286541)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.cpp 2021-12-06 14:28:26 UTC (rev 286542)
@@ -143,8 +143,8 @@
FrameView* containingView = containingFrame->view();
FrameView* mainView = containingFrame->page()->mainFrame().view();
- // LegacyRenderSVGRoot should be highlighted through the isBox() code path, all other SVG elements should just dump their absoluteQuads().
- bool isSVGRenderer = renderer->node() && renderer->node()->isSVGElement() && !renderer->isSVGRoot();
+ // (Legacy)RenderSVGRoot should be highlighted through the isBox() code path, all other SVG elements should just dump their absoluteQuads().
+ bool isSVGRenderer = renderer->node() && renderer->node()->isSVGElement() && !renderer->isSVGRootOrLegacySVGRoot();
if (isSVGRenderer) {
highlight.type = InspectorOverlay::Highlight::Type::Rects;
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp (286541 => 286542)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp 2021-12-06 08:13:26 UTC (rev 286541)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp 2021-12-06 14:28:26 UTC (rev 286542)
@@ -533,7 +533,7 @@
if (replaced.isFloating() || replaced.isPositioned())
SET_REASON_AND_RETURN_IF_NEEDED(ChildBoxIsFloatingOrPositioned, reasons, includeReasons)
- if (replaced.isSVGRoot())
+ if (replaced.isSVGRootOrLegacySVGRoot())
SET_REASON_AND_RETURN_IF_NEEDED(ContentIsSVG, reasons, includeReasons);
if (is<RenderImage>(replaced)) {
Modified: trunk/Source/WebCore/rendering/RenderGeometryMap.cpp (286541 => 286542)
--- trunk/Source/WebCore/rendering/RenderGeometryMap.cpp 2021-12-06 08:13:26 UTC (rev 286541)
+++ trunk/Source/WebCore/rendering/RenderGeometryMap.cpp 2021-12-06 14:28:26 UTC (rev 286542)
@@ -156,7 +156,7 @@
if (current->isRenderFragmentedFlow())
return false;
- if (current->isSVGRoot())
+ if (current->isLegacySVGRoot())
return false;
if (current == &ancestor)
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (286541 => 286542)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2021-12-06 08:13:26 UTC (rev 286541)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2021-12-06 14:28:26 UTC (rev 286542)
@@ -2205,7 +2205,7 @@
context.clip(pixelSnappedClipRect);
#if ENABLE(CSS_COMPOSITING)
- bool usesCompositeOperation = hasBlendMode() && !(renderer().isSVGRoot() && parent() && parent()->isRenderViewLayer());
+ bool usesCompositeOperation = hasBlendMode() && !(renderer().isLegacySVGRoot() && parent() && parent()->isRenderViewLayer());
if (usesCompositeOperation)
context.setCompositeOperation(context.compositeOperation(), blendMode());
#endif
@@ -5541,7 +5541,7 @@
// Add the filter as a client to this renderer, unless we are a RenderLayer accommodating
// an SVG. In that case it takes care of its own resource management for filters.
- if (renderer().style().filter().hasReferenceFilter() && !renderer().isSVGRoot()) {
+ if (renderer().style().filter().hasReferenceFilter() && !renderer().isSVGRootOrLegacySVGRoot()) {
ensureLayerFilters();
m_filters->updateReferenceFilterClients(renderer().style().filter());
} else if (m_filters)
Modified: trunk/Source/WebCore/rendering/RenderLayer.h (286541 => 286542)
--- trunk/Source/WebCore/rendering/RenderLayer.h 2021-12-06 08:13:26 UTC (rev 286541)
+++ trunk/Source/WebCore/rendering/RenderLayer.h 2021-12-06 14:28:26 UTC (rev 286542)
@@ -600,7 +600,7 @@
{
// FIXME: This really needs to know if there are transforms on this layer and any of the layers
// between it and the ancestor in question.
- return !renderer().hasTransform() && !renderer().isSVGRoot();
+ return !renderer().hasTransform() && !renderer().isSVGRootOrLegacySVGRoot();
}
// FIXME: adjustForColumns allows us to position compositing layers in columns correctly, but eventually they need to be split across columns too.
Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (286541 => 286542)
--- trunk/Source/WebCore/rendering/RenderObject.cpp 2021-12-06 08:13:26 UTC (rev 286541)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp 2021-12-06 14:28:26 UTC (rev 286542)
@@ -508,7 +508,7 @@
if (shouldApplyLayoutContainment(*object) && shouldApplySizeContainment(*object))
return true;
- if (object->isSVGRoot())
+ if (object->isSVGRootOrLegacySVGRoot())
return true;
if (!object->hasNonVisibleOverflow())
Modified: trunk/Source/WebCore/rendering/RenderObject.h (286541 => 286542)
--- trunk/Source/WebCore/rendering/RenderObject.h 2021-12-06 08:13:26 UTC (rev 286541)
+++ trunk/Source/WebCore/rendering/RenderObject.h 2021-12-06 14:28:26 UTC (rev 286542)
@@ -326,6 +326,7 @@
// to add SVG renderer methods to RenderObject with an ASSERT_NOT_REACHED() default implementation.
virtual bool isRenderSVGModelObject() const { return false; }
virtual bool isRenderSVGBlock() const { return false; };
+ virtual bool isLegacySVGRoot() const { return false; }
virtual bool isSVGRoot() const { return false; }
virtual bool isSVGContainer() const { return false; }
virtual bool isSVGTransformableContainer() const { return false; }
@@ -345,6 +346,7 @@
virtual bool isSVGResourceFilter() const { return false; }
virtual bool isSVGResourceClipper() const { return false; }
virtual bool isSVGResourceFilterPrimitive() const { return false; }
+ bool isSVGRootOrLegacySVGRoot() const { return isSVGRoot() || isLegacySVGRoot(); }
// FIXME: Those belong into a SVG specific base-class for all renderers (see above)
// Unfortunately we don't have such a class yet, because it's not possible for all renderers
Modified: trunk/Source/WebCore/rendering/RenderReplaced.cpp (286541 => 286542)
--- trunk/Source/WebCore/rendering/RenderReplaced.cpp 2021-12-06 08:13:26 UTC (rev 286541)
+++ trunk/Source/WebCore/rendering/RenderReplaced.cpp 2021-12-06 14:28:26 UTC (rev 286542)
@@ -544,7 +544,7 @@
if (hasIntrinsicWidth && hasIntrinsicHeight)
return true;
if (hasIntrinsicWidth || hasIntrinsicHeight)
- return contentRenderer && contentRenderer->isSVGRoot();
+ return contentRenderer && contentRenderer->isSVGRootOrLegacySVGRoot();
return false;
}
Modified: trunk/Source/WebCore/rendering/RenderView.cpp (286541 => 286542)
--- trunk/Source/WebCore/rendering/RenderView.cpp 2021-12-06 08:13:26 UTC (rev 286541)
+++ trunk/Source/WebCore/rendering/RenderView.cpp 2021-12-06 14:28:26 UTC (rev 286542)
@@ -169,7 +169,7 @@
|| box.style().logicalHeight().isPercentOrCalculated()
|| box.style().logicalMinHeight().isPercentOrCalculated()
|| box.style().logicalMaxHeight().isPercentOrCalculated()
- || box.isSVGRoot()
+ || box.isSVGRootOrLegacySVGRoot()
)
box.setChildNeedsLayout(MarkOnlyThis);
}
Modified: trunk/Source/WebCore/rendering/svg/LegacyRenderSVGRoot.h (286541 => 286542)
--- trunk/Source/WebCore/rendering/svg/LegacyRenderSVGRoot.h 2021-12-06 08:13:26 UTC (rev 286541)
+++ trunk/Source/WebCore/rendering/svg/LegacyRenderSVGRoot.h 2021-12-06 14:28:26 UTC (rev 286542)
@@ -66,7 +66,7 @@
private:
void element() const = delete;
- bool isSVGRoot() const override { return true; }
+ bool isLegacySVGRoot() const override { return true; }
// Intentially left 'RenderSVGRoot' instead of 'LegacyRenderSVGRoot', to avoid breaking layout tests.
const char* renderName() const override { return "RenderSVGRoot"; }
@@ -123,4 +123,4 @@
} // namespace WebCore
-SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(LegacyRenderSVGRoot, isSVGRoot())
+SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(LegacyRenderSVGRoot, isLegacySVGRoot())
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp (286541 => 286542)
--- trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp 2021-12-06 08:13:26 UTC (rev 286541)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp 2021-12-06 14:28:26 UTC (rev 286542)
@@ -204,7 +204,7 @@
static inline bool layoutSizeOfNearestViewportChanged(const RenderElement& renderer)
{
const RenderElement* start = &renderer;
- while (start && !is<LegacyRenderSVGRoot>(*start) && !is<RenderSVGViewportContainer>(*start))
+ while (start && !start->isSVGRootOrLegacySVGRoot() && !is<RenderSVGViewportContainer>(*start))
start = start->parent();
ASSERT(start);
@@ -216,7 +216,7 @@
bool SVGRenderSupport::transformToRootChanged(RenderElement* ancestor)
{
- while (ancestor && !is<LegacyRenderSVGRoot>(*ancestor)) {
+ while (ancestor && !ancestor->isSVGRootOrLegacySVGRoot()) {
if (is<RenderSVGTransformableContainer>(*ancestor))
return downcast<RenderSVGTransformableContainer>(*ancestor).didTransformToRootUpdate();
if (is<RenderSVGViewportContainer>(*ancestor))
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp (286541 => 286542)
--- trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp 2021-12-06 08:13:26 UTC (rev 286541)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp 2021-12-06 14:28:26 UTC (rev 286542)
@@ -97,7 +97,7 @@
// Setup transparency layers before setting up SVG resources!
bool isRenderingMask = isRenderingMaskImage(*m_renderer);
// RenderLayer takes care of root opacity.
- float opacity = (renderer.isSVGRoot() || isRenderingMask) ? 1 : style.opacity();
+ float opacity = (renderer.isLegacySVGRoot() || isRenderingMask) ? 1 : style.opacity();
bool hasBlendMode = style.hasBlendMode();
bool hasIsolation = style.hasIsolation();
bool isolateMaskForBlending = false;
@@ -206,7 +206,7 @@
const RenderObject* ancestor = &renderer;
while (ancestor) {
absoluteTransform = ancestor->localToParentTransform() * absoluteTransform;
- if (ancestor->isSVGRoot())
+ if (ancestor->isSVGRootOrLegacySVGRoot())
break;
ancestor = ancestor->parent();
}
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp (286541 => 286542)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp 2021-12-06 08:13:26 UTC (rev 286541)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp 2021-12-06 14:28:26 UTC (rev 286542)
@@ -995,7 +995,7 @@
m_view.frameView().incrementVisuallyNonEmptyPixelCount(roundedIntSize(replacedRenderer.intrinsicSize()));
return;
}
- if (is<LegacyRenderSVGRoot>(child)) {
+ if (child.isSVGRootOrLegacySVGRoot()) {
auto fixedSize = [] (const auto& renderer) -> std::optional<IntSize> {
auto& style = renderer.style();
if (!style.width().isFixed() || !style.height().isFixed())