forked from adobe/webkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
max-height property not respected in case of tables
https://bugs.webkit.org/show_bug.cgi?id=98633 Patch by Pravin D <[email protected]> on 2012-11-27 Reviewed by Julien Chaffraix. Source/WebCore: The max-height property determines the maximum computed height an element can have. In case of tables the computed height was not being limited by the max-height property. The current patch fixes the same. Test: fast/table/css-table-max-height.html * rendering/RenderTable.cpp: (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight): Helper function to compute height from the given style height. This function handles style height of type fixed, percent and viewport percent. As height of type 'calculated' gets internally resolved to either fixed or percent there is no special handling required for the same. (WebCore): (WebCore::RenderTable::layout): Logic to compute the logical height of an element such that it does not exceed the max-height value given that min-width < Content height < max-height, when min-height < max-height. However max-height value is not respected if either min-height > max-height or Content height > max-height. * rendering/RenderTable.h: (RenderTable): Function definition for the newly add function convertStyleLogicalHeightToComputedHeight(). LayoutTests: * fast/table/css-table-max-height-expected.txt: Added. * fast/table/css-table-max-height.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135891 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
f8c632e
commit cc747f4
Showing
6 changed files
with
231 additions
and
11 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,3 +1,13 @@ | ||
2012-11-27 Pravin D <[email protected]> | ||
|
||
max-height property not respected in case of tables | ||
https://bugs.webkit.org/show_bug.cgi?id=98633 | ||
|
||
Reviewed by Julien Chaffraix. | ||
|
||
* fast/table/css-table-max-height-expected.txt: Added. | ||
* fast/table/css-table-max-height.html: Added. | ||
|
||
2012-11-27 Roger Fong <[email protected]> | ||
|
||
Windows specific implementation of usesTileCacheLayer needed after r133056. | ||
|
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 @@ | ||
Testcase for Bug http://wkbug.com/98633. The testcase checks if the height of a css table does not exceed the max-height value. The height of the table can be greater than max-height value when either min-height is greater than max-height or computed height of the content is greater than the max-height. | ||
|
||
This sub-test checks that when min-height is lesser than max-height, max-height is applied to a table with auto layout. | ||
PASS | ||
This sub-test checks that when min-height is greater than max-height, min-height is applied to a table with auto layout. | ||
PASS | ||
This sub-test checks that max-height with fixed value is applied to a table with auto layout. | ||
PASS | ||
This sub-test checks that max-height with percent value is applied to a table with auto layout. | ||
PASS | ||
This sub-test checks that max-height with viewport percent height value is applied to a table with auto layout. | ||
PASS | ||
This sub-test checks that max-height with viewport percent width value is applied to a table with auto layout. | ||
PASS | ||
This sub-test checks that when content height is greater than max-height, content height is applied to the table with auto layout. | ||
|
||
FILLER TEXT TO INCREASE CONTENT HEIGHT. | ||
PASS | ||
This test checks that when height of an auto-table is auto, there is are no asserts. No crash means the test passed. | ||
PASS | ||
This sub-test checks that when min-height is lesser than max-height, max-height is applied to a table with fixed layout. | ||
PASS | ||
This sub-test checks that when min-height is greater than max-height, min-height is applied to a table with fixed layout. | ||
PASS | ||
This sub-test checks that max-height with fixed value is applied to a table with fixed layout. | ||
PASS | ||
This sub-test checks that max-height with percent value is applied to a table with fixed layout. | ||
PASS | ||
This sub-test checks that max-height with viewport percent height value is applied to a table with fixed layout. | ||
PASS | ||
This sub-test checks that max-height with viewport percent width value is applied to a table with fixed layout. | ||
PASS | ||
This sub-test checks that when content height is greater than max-height, content height is applied to a table with fixed layout. | ||
|
||
FILLER TEXT TO INCREASE CONTENT HEIGHT. | ||
PASS | ||
This test checks that when height of a fixed table is auto, there is are no asserts. No crash means the test passed. | ||
PASS |
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,115 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style type="text/css"> | ||
.container | ||
{ | ||
width:300px; | ||
height:400px; | ||
font-family:ahem; | ||
background-color:#999999; | ||
} | ||
|
||
.child | ||
{ | ||
display:table; | ||
height:100%; | ||
background-color:green; | ||
} | ||
.fixed-table | ||
{ | ||
table-layout:fixed; | ||
} | ||
</style> | ||
<script src="../../resources/check-layout.js"></script> | ||
</head> | ||
<body onload="checkLayout('.child')"> | ||
<div> Testcase for Bug <a href="http://wkbug.com/98633">http://wkbug.com/98633</a>. The testcase checks if the height of a | ||
css table does not exceed the max-height value. The height of the table can be greater than max-height value when either | ||
min-height is greater than max-height or computed height of the content is greater than the max-height. | ||
</div> | ||
<br> | ||
<div class="container"> | ||
<div id="maxGreatThanMinHeightAutoLayout" class="child" style="min-height:100px; max-height:200px;" data-expected-height=200> | ||
This sub-test checks that when min-height is lesser than max-height, max-height is applied to a table with auto layout. | ||
</div> | ||
</div> | ||
<div class="container"> | ||
<div class="child" style="min-height:200px; max-height:100px;" data-expected-height=200> | ||
This sub-test checks that when min-height is greater than max-height, min-height is applied to a table with auto layout. | ||
</div> | ||
</div> | ||
<div class="container"> | ||
<div class="child" style="max-height:200px;" data-expected-height=200> | ||
This sub-test checks that max-height with fixed value is applied to a table with auto layout. | ||
</div> | ||
</div> | ||
<div class="container"> | ||
<div class="child" style="max-height:50%;" data-expected-height=200> | ||
This sub-test checks that max-height with percent value is applied to a table with auto layout. | ||
</div> | ||
</div> | ||
<div class="container"> | ||
<div class="child" style="max-height:50vh;" data-expected-height=300> | ||
This sub-test checks that max-height with viewport percent height value is applied to a table with auto layout. | ||
</div> | ||
</div> | ||
<div class="container"> | ||
<div class="child" style="max-height:25vw;" data-expected-height=200> | ||
This sub-test checks that max-height with viewport percent width value is applied to a table with auto layout. | ||
</div> | ||
</div> | ||
<div class="container"> | ||
<div class="child" style="max-height:100px;" data-expected-height=192> | ||
This sub-test checks that when content height is greater than max-height, content height is applied to the table with auto layout. | ||
<br><br>FILLER TEXT TO INCREASE CONTENT HEIGHT. | ||
</div> | ||
</div> | ||
<div class="container"> | ||
<div class="child fixed-table" style="height:auto;"> | ||
This test checks that when height of an auto-table is auto, there is are no asserts. No crash means the test passed. | ||
</div> | ||
</div> | ||
<div class="container"> | ||
<div class="child fixed-table" style="min-height:100px; max-height:200px;" data-expected-height=200> | ||
This sub-test checks that when min-height is lesser than max-height, max-height is applied to a table with fixed layout. | ||
</div> | ||
</div> | ||
<div class="container"> | ||
<div class="child fixed-table" style="min-height:200px; max-height:100px;" data-expected-height=200> | ||
This sub-test checks that when min-height is greater than max-height, min-height is applied to a table with fixed layout. | ||
</div> | ||
</div> | ||
<div class="container"> | ||
<div class="child fixed-table" style="max-height:200px;" data-expected-height=200> | ||
This sub-test checks that max-height with fixed value is applied to a table with fixed layout. | ||
</div> | ||
</div> | ||
<div class="container"> | ||
<div class="child fixed-table" style="max-height:50%;" data-expected-height=200> | ||
This sub-test checks that max-height with percent value is applied to a table with fixed layout. | ||
</div> | ||
</div> | ||
<div class="container"> | ||
<div class="child fixed-table" style="max-height:50vh;" data-expected-height=300> | ||
This sub-test checks that max-height with viewport percent height value is applied to a table with fixed layout. | ||
</div> | ||
</div> | ||
<div class="container"> | ||
<div class="child fixed-table" style="max-height:25vw;" data-expected-height=200> | ||
This sub-test checks that max-height with viewport percent width value is applied to a table with fixed layout. | ||
</div> | ||
</div> | ||
<div class="container"> | ||
<div class="child fixed-table" style="max-height:100px;" data-expected-height=192> | ||
This sub-test checks that when content height is greater than max-height, content height is applied to a table with fixed layout. | ||
<br><br>FILLER TEXT TO INCREASE CONTENT HEIGHT. | ||
</div> | ||
</div> | ||
<div class="container"> | ||
<div class="child fixed-table" style="height:auto;"> | ||
This test checks that when height of a fixed table is auto, there is are no asserts. No crash means the test passed. | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,32 @@ | ||
2012-11-27 Pravin D <[email protected]> | ||
|
||
max-height property not respected in case of tables | ||
https://bugs.webkit.org/show_bug.cgi?id=98633 | ||
|
||
Reviewed by Julien Chaffraix. | ||
|
||
The max-height property determines the maximum computed height an element can have. In case of tables | ||
the computed height was not being limited by the max-height property. The current patch fixes the same. | ||
|
||
Test: fast/table/css-table-max-height.html | ||
|
||
* rendering/RenderTable.cpp: | ||
(WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight): | ||
Helper function to compute height from the given style height. | ||
This function handles style height of type fixed, percent and viewport percent. | ||
As height of type 'calculated' gets internally resolved to either fixed or percent | ||
there is no special handling required for the same. | ||
|
||
(WebCore): | ||
(WebCore::RenderTable::layout): | ||
Logic to compute the logical height of an element such that it does not exceed the max-height value given that | ||
min-width < Content height < max-height, when min-height < max-height. | ||
However max-height value is not respected if either min-height > max-height or Content height > max-height. | ||
|
||
* rendering/RenderTable.h: | ||
(RenderTable): | ||
Function definition for the newly add function convertStyleLogicalHeightToComputedHeight(). | ||
|
||
2012-11-27 Roger Fong <[email protected]> | ||
|
||
Windows specific implementation of usesTileCacheLayer needed after r133056. | ||
|
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