Title: [104208] trunk
Revision
104208
Author
[email protected]
Date
2012-01-05 13:39:02 -0800 (Thu, 05 Jan 2012)

Log Message

IE quirk for percentage size on a table element doesn't work with orthogonal writing modes
https://bugs.webkit.org/show_bug.cgi?id=70195

Reviewed by Eric Seidel.

Source/WebCore:

Remove this quirk entirely. Mozilla and Opera don't implement it and IE
doesn't restrict the quirk to standards mode. As it's unlikely for
webkit-only content to hit this quirk (e.g. use tables for layout),
it should be relatively safe to match Mozilla/Opera here.

Test: fast/writing-mode/table-percent-width-quirk.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths):

LayoutTests:

* fast/table/032.html:
* fast/writing-mode/table-percent-width-quirk-expected.png: Added.
* fast/writing-mode/table-percent-width-quirk-expected.txt: Added.
* fast/writing-mode/table-percent-width-quirk.html: Added.
* platform/mac/fast/table/032-expected.png:
* platform/mac/fast/table/032-expected.txt:
* platform/mac/tables/mozilla/bugs/bug55694-expected.png:
* platform/mac/tables/mozilla/bugs/bug55694-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (104207 => 104208)


--- trunk/LayoutTests/ChangeLog	2012-01-05 21:37:08 UTC (rev 104207)
+++ trunk/LayoutTests/ChangeLog	2012-01-05 21:39:02 UTC (rev 104208)
@@ -1,3 +1,19 @@
+2012-01-05  Ojan Vafai  <[email protected]>
+
+        IE quirk for percentage size on a table element doesn't work with orthogonal writing modes
+        https://bugs.webkit.org/show_bug.cgi?id=70195
+
+        Reviewed by Eric Seidel.
+
+        * fast/table/032.html:
+        * fast/writing-mode/table-percent-width-quirk-expected.png: Added.
+        * fast/writing-mode/table-percent-width-quirk-expected.txt: Added.
+        * fast/writing-mode/table-percent-width-quirk.html: Added.
+        * platform/mac/fast/table/032-expected.png:
+        * platform/mac/fast/table/032-expected.txt:
+        * platform/mac/tables/mozilla/bugs/bug55694-expected.png:
+        * platform/mac/tables/mozilla/bugs/bug55694-expected.txt:
+
 2012-01-05  Eric Carlson  <[email protected]>
 
         Implement temporal dimension portion of Media Fragments URI specification for video/audio

Modified: trunk/LayoutTests/fast/table/032.html (104207 => 104208)


--- trunk/LayoutTests/fast/table/032.html	2012-01-05 21:37:08 UTC (rev 104207)
+++ trunk/LayoutTests/fast/table/032.html	2012-01-05 21:39:02 UTC (rev 104208)
@@ -1,11 +1,8 @@
-Because we're in quirks mode, you should see a 100x100 green square below.  If the square is
-only a couple of pixels wide or tall, then the test has failed.
-
+<!-- Should see a 6px by 100px green rectangle. -->
 <div style="position:absolute; width:100px; top:50px;">
 <div style="position:absolute;left:0px;top:50px;height:50px;background-color:green">
-		<table style="width:100%"><tr><td></table>
-	</div>
-
+	<table style="width:100%"><tr><td></table>
+</div>
 <div style="float:left; background-color:green; height:50px">
 <table style="width:100%"><tr><td></table>
 </div>

Added: trunk/LayoutTests/fast/writing-mode/table-percent-width-quirk-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/fast/writing-mode/table-percent-width-quirk-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/fast/writing-mode/table-percent-width-quirk-expected.txt (0 => 104208)


--- trunk/LayoutTests/fast/writing-mode/table-percent-width-quirk-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/writing-mode/table-percent-width-quirk-expected.txt	2012-01-05 21:39:02 UTC (rev 104208)
@@ -0,0 +1,56 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+layer at (8,50) size 100x50
+  RenderBlock (positioned) {DIV} at (8,50) size 100x50 [bgcolor=#808080]
+layer at (8,50) size 20x40
+  RenderBlock (positioned) {DIV} at (0,0) size 20x40 [bgcolor=#0000FF]
+    RenderBlock {DIV} at (0,0) size 20x20
+    RenderBlock {DIV} at (0,20) size 20x20 [bgcolor=#008000]
+      RenderBlock {DIV} at (0,0) size 20x20
+layer at (8,125) size 100x50
+  RenderBlock (positioned) {DIV} at (8,125) size 100x50 [bgcolor=#808080]
+layer at (8,125) size 20x40
+  RenderBlock (positioned) {DIV} at (0,0) size 20x40 [bgcolor=#0000FF]
+    RenderBlock {DIV} at (0,0) size 20x20
+    RenderTable {TABLE} at (0,20) size 20x20 [bgcolor=#008000]
+      RenderTableSection {TBODY} at (0,0) size 20x20
+        RenderTableRow {TR} at (0,0) size 20x20
+          RenderTableCell {TD} at (0,0) size 20x20 [r=0 c=0 rs=1 cs=1]
+            RenderBlock {DIV} at (0,0) size 20x20
+layer at (692,200) size 100x50
+  RenderBlock (positioned) {DIV} at (692,200) size 100x50 [bgcolor=#808080]
+layer at (752,200) size 40x20
+  RenderBlock (positioned) {DIV} at (0,0) size 40x20 [bgcolor=#0000FF]
+    RenderBlock {DIV} at (0,0) size 20x20
+    RenderTable {TABLE} at (20,0) size 20x20 [bgcolor=#008000]
+      RenderTableSection {TBODY} at (0,0) size 20x20
+        RenderTableRow {TR} at (0,0) size 20x20
+          RenderTableCell {TD} at (0,0) size 20x20 [r=0 c=0 rs=1 cs=1]
+            RenderBlock {DIV} at (0,0) size 20x20
+layer at (692,275) size 100x50
+  RenderBlock (positioned) {DIV} at (692,275) size 100x50 [bgcolor=#808080]
+layer at (752,275) size 40x20
+  RenderBlock (positioned) {DIV} at (0,0) size 40x20 [bgcolor=#0000FF]
+    RenderBlock {DIV} at (0,0) size 20x20
+    RenderBlock {DIV} at (20,0) size 20x20 [bgcolor=#008000]
+      RenderBlock {DIV} at (0,0) size 20x20
+layer at (692,350) size 100x50
+  RenderBlock (positioned) {DIV} at (692,350) size 100x50 [bgcolor=#808080]
+layer at (-13,350) size 805x20 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 outlineClip at (0,0) size 800x600
+  RenderBlock (positioned) {DIV} at (0,0) size 805x20 [bgcolor=#0000FF]
+    RenderBlock {DIV} at (0,0) size 20x20
+    RenderTable {TABLE} at (20,0) size 785x20 [bgcolor=#008000]
+      RenderTableSection {TBODY} at (0,0) size 785x20
+        RenderTableRow {TR} at (0,0) size 785x20
+          RenderTableCell {TD} at (0,0) size 785x20 [r=0 c=0 rs=1 cs=1]
+            RenderBlock {DIV} at (0,0) size 20x20
+layer at (692,425) size 100x50
+  RenderBlock (positioned) {DIV} at (692,425) size 100x50 [bgcolor=#808080]
+layer at (-13,425) size 805x20 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 outlineClip at (0,0) size 800x600
+  RenderBlock (positioned) {DIV} at (0,0) size 805x20 [bgcolor=#0000FF]
+    RenderBlock {DIV} at (0,0) size 20x20
+    RenderBlock {DIV} at (20,0) size 785x20 [bgcolor=#008000]
+      RenderBlock {DIV} at (0,0) size 20x20
Property changes on: trunk/LayoutTests/fast/writing-mode/table-percent-width-quirk-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/fast/writing-mode/table-percent-width-quirk.html (0 => 104208)


--- trunk/LayoutTests/fast/writing-mode/table-percent-width-quirk.html	                        (rev 0)
+++ trunk/LayoutTests/fast/writing-mode/table-percent-width-quirk.html	2012-01-05 21:39:02 UTC (rev 104208)
@@ -0,0 +1,53 @@
+<style>
+* {
+    font-size: 16px;
+    font-family: Times;
+    padding: 0;
+    border-spacing: 0;
+    line-height: 10px;
+}
+.vertical {
+    -webkit-writing-mode: vertical-rl;
+    writing-mode: tb-rl;
+}
+.horizontal {
+     -webkit-writing-mode: horizontal-tb;
+     writing-mode: lr-tb;
+}
+.container {
+    width: 100px;
+    height: 50px;
+    position: absolute;
+    background-color: grey;
+}
+.positioned-child {
+    position: absolute;
+    background-color: blue;
+}
+.leaf {
+    background-color: green;
+}
+.content {
+    height: 20px;
+    width: 20px;
+}
+</style>
+<!-- Each pair of cases below should render the same. -->
+<div class="container" style="top: 50px">
+    <div class="positioned-child"><div class="content"></div><div class="leaf" style="width: 100%;"><div class="content"></div></div></div>
+</div>
+<div class="container" style="top: 125px">
+    <div class="positioned-child"><div class="content"></div><table class="leaf" style="width: 100%;"><tr><td><div class="content"></div></table></div>
+</div>
+<div class="container vertical" style="top: 200px">
+    <div class="positioned-child"><div class="content"></div><table class="leaf" style="height: 100%;"><tr><td><div class="content"></div></table></div>
+</div>
+<div class="container vertical" style="top: 275px">
+    <div class="positioned-child"><div class="content"></div><div class="leaf" style="height: 100%;"><div class="content"></div></div></div>
+</div>
+<div class="container vertical" style="top: 350px">
+    <div class="positioned-child"><div class="content"></div><table class="leaf horizontal" style="width: 100%;"><tr><td><div class="content"></div></table></div>
+</div>
+<div class="container vertical" style="top: 425px">
+    <div class="positioned-child"><div class="content"></div><div class="leaf horizontal" style="width: 100%;"><div class="content"></div></div></div>
+</div>
Property changes on: trunk/LayoutTests/fast/writing-mode/table-percent-width-quirk.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/LayoutTests/platform/mac/fast/table/032-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/fast/table/032-expected.txt (104207 => 104208)


--- trunk/LayoutTests/platform/mac/fast/table/032-expected.txt	2012-01-05 21:37:08 UTC (rev 104207)
+++ trunk/LayoutTests/platform/mac/fast/table/032-expected.txt	2012-01-05 21:39:02 UTC (rev 104208)
@@ -3,21 +3,16 @@
 layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
-      RenderText {#text} at (0,0) size 771x36
-        text run at (0,0) width 497: "Because we're in quirks mode, you should see a 100x100 green square below. "
-        text run at (497,0) width 274: "If the square is only a couple of pixels wide"
-        text run at (0,18) width 187: "or tall, then the test has failed."
-      RenderText {#text} at (0,0) size 0x0
 layer at (8,50) size 100x50
   RenderBlock (positioned) {DIV} at (8,50) size 100x50
-    RenderBlock (floating) {DIV} at (0,0) size 100x50 [bgcolor=#008000]
-      RenderTable {TABLE} at (0,0) size 100x6
-        RenderTableSection {TBODY} at (0,0) size 100x6
-          RenderTableRow {TR} at (0,2) size 100x2
-            RenderTableCell {TD} at (2,2) size 96x2 [r=0 c=0 rs=1 cs=1]
-layer at (8,100) size 100x50
-  RenderBlock (positioned) {DIV} at (0,50) size 100x50 [bgcolor=#008000]
-    RenderTable {TABLE} at (0,0) size 100x6
-      RenderTableSection {TBODY} at (0,0) size 100x6
-        RenderTableRow {TR} at (0,2) size 100x2
-          RenderTableCell {TD} at (2,2) size 96x2 [r=0 c=0 rs=1 cs=1]
+    RenderBlock (floating) {DIV} at (0,0) size 6x50 [bgcolor=#008000]
+      RenderTable {TABLE} at (0,0) size 6x6
+        RenderTableSection {TBODY} at (0,0) size 6x6
+          RenderTableRow {TR} at (0,2) size 6x2
+            RenderTableCell {TD} at (2,2) size 2x2 [r=0 c=0 rs=1 cs=1]
+layer at (8,100) size 6x50
+  RenderBlock (positioned) {DIV} at (0,50) size 6x50 [bgcolor=#008000]
+    RenderTable {TABLE} at (0,0) size 6x6
+      RenderTableSection {TBODY} at (0,0) size 6x6
+        RenderTableRow {TR} at (0,2) size 6x2
+          RenderTableCell {TD} at (2,2) size 2x2 [r=0 c=0 rs=1 cs=1]

Modified: trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug55694-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug55694-expected.txt (104207 => 104208)


--- trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug55694-expected.txt	2012-01-05 21:37:08 UTC (rev 104207)
+++ trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug55694-expected.txt	2012-01-05 21:39:02 UTC (rev 104208)
@@ -30,12 +30,12 @@
         RenderBR {BR} at (392,14) size 0x0
         RenderText {#text} at (0,18) size 140x18
           text run at (0,18) width 140: "No width has been set"
-layer at (8,70) size 792x28
-  RenderBlock (positioned) {DIV} at (8,70) size 792x28 [bgcolor=#CCFFCC]
-    RenderTable {TABLE} at (0,0) size 792x28 [border: (1px outset #808080)]
-      RenderTableSection {TBODY} at (1,1) size 790x26
-        RenderTableRow {TR} at (0,2) size 790x22
-          RenderTableCell {TD} at (2,2) size 786x22 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
+layer at (8,70) size 140x28
+  RenderBlock (positioned) {DIV} at (8,70) size 140x28 [bgcolor=#CCFFCC]
+    RenderTable {TABLE} at (0,0) size 140x28 [border: (1px outset #808080)]
+      RenderTableSection {TBODY} at (1,1) size 138x26
+        RenderTableRow {TR} at (0,2) size 138x22
+          RenderTableCell {TD} at (2,2) size 134x22 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
             RenderText {#text} at (2,2) size 130x18
               text run at (2,2) width 130: "Table width = 100%"
 layer at (8,200) size 784x28

Modified: trunk/Source/WebCore/ChangeLog (104207 => 104208)


--- trunk/Source/WebCore/ChangeLog	2012-01-05 21:37:08 UTC (rev 104207)
+++ trunk/Source/WebCore/ChangeLog	2012-01-05 21:39:02 UTC (rev 104208)
@@ -1,3 +1,20 @@
+2012-01-05  Ojan Vafai  <[email protected]>
+
+        IE quirk for percentage size on a table element doesn't work with orthogonal writing modes
+        https://bugs.webkit.org/show_bug.cgi?id=70195
+
+        Reviewed by Eric Seidel.
+
+        Remove this quirk entirely. Mozilla and Opera don't implement it and IE
+        doesn't restrict the quirk to standards mode. As it's unlikely for
+        webkit-only content to hit this quirk (e.g. use tables for layout),
+        it should be relatively safe to match Mozilla/Opera here.
+
+        Test: fast/writing-mode/table-percent-width-quirk.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
+
 2012-01-05  Tien Ren Chen  <[email protected]>
 
         [chromium] Add CCTimer class for the compositor

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (104207 => 104208)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2012-01-05 21:37:08 UTC (rev 104207)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2012-01-05 21:39:02 UTC (rev 104208)
@@ -5442,29 +5442,6 @@
                 floatRightWidth += w;
         } else
             m_maxPreferredLogicalWidth = max(w, m_maxPreferredLogicalWidth);
-
-        // A very specific WinIE quirk.
-        // Example:
-        /*
-           <div style="position:absolute; width:100px; top:50px;">
-              <div style="position:absolute;left:0px;top:50px;height:50px;background-color:green">
-                <table style="width:100%"><tr><td></table>
-              </div>
-           </div>
-        */
-        // In the above example, the inner absolute positioned block should have a computed width
-        // of 100px because of the table.
-        // We can achieve this effect by making the maxwidth of blocks that contain tables
-        // with percentage widths be infinite (as long as they are not inside a table cell).
-        // FIXME: There is probably a bug here with orthogonal writing modes since we check logicalWidth only using the child's writing mode.
-        if (containingBlock && document()->inQuirksMode() && child->style()->logicalWidth().isPercent()
-            && !isTableCell() && child->isTable() && m_maxPreferredLogicalWidth < BLOCK_MAX_WIDTH) {
-            RenderBlock* cb = containingBlock;
-            while (!cb->isRenderView() && !cb->isTableCell())
-                cb = cb->containingBlock();
-            if (!cb->isTableCell())
-                m_maxPreferredLogicalWidth = BLOCK_MAX_WIDTH;
-        }
         
         child = child->nextSibling();
     }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to