Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[css-tables] Percentage sizing of table cell replaced children with s…
…crollbar https://bugs.webkit.org/show_bug.cgi?id=255854 Reviewed by Simon Fraser. This patch aligns Webkit with Blink / Chromium. Merge: https://chromium.googlesource.com/chromium/src.git/+/bf802aa687ff50a9f4017376cf92da49915f6f8b When computing the percentage height of table cell replaced children, if the table cell has horizontal scrollbar we have to subtract its height from the overridingLogicalHeight(). * Source/WebCore/rendering/RenderBox.cpp: (RenderBox::availableLogicalHeightUsing): As per commit message * LayoutTests/imported/w3c/web-platform-tests/css/css-tables/height-distribution/support/scrollbars.css: Support file * LayoutTests/imported/w3c/web-platform-tests/css/css-tables/height-distribution/percentage-sizing-of-table-cell-replaced-children-001.html: Add Test * LayoutTests/imported/w3c/web-platform-tests/css/css-tables/height-distribution/percentage-sizing-of-table-cell-replaced-children-001-ref.html: Add WPT Reference File * LayoutTests/imported/w3c/web-platform-tests/css/css-tables/height-distribution/percentage-sizing-of-table-cell-replaced-children-001-expected.html: Add Test Case Expectation Canonical link: https://commits.webkit.org/263318@main
- Loading branch information
1 parent
997b59a
commit f1b46a8
Showing
5 changed files
with
127 additions
and
1 deletion.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
...s/height-distribution/percentage-sizing-of-table-cell-replaced-children-001-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,38 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>CSS Reftest Reference: Percentage sizing of table cell children with margin, border, padding and scrollbar</title> | ||
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> | ||
<style> | ||
.table { | ||
display: block; | ||
border: solid 5px black; | ||
width: 150px; | ||
height: 100px; | ||
} | ||
|
||
.td { | ||
background: cyan; | ||
overflow: scroll; | ||
padding: 5px 15px 10px 20px; | ||
border: solid magenta; | ||
border-width: 12px 9px 6px 3px; | ||
height: 100px; | ||
box-sizing: border-box; | ||
} | ||
|
||
img { | ||
display: block; | ||
background: yellow; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
</style> | ||
<link rel="stylesheet" type="text/css" href="support/scrollbars.css"> | ||
|
||
<p>The test passes if you see scrollbars but there's no overflow, so you cannot actually scroll.</p> | ||
|
||
<div class="table"> | ||
<div class="td"> | ||
<img /> | ||
</div> | ||
</div> |
38 changes: 38 additions & 0 deletions
38
...tables/height-distribution/percentage-sizing-of-table-cell-replaced-children-001-ref.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,38 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>CSS Reftest Reference: Percentage sizing of table cell children with margin, border, padding and scrollbar</title> | ||
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> | ||
<style> | ||
.table { | ||
display: block; | ||
border: solid 5px black; | ||
width: 150px; | ||
height: 100px; | ||
} | ||
|
||
.td { | ||
background: cyan; | ||
overflow: scroll; | ||
padding: 5px 15px 10px 20px; | ||
border: solid magenta; | ||
border-width: 12px 9px 6px 3px; | ||
height: 100px; | ||
box-sizing: border-box; | ||
} | ||
|
||
img { | ||
display: block; | ||
background: yellow; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
</style> | ||
<link rel="stylesheet" type="text/css" href="support/scrollbars.css"> | ||
|
||
<p>The test passes if you see scrollbars but there's no overflow, so you cannot actually scroll.</p> | ||
|
||
<div class="table"> | ||
<div class="td"> | ||
<img /> | ||
</div> | ||
</div> |
40 changes: 40 additions & 0 deletions
40
...css-tables/height-distribution/percentage-sizing-of-table-cell-replaced-children-001.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,40 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>CSS Table Test: Percentage sizing of table cell replaced children with margin, border, padding and scrollbar</title> | ||
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> | ||
<link rel="help" href="https://drafts.csswg.org/css-tables-3/#content-measure"> | ||
<link rel="match" href="percentage-sizing-of-table-cell-replaced-children-001-ref.html"> | ||
<meta name="assert" content="Checks that table cell replaced children resolve properly their percentage sizes, even when the table cell has margin, border, padding and scrollbar."> | ||
<style> | ||
.table { | ||
display: table; | ||
border: solid 5px black; | ||
width: 150px; | ||
height: 100px; | ||
} | ||
|
||
.td { | ||
display: table-cell; | ||
background: cyan; | ||
overflow: scroll; | ||
padding: 5px 15px 10px 20px; | ||
border: solid magenta; | ||
border-width: 12px 9px 6px 3px; | ||
} | ||
|
||
img { | ||
display: block; | ||
background: yellow; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
</style> | ||
<link rel="stylesheet" type="text/css" href="support/scrollbars.css"> | ||
|
||
<p>The test passes if you see scrollbars but there's no overflow, so you cannot actually scroll.</p> | ||
|
||
<div class="table"> | ||
<div class="td"> | ||
<img /> | ||
</div> | ||
</div> |
10 changes: 10 additions & 0 deletions
10
...imported/w3c/web-platform-tests/css/css-tables/height-distribution/support/scrollbars.css
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,10 @@ | ||
/* This makes the scrollbars visible on mac, both to humans and screenshots.*/ | ||
|
||
::-webkit-scrollbar { | ||
-webkit-appearance: none; | ||
} | ||
|
||
::-webkit-scrollbar-track { | ||
background-color: #eee; | ||
border-radius: 8px; | ||
} |
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