Skip to content

Commit

Permalink
Fix content-visibility-fieldset-size.html
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=258935

Reviewed by Alan Baradlay.

Fix content-visibility-fieldset-size.html by preventing painting
fieldset contents where content-visibility causes the content to
be skipped.

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::adjustBorderBoxRectForPainting):
(WebCore::RenderBlock::paintRectToClipOutFromBorder):
(WebCore::RenderBlock::paintExcludedChildrenInBorder):

Canonical link: https://commits.webkit.org/266226@main
  • Loading branch information
rwlbuis committed Jul 22, 2023
1 parent ae81678 commit cb0fa67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion LayoutTests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -4929,7 +4929,6 @@ imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visib
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-auto-state-changed.html [ Skip ]
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-auto-state-changed-first-observation.html [ Skip ]
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-auto-state-changed-removed.html [ Skip ]
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-fieldset-size.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-video.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-contain/counter-scoping-001.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-contain/counter-scoping-002.html [ ImageOnlyFailure ]
Expand Down
6 changes: 3 additions & 3 deletions Source/WebCore/rendering/RenderBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3356,7 +3356,7 @@ RenderBox* RenderBlock::findFieldsetLegend(FieldsetFindLegendOption option) cons

void RenderBlock::adjustBorderBoxRectForPainting(LayoutRect& paintRect)
{
if (!isFieldset() || !intrinsicBorderForFieldset())
if (!isFieldset() || isSkippedContentRoot() || !intrinsicBorderForFieldset())
return;

auto* legend = findFieldsetLegend();
Expand All @@ -3379,7 +3379,7 @@ void RenderBlock::adjustBorderBoxRectForPainting(LayoutRect& paintRect)
LayoutRect RenderBlock::paintRectToClipOutFromBorder(const LayoutRect& paintRect)
{
LayoutRect clipRect;
if (!isFieldset())
if (!isFieldset() || isSkippedContentRoot())
return clipRect;
auto* legend = findFieldsetLegend();
if (!legend)
Expand Down Expand Up @@ -3522,7 +3522,7 @@ LayoutUnit RenderBlock::adjustIntrinsicLogicalHeightForBoxSizing(LayoutUnit heig

void RenderBlock::paintExcludedChildrenInBorder(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
if (!isFieldset())
if (!isFieldset() || isSkippedContentRoot())
return;

RenderBox* box = findFieldsetLegend();
Expand Down

0 comments on commit cb0fa67

Please sign in to comment.