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
Table with fixed layout behaves like auto layout when its width is se…
…t by JS instead of css Table with fixed layout behaves like auto layout when its width is set by JS instead of css https://bugs.webkit.org/show_bug.cgi?id=130239 Reviewed by Alan Baradlay. This patch is to align WebKit with Blink / Chromium and Gecko / Firefox. Merge - https://chromium.googlesource.com/chromium/blink/+/17dc4cd863992d6f9932ba40d5cf41a1389dfa97 The new width of table was not being applied when changed dynamically even though the table-layout is fixed. On calculating whether we need to set the m_tableLayout as fixed or auto the change in layout parameters such as width, height etc was not considered hence the right layout type was not being set. Incase there are any layout changes we need to see whether m_tableLayout needs to be changed or not. * Source/WebCore/rendering/RenderTable.cpp: (RenderTable::styleDidChange): Update as per commit message * Source/WebCore/rendering/style/RenderStyle.h: Add bool 'isFixedTableLayout' with return value * LayoutTests/fast/table/fixed-table-layout-width-change.html: Add Test Case * LayoutTests/fast/table/fixed-table-layout-width-change-expected.txt: Add Test Case Expectation Canonical link: https://commits.webkit.org/260143@main
- Loading branch information
1 parent
d43e2a2
commit b6c7186
Showing
4 changed files
with
42 additions
and
6 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
LayoutTests/fast/table/fixed-table-layout-width-change-expected.txt
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,2 @@ | ||
Tests that the table width having table-layout fixed changes when width is changed dynamically. | ||
PASS |
32 changes: 32 additions & 0 deletions
32
LayoutTests/fast/table/fixed-table-layout-width-change.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,32 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script type="text/javascript"> | ||
function runTest() { | ||
var outer = document.getElementById('outer'); | ||
outer.style.width = '100px'; | ||
window.checkLayout("#outer", document.getElementById("test-output")); | ||
}; | ||
</script> | ||
<script src="../../resources/check-layout.js"></script> | ||
<style> | ||
#outer { | ||
display: table; | ||
table-layout: fixed; | ||
} | ||
#inner { | ||
display: table-cell; | ||
height: 50px; | ||
background-color: green; | ||
min-width: 200px; | ||
} | ||
</style> | ||
</head> | ||
<body onload="runTest()"> | ||
Tests that the table width having table-layout fixed changes when width is changed dynamically. | ||
<div id="outer" data-expected-width="100"> | ||
<div id="inner"></div> | ||
</div> | ||
<div id="test-output"></div> | ||
</body> | ||
</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