Skip to content
Permalink
Browse files
Don't force display:table-cell, display:inline-table/table and float:…
…none on table cell elements when in quirks mode

Don't force display:table-cell, display:inline-table/table and float:none on table cell elements when in quirks mode

https://bugs.webkit.org/show_bug.cgi?id=244947

Reviewed by Alan Bujtas.

Merge - https://chromium.googlesource.com/chromium/src.git/+/0aea8a9a12d5a3b60bb022953825f900f90e7b4b and https://chromium.googlesource.com/chromium/src.git/+/95773a85549dc14dbb42d665dadd7875d05df0a1

This is to remove the quirk mode behaviors:

1. force table cell elements to display:table-cell and float:none
2. force table elements to display:inline-table or table

Both of these were not implemented in Gecko but Blink also dropped them in 2016 to align with Gecko. This patch aims to align now all web engines.

* Source/WebCore/style/StyleAdjuster.cpp
(Adjuster::adjust) - Remove "Quirks" conditions
* LayoutTests/editing/execCommand/insertHTML-expected.txt - Updated Expectations
* LayoutTests/editing/execCommand/insertHTML.html - Updated Test
* LayoutTests/editing/pasteboard/innerText-inline-table.html - Updated Test
* LayoutTests/editing/selection/inline-table.html - Updated Test
* LayoutTests/editing/selection/table-caret-3.html - Updated Test
* LayoutTests/fast/borders/table-borders/html - Updated Test
* LayoutTests/fast/dom/inner-text-001.html - Updated Test
* LayoutTests/fast/table/floating-th.html - Updated Test
* LayoutTests/fast/table/quirks-mode-ignore-display-inline-table.html - Added new Test
* LayoutTests/fast/table/quirks-mode-ignore-display-inline-table-expected.txt - Added Test Expectations
* LayoutTests/fast/table/table-display-types-vertical.html - Updated Test
* LayoutTests/fast/table/table-display-types.html - Updated Test
* LayoutTests/platform/gtk/fast/table/table-display-types-expected.png - Updated Expectations
* LayoutTests/platform/gtk/fast/table/table-display-types-vertical-expected.png - Updated Expectations
* LayoutTests/platform/glib/fast/table/table-display-types-expected.txt - Updated Expectations
* LayoutTests/platform/glib/fast/table/table-display-types-vertical-expected.txt - Updated Expectations
* LayoutTests/platform/ios/fast/table/table-display-types-expected.txt - Updated Expectations
* LayoutTests/platform/ios/fast/table/table-display-types-vertical-expected.txt - Updated Expectations
* LayoutTests/platform/mac/fast/encoding/utf-16-big-endian-expected.png - Updated Expectations
* LayoutTests/platform/mac/fast/encoding/utf-16-big-endian-expected.txt - Updated Expectations
* LayoutTests/platform/mac/fast/encoding/utf-16-little-endian-expected.png - Updated Expectations
* LayoutTests/platform/mac/fast/encoding/utf-16-little-endian-expected.txt - Updated Expectations
* LayoutTests/platform/mac/fast/table/table-display-types-expected.png - Updated Expectations
* LayoutTests/platform/mac/fast/table/table-display-types-vertical-expected.png - Updated Expectations
* LayoutTests/platform/mac/fast/table/table-display-types-expected.txt - Updated Expectations
* LayoutTests/platform/mac/fast/table/table-display-types-vertical-expected.txt - Updated Expectations

Canonical link: https://commits.webkit.org/254475@main
  • Loading branch information
Ahmad Saleem authored and alanbaradlay committed Sep 14, 2022
1 parent 2369ed4 commit 840ec41f4b7e4d6a8f4d3336fdde6054561128d9
Show file tree
Hide file tree
Showing 27 changed files with 951 additions and 863 deletions.
@@ -13,4 +13,4 @@ EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
This is a test of execCommand(insertHTML, ...). The contents of the editable div below should be the same before and after the test.

hello 1 2 world!
hello<table style="display:inline" border="1"><tbody><tr><td>1</td><td>2</td></tr></tbody></table><b>world</b>!
hello<table style="display:inline-table" border="1"><tbody><tr><td>1</td><td>2</td></tr></tbody></table><b>world</b>!
@@ -29,7 +29,7 @@

<body>
<p>This is a test of execCommand(insertHTML, ...). The contents of the editable div below should be the same before and after the test.</p>
<div id="test" contenteditable="true">hello<table style="display:inline" border=1><tr><td>1</td><td>2</td></tr></table><b>world</b>!</div>
<div id="test" contenteditable="true">hello<table style="display:inline-table" border=1><tr><td>1</td><td>2</td></tr></table><b>world</b>!</div>
<ul id="console"></ul>
<script>
runEditingTest();
@@ -4,8 +4,8 @@
</script>
<div id="explanation">Checks that the text iterator is emitting a space before and after an inline table.</div>

<div id="test">hello<table style="display:inline"><tr><td>1</td></tr></table>world</div>
<div id="test2">foo <table style="display:inline"><tr><td>2</td></tr></table> bar</div>
<div id="test">hello<table style="display:inline-table"><tr><td>1</td></tr></table>world</div>
<div id="test2">foo <table style="display:inline-table"><tr><td>2</td></tr></table> bar</div>
<ul id="console"></ul>
<script>

@@ -22,7 +22,7 @@
<p>This tests caret movement through an inline table. There should be visual positions before and after the inline table, as if it were an image. The caret shouldn't skip across the table, but should enter it (unless we later decide that we don't want this behavior).</p>
<div contenteditable id="root" class="editing">
<div id="test">
Inline Table:<TABLE border="1" style="display: inline">
Inline Table:<TABLE border="1" style="display: inline-table">
<TBODY><TR><TD>One</TD><TD>Two</TD><TD>Three</TD></TR><TR><TD>Four</TD><TD>Five</TD><TD>Six</TD></TR><TR><TD>Seven</TD><TD>Eight</TD><TD>Nine</TD></TR></TBODY></TABLE>The End...
</div>
</div>
@@ -10,7 +10,7 @@

<p>This tests the caret position for the caret after an inline table.</p>

<div contenteditable="true">foo<table style="display:inline" id="test"><tr><td>this</td></tr><tr><td>is</td></tr><tr><td>a table</td></tr></table>baz</div>
<div contenteditable="true">foo<table style="display:inline-table" id="test"><tr><td>this</td></tr><tr><td>is</td></tr><tr><td>a table</td></tr></table>baz</div>

<script>
var s = window.getSelection();
@@ -3,7 +3,7 @@
<style type="text/css">
table {
margin: 20px;
display: inline-block;
display: inline-table;
}

.wide td {
@@ -35,9 +35,9 @@ <h3>Check lists, tables, styled text, and images.</h3>
<br>
Right <h4 style="display:inline">here</h4> is an inline block.
<br>
And an <table border=1 style="display:inline"><td>inline</td><td>table</td><td>with</td><td>one</td><td>row</td></table> is here, too.
And an <table border=1 style="display:inline-table"><td>inline</td><td>table</td><td>with</td><td>one</td><td>row</td></table> is here, too.
<br>
And an <table border=1 style="display:inline"><tr><td>inline</td><td>table</td></tr><tr><td>with</td><td>rows</td></tr></table> not far behind.
And an <table border=1 style="display:inline-table"><tr><td>inline</td><td>table</td></tr><tr><td>with</td><td>rows</td></tr></table> not far behind.
<h3>Check collapsed margins</h3>
Collapsed margins are supposed to result in an extra line break.
<h4 class="colored">First header</h4>
@@ -9,10 +9,6 @@
th {
float: left;
}

td {
float: right;
}
</style>
</head>
<body>
@@ -0,0 +1,3 @@

PASS Test to make sure that in quirks mode table elements with display act as they do in standard mode and retain display value

@@ -0,0 +1,25 @@
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<table id="table" style="display:inline">
<thead id="thead" style="display:inline-table">
<tr id="tr1" style="display:inline-block">
<td id="td1"></td>
</tr>
</thead>
<tbody id="tbody" style="display:block">
<tr id="tr2" style="display:table">
<tr id="tr3" style="display: table-row-group">
</tr>
</tbody>
</table>
<script>
test(function() {
assert_equals(getComputedStyle(table).display, "inline");
assert_equals(getComputedStyle(thead).display, "inline-table");
assert_equals(getComputedStyle(tr1).display, "inline-block");
assert_equals(getComputedStyle(td1).display, "table-cell");
assert_equals(getComputedStyle(tbody).display, "block");
assert_equals(getComputedStyle(tr2).display, "table");
assert_equals(getComputedStyle(tr3).display, "table-row-group");
}, "Test to make sure that in quirks mode table elements with display act as they do in standard mode and retain display value");
</script>
@@ -13,7 +13,7 @@
}

.test td {
display: inline;
display: inline-table;
}

.test2 tr, .test2 thead, .test2 tfoot {
@@ -12,7 +12,7 @@
}

.test td {
display: inline;
display: inline-table;
}

.test2 tr, .test2 thead, .test2 tfoot {

0 comments on commit 840ec41

Please sign in to comment.