-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[content-visibility] Property should not apply to tables
https://bugs.webkit.org/show_bug.cgi?id=264163 Reviewed by Tim Nguyen. The content-visibility property applied to elements for which size containment can apply [1]. However, size containment does not apply to tables [2], so change the code to make content-visibility not have a direct effect on tables. [1] https://drafts.csswg.org/css-contain/#content-visibility [2] https://drafts.csswg.org/css-contain/#containment-size * LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-094-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-094.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-095-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-095.html: Added. * Source/WebCore/rendering/RenderElementInlines.h: (WebCore::RenderElement::shouldApplyLayoutOrPaintContainment const): (WebCore::RenderElement::shouldApplyPaintContainment const): * Source/WebCore/rendering/style/RenderStyleInlines.h: (WebCore::isSkippedContentRoot): Canonical link: https://commits.webkit.org/270888@main
- Loading branch information
Showing
6 changed files
with
149 additions
and
11 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
...eb-platform-tests/css/css-contain/content-visibility/content-visibility-094-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!doctype HTML> | ||
<html> | ||
<meta charset="utf8"> | ||
<title>Content Visibility: hidden table types</title> | ||
<link rel="author" title="Rob Buis" href="mailto:rbuis@igalia.com"> | ||
|
||
<style> | ||
table { | ||
width: 150px; | ||
height: 150px; | ||
background: lightblue; | ||
} | ||
</style> | ||
|
||
<table id=table> | ||
<tr id=tr> | ||
<td id=td> | ||
<div>Test passes if this text is visible.</div> | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
</html> |
44 changes: 44 additions & 0 deletions
44
...ted/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-094.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!doctype HTML> | ||
<html class="reftest-wait"> | ||
<meta charset="utf8"> | ||
<title>Content Visibility: hidden table types</title> | ||
<link rel="author" title="Rob Buis" href="mailto:rbuis@igalia.com"> | ||
<link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility"> | ||
<link rel="match" href="container-ref.html"> | ||
<meta name="assert" content="content-visibility effect on hidden table types"> | ||
|
||
<script src="/common/reftest-wait.js"></script> | ||
|
||
<style> | ||
table { | ||
width: 150px; | ||
height: 150px; | ||
background: lightblue; | ||
} | ||
.hidden { | ||
content-visibility: hidden; | ||
} | ||
</style> | ||
|
||
<table id=table> | ||
<caption id=caption> | ||
<div>Test fails if this text is visible.</div> | ||
</caption> | ||
<tr id=tr> | ||
<td id=td> | ||
<div>Test passes if this text is visible.</div> | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
<script> | ||
function runTest() { | ||
document.getElementById("table").classList.add("hidden"); | ||
document.getElementById("tr").classList.add("hidden"); | ||
document.getElementById("caption").classList.add("hidden"); | ||
requestAnimationFrame(takeScreenshot); | ||
} | ||
|
||
window.onload = () => requestAnimationFrame(runTest); | ||
</script> | ||
</html> |
24 changes: 24 additions & 0 deletions
24
...eb-platform-tests/css/css-contain/content-visibility/content-visibility-095-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!doctype HTML> | ||
<html> | ||
<meta charset="utf8"> | ||
<title>CSS Content Visibility: container (reference)</title> | ||
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org"> | ||
<link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility"> | ||
|
||
<style> | ||
#table { | ||
width: 150px; | ||
height: 150px; | ||
background: lightblue; | ||
} | ||
#positioned { | ||
position: absolute; | ||
} | ||
</style> | ||
|
||
<table id=table> | ||
<td> | ||
<div id=positioned>Test passes if this text is visible.</div> | ||
</td> | ||
</table> | ||
|
47 changes: 47 additions & 0 deletions
47
...ted/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-095.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!doctype HTML> | ||
<html class="reftest-wait"> | ||
<meta charset="utf8"> | ||
<title>Content Visibility: hidden table with positioned child</title> | ||
<link rel="author" title="Rob Buis" href="mailto:rbuis@igalia.com"> | ||
<link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility"> | ||
<link rel="match" href="container-ref.html"> | ||
<meta name="assert" content="content-visibility hidden table does paint the subtree"> | ||
|
||
<script src="/common/reftest-wait.js"></script> | ||
|
||
<style> | ||
table { | ||
width: 150px; | ||
height: 150px; | ||
background: lightblue; | ||
} | ||
#positioned { | ||
position: absolute; | ||
} | ||
.hidden { | ||
content-visibility: hidden; | ||
} | ||
</style> | ||
|
||
<table id=table> | ||
<caption id=caption> | ||
<div id=positioned>Test fails if this text is visible.</div> | ||
</caption> | ||
<tr id=tr> | ||
<td id=td> | ||
<div id=positioned>Test passes if this text is visible.</div> | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
<script> | ||
function runTest() { | ||
document.getElementById("table").classList.add("hidden"); | ||
document.getElementById("tr").classList.add("hidden"); | ||
document.getElementById("caption").classList.add("hidden"); | ||
requestAnimationFrame(takeScreenshot); | ||
} | ||
|
||
window.onload = () => requestAnimationFrame(runTest); | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters