Title: [122290] trunk
- Revision
- 122290
- Author
- [email protected]
- Date
- 2012-07-10 20:11:30 -0700 (Tue, 10 Jul 2012)
Log Message
REGRESSION(r112113): absolutely positioned INPUT boxes with a table cell containing block have a 0px height
https://bugs.webkit.org/show_bug.cgi?id=89209
Reviewed by Ojan Vafai.
Source/WebCore:
Test: fast/forms/input-in-table-cell-no-value.html
The issue comes from the layout code not properly resetting the overriden heigth between layouts.
The test case relies on a table cell as it requires a 2 pass layout. Between the 2 passes, different
code paths would be taken, leading to previous values being used to over-constrain the inner content.
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout):
Ensure consistent layout by resetting any overriden conditional height.
LayoutTests:
The 2 tests are very close and differ by the use of min-height. This forces some content to be visible in the expected result
but not in the original test case.
* fast/forms/input-in-table-cell-no-value-expected.html: Added.
* fast/forms/input-in-table-cell-no-value.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (122289 => 122290)
--- trunk/LayoutTests/ChangeLog 2012-07-11 02:26:53 UTC (rev 122289)
+++ trunk/LayoutTests/ChangeLog 2012-07-11 03:11:30 UTC (rev 122290)
@@ -1,3 +1,16 @@
+2012-07-10 Julien Chaffraix <[email protected]>
+
+ REGRESSION(r112113): absolutely positioned INPUT boxes with a table cell containing block have a 0px height
+ https://bugs.webkit.org/show_bug.cgi?id=89209
+
+ Reviewed by Ojan Vafai.
+
+ The 2 tests are very close and differ by the use of min-height. This forces some content to be visible in the expected result
+ but not in the original test case.
+
+ * fast/forms/input-in-table-cell-no-value-expected.html: Added.
+ * fast/forms/input-in-table-cell-no-value.html: Added.
+
2012-07-10 Kevin Ellis <[email protected]>
Input elements with type=range do not have default touch handlers.
Added: trunk/LayoutTests/fast/forms/input-in-table-cell-no-value-expected.html (0 => 122290)
--- trunk/LayoutTests/fast/forms/input-in-table-cell-no-value-expected.html (rev 0)
+++ trunk/LayoutTests/fast/forms/input-in-table-cell-no-value-expected.html 2012-07-11 03:11:30 UTC (rev 122290)
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+td
+{
+ position: relative;
+ height: 50px;
+}
+
+input
+{
+ position: absolute;
+ width: 100px;
+ top: 2px;
+ bottom: 2px;
+ min-height: 10px;
+}
+</style>
+</head>
+<p>Test for bug <a href="" REGRESSION(r112113): absolutely positioned INPUT boxes with a table cell containing block have a 0px height</p>
+<p>This test passes if you can see some text inside the <input> boxes</p>
+<table>
+<tr>
+ <td>Single line text input</td>
+ <td><input type="number" value="1"></input></td>
+</tr>
+<tr>
+ <td>Text input <br/> spanning <br/> multiple lines.</td>
+ <td><input type="date" value="2000-01-01"></input></td>
+</tr>
+</table>
+</html>
Added: trunk/LayoutTests/fast/forms/input-in-table-cell-no-value.html (0 => 122290)
--- trunk/LayoutTests/fast/forms/input-in-table-cell-no-value.html (rev 0)
+++ trunk/LayoutTests/fast/forms/input-in-table-cell-no-value.html 2012-07-11 03:11:30 UTC (rev 122290)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+td
+{
+ position: relative;
+ height: 50px;
+}
+
+input
+{
+ position: absolute;
+ width: 100px;
+ top: 2px;
+ bottom: 2px;
+}
+</style>
+</head>
+<p>Test for bug <a href="" REGRESSION(r112113): absolutely positioned INPUT boxes with a table cell containing block have a 0px height</p>
+<p>This test passes if you can see some text inside the <input> boxes</p>
+<table>
+<tr>
+ <td>Single line text input</td>
+ <td><input type="number" value="1"></input></td>
+</tr>
+<tr>
+ <td>Text input <br/> spanning <br/> multiple lines.</td>
+ <td><input type="date" value="2000-01-01"></input></td>
+</tr>
+</table>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (122289 => 122290)
--- trunk/Source/WebCore/ChangeLog 2012-07-11 02:26:53 UTC (rev 122289)
+++ trunk/Source/WebCore/ChangeLog 2012-07-11 03:11:30 UTC (rev 122290)
@@ -1,3 +1,21 @@
+2012-07-10 Julien Chaffraix <[email protected]>
+
+ REGRESSION(r112113): absolutely positioned INPUT boxes with a table cell containing block have a 0px height
+ https://bugs.webkit.org/show_bug.cgi?id=89209
+
+ Reviewed by Ojan Vafai.
+
+ Test: fast/forms/input-in-table-cell-no-value.html
+
+ The issue comes from the layout code not properly resetting the overriden heigth between layouts.
+
+ The test case relies on a table cell as it requires a 2 pass layout. Between the 2 passes, different
+ code paths would be taken, leading to previous values being used to over-constrain the inner content.
+
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::layout):
+ Ensure consistent layout by resetting any overriden conditional height.
+
2012-07-10 Kevin Ellis <[email protected]>
Input elements with type=range do not have default touch handlers.
Modified: trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp (122289 => 122290)
--- trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp 2012-07-11 02:26:53 UTC (rev 122289)
+++ trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp 2012-07-11 03:11:30 UTC (rev 122290)
@@ -124,11 +124,17 @@
// and type=search if the text height is taller than the contentHeight()
// because of compability.
- RenderBlock::layoutBlock(false);
-
RenderBox* innerTextRenderer = innerTextElement()->renderBox();
ASSERT(innerTextRenderer);
RenderBox* innerBlockRenderer = innerBlockElement() ? innerBlockElement()->renderBox() : 0;
+
+ // To ensure consistency between layouts, we need to reset any conditionally overriden height.
+ innerTextRenderer->style()->setHeight(Length(Auto));
+ if (innerBlockRenderer)
+ innerBlockRenderer->style()->setHeight(Length(Auto));
+
+ RenderBlock::layoutBlock(false);
+
HTMLElement* container = containerElement();
RenderBox* containerRenderer = container ? container->renderBox() : 0;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes