Skip to content
Permalink
Browse files
[css-contain] Fix contain-size-replaced-002.html
https://bugs.webkit.org/show_bug.cgi?id=235175

Patch by Rob Buis <rbuis@igalia.com> on 2022-01-15
Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

If the SVG root has zero content width and/or height, there is no point
in painting the children contents.

Test: imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-002.html

* rendering/svg/LegacyRenderSVGRoot.cpp:
(WebCore::LegacyRenderSVGRoot::paintReplaced):

LayoutTests:

* TestExpectations:


Canonical link: https://commits.webkit.org/246077@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
rwlbuis authored and webkit-commit-queue committed Jan 15, 2022
1 parent 6c04d9e commit 13fe6ec7a23dbe755340a6133a37786772218800
Showing 4 changed files with 27 additions and 5 deletions.
@@ -1,3 +1,12 @@
2022-01-15 Rob Buis <rbuis@igalia.com>

[css-contain] Fix contain-size-replaced-002.html
https://bugs.webkit.org/show_bug.cgi?id=235175

Reviewed by Manuel Rego Casasnovas.

* TestExpectations:

2022-01-14 Antoine Quint <graouts@webkit.org>

Setting `content: normal` on a ::marker should make computed style return resolved values
@@ -4822,9 +4822,6 @@ imported/w3c/web-platform-tests/css/css-contain/content-visibility/animation-dis
# Canvas doesn't get default aspect-ratio for width and height attributes.
webkit.org/b/217529 imported/w3c/web-platform-tests/css/css-flexbox/canvas-contain-size.html [ ImageOnlyFailure ]

# Content is painted on svg's padding area.
webkit.org/b/425868 imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-002.html [ ImageOnlyFailure ]

# Multicolumn does not paint the horizontal overflow area of a relative child.
webkit.org/b/41796 imported/w3c/web-platform-tests/css/css-contain/contain-size-monolithic-002.html [ ImageOnlyFailure ]

@@ -1,3 +1,18 @@
2022-01-15 Rob Buis <rbuis@igalia.com>

[css-contain] Fix contain-size-replaced-002.html
https://bugs.webkit.org/show_bug.cgi?id=235175

Reviewed by Manuel Rego Casasnovas.

If the SVG root has zero content width and/or height, there is no point
in painting the children contents.

Test: imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-002.html

* rendering/svg/LegacyRenderSVGRoot.cpp:
(WebCore::LegacyRenderSVGRoot::paintReplaced):

2022-01-15 Tyler Wilcock <tyler_w@apple.com>

AX: Remove AXAriaAttributeChanged notification because it's not used by anything
@@ -224,7 +224,8 @@ bool LegacyRenderSVGRoot::shouldApplyViewportClip() const
void LegacyRenderSVGRoot::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
// An empty viewport disables rendering.
if (borderBoxRect().isEmpty())
bool clipViewport = shouldApplyViewportClip();
if (clipViewport && contentSize().isEmpty())
return;

// Don't paint, if the context explicitly disabled it.
@@ -269,7 +270,7 @@ void LegacyRenderSVGRoot::paintReplaced(PaintInfo& paintInfo, const LayoutPoint&
childPaintInfo.context().save();

// Apply initial viewport clip
if (shouldApplyViewportClip())
if (clipViewport)
childPaintInfo.context().clip(snappedIntRect(overflowClipRect(paintOffset)));

// Convert from container offsets (html renderers) to a relative transform (svg renderers).

0 comments on commit 13fe6ec

Please sign in to comment.