Title: [123492] trunk
Revision
123492
Author
jchaffr...@webkit.org
Date
2012-07-24 10:44:29 -0700 (Tue, 24 Jul 2012)

Log Message

inline-table wrapper should be generated for display: inline element only
https://bugs.webkit.org/show_bug.cgi?id=92054

Reviewed by Abhishek Arya.

Source/WebCore:

CSS 2.1 only takes into account the display when determining if we should generate
an inline-table. My misreading of the spec would make us generate an inline-table
wrapper for any inline formatting context.

Test: fast/table/inline-block-generates-table-wrapper.html

* rendering/RenderTable.cpp:
(WebCore::RenderTable::createAnonymousWithParentRenderer):
Changed to use display instead of isInline to properly match the spec.

LayoutTests:

For some reason, using dumpAsText didn't dump the 2 lines properly so the test
is a reftest to work-around that.

* fast/table/inline-block-generates-table-wrapper-expected.html: Added.
* fast/table/inline-block-generates-table-wrapper.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (123491 => 123492)


--- trunk/LayoutTests/ChangeLog	2012-07-24 17:19:15 UTC (rev 123491)
+++ trunk/LayoutTests/ChangeLog	2012-07-24 17:44:29 UTC (rev 123492)
@@ -1,3 +1,16 @@
+2012-07-24  Julien Chaffraix  <jchaffr...@webkit.org>
+
+        inline-table wrapper should be generated for display: inline element only
+        https://bugs.webkit.org/show_bug.cgi?id=92054
+
+        Reviewed by Abhishek Arya.
+
+        For some reason, using dumpAsText didn't dump the 2 lines properly so the test
+        is a reftest to work-around that.
+
+        * fast/table/inline-block-generates-table-wrapper-expected.html: Added.
+        * fast/table/inline-block-generates-table-wrapper.html: Added.
+
 2012-07-24  Terry Anderson  <tdander...@chromium.org>
 
         [chromium] Unskip tests in fast/hidpi

Added: trunk/LayoutTests/fast/table/inline-block-generates-table-wrapper-expected.html (0 => 123492)


--- trunk/LayoutTests/fast/table/inline-block-generates-table-wrapper-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/inline-block-generates-table-wrapper-expected.html	2012-07-24 17:44:29 UTC (rev 123492)
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<style>
+<head>
+.wrapper {
+    display: inline-block;
+}
+.table {
+    display: table;
+}
+.cell {
+    display: table-cell;
+}
+</style>
+</head>
+<body>
+<p>Bug 92054: inline-table wrapper should be generated for display: inline element only.</p>
+<p>This test checks that we don't generate an inline-table wrapper inside an inline-block.</p>
+<p>This test has PASSED if there is 2 lines below.</p>
+<div class="wrapper"><span>First line.</span><span class="table"><span class="cell">Second line.</span></span></div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/table/inline-block-generates-table-wrapper.html (0 => 123492)


--- trunk/LayoutTests/fast/table/inline-block-generates-table-wrapper.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/inline-block-generates-table-wrapper.html	2012-07-24 17:44:29 UTC (rev 123492)
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<style>
+<head>
+.wrapper {
+    display: inline-block;
+}
+.cell {
+    display: table-cell;
+}
+</style>
+</head>
+<body>
+<p>Bug 92054: inline-table wrapper should be generated for display: inline element only.</p>
+<p>This test checks that we don't generate an inline-table wrapper inside an inline-block.</p>
+<p>This test has PASSED if there is 2 lines below.</p>
+<div class="wrapper"><span>First line.</span><span class="cell">Second line.</span></div>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (123491 => 123492)


--- trunk/Source/WebCore/ChangeLog	2012-07-24 17:19:15 UTC (rev 123491)
+++ trunk/Source/WebCore/ChangeLog	2012-07-24 17:44:29 UTC (rev 123492)
@@ -1,3 +1,20 @@
+2012-07-24  Julien Chaffraix  <jchaffr...@webkit.org>
+
+        inline-table wrapper should be generated for display: inline element only
+        https://bugs.webkit.org/show_bug.cgi?id=92054
+
+        Reviewed by Abhishek Arya.
+
+        CSS 2.1 only takes into account the display when determining if we should generate
+        an inline-table. My misreading of the spec would make us generate an inline-table
+        wrapper for any inline formatting context.
+
+        Test: fast/table/inline-block-generates-table-wrapper.html
+
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::createAnonymousWithParentRenderer):
+        Changed to use display instead of isInline to properly match the spec.
+
 2012-07-24  Alec Flett  <alecfl...@chromium.org>
 
         IndexedDB: Temporarily continue generating backend keys for empty key lists

Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (123491 => 123492)


--- trunk/Source/WebCore/rendering/RenderTable.cpp	2012-07-24 17:19:15 UTC (rev 123491)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp	2012-07-24 17:44:29 UTC (rev 123492)
@@ -1297,7 +1297,7 @@
 RenderTable* RenderTable::createAnonymousWithParentRenderer(const RenderObject* parent)
 {
     // CSS 2.1, section 17.2.1: "If a proper table child's parent is an 'inline' box, then the generated anonymous table must be an 'inline-table' box".
-    EDisplay tableDisplay = parent->isInline() ? INLINE_TABLE : TABLE;
+    EDisplay tableDisplay = parent->style()->display() == INLINE ? INLINE_TABLE : TABLE;
     RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(parent->style(), tableDisplay);
     RenderTable* newTable = new (parent->renderArena()) RenderTable(parent->document() /* is anonymous */);
     newTable->setStyle(newStyle.release());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to