Title: [130716] trunk
- Revision
- 130716
- Author
- [email protected]
- Date
- 2012-10-08 19:18:20 -0700 (Mon, 08 Oct 2012)
Log Message
Take account of overflowing values for width calculation of a year sub-field
https://bugs.webkit.org/show_bug.cgi?id=98506
Reviewed by Eric Seidel.
Source/WebCore:
When we decide the width of a year field of an input[type=date]
with the multiple fields UI, we need to take account of the
current value width because we allow to set overflowing values to
the input[type=date].
This change affects only platforms with INPUT_TYPE_DATE &&
INPUT_MULTIPLE_FIELDS_UI.
Test: fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value.html
* html/shadow/DateTimeNumericFieldElement.cpp:
(WebCore::DateTimeNumericFieldElement::customStyleForRenderer):
Take account of the current value width.
LayoutTests:
* fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value-expected.txt: Added.
* fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (130715 => 130716)
--- trunk/LayoutTests/ChangeLog 2012-10-09 01:52:58 UTC (rev 130715)
+++ trunk/LayoutTests/ChangeLog 2012-10-09 02:18:20 UTC (rev 130716)
@@ -1,3 +1,13 @@
+2012-10-08 Kent Tamura <[email protected]>
+
+ Take account of overflowing values for width calculation of a year sub-field
+ https://bugs.webkit.org/show_bug.cgi?id=98506
+
+ Reviewed by Eric Seidel.
+
+ * fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value-expected.txt: Added.
+ * fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value.html: Added.
+
2012-10-08 Tony Chang <[email protected]>
image not displayed in flexbox
Added: trunk/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value-expected.txt (0 => 130716)
--- trunk/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value-expected.txt 2012-10-09 02:18:20 UTC (rev 130716)
@@ -0,0 +1,11 @@
+Change multiple fields date input UI layout by value
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS widthOfEmptyValue < widthOfOverflowValue is true
+PASS widthOfEmptyValue is widthOfValidValue
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value.html (0 => 130716)
--- trunk/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value.html (rev 0)
+++ trunk/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value.html 2012-10-09 02:18:20 UTC (rev 130716)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<script>
+description('Change multiple fields date input UI layout by value');
+var testInput = document.createElement('input');
+testInput.type = 'date';
+testInput.max = '9999-12-31';
+document.body.appendChild(testInput);
+var widthOfEmptyValue = testInput.offsetWidth;
+
+testInput.value = '10000-01-01';
+var widthOfOverflowValue = testInput.offsetWidth;
+shouldBeTrue('widthOfEmptyValue < widthOfOverflowValue');
+
+testInput.value = '2012-10-05';
+var widthOfValidValue = testInput.offsetWidth;
+shouldBe('widthOfEmptyValue', 'widthOfValidValue');
+
+document.body.removeChild(testInput);
+</script>
+<script src=""
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (130715 => 130716)
--- trunk/Source/WebCore/ChangeLog 2012-10-09 01:52:58 UTC (rev 130715)
+++ trunk/Source/WebCore/ChangeLog 2012-10-09 02:18:20 UTC (rev 130716)
@@ -1,3 +1,24 @@
+2012-10-08 Kent Tamura <[email protected]>
+
+ Take account of overflowing values for width calculation of a year sub-field
+ https://bugs.webkit.org/show_bug.cgi?id=98506
+
+ Reviewed by Eric Seidel.
+
+ When we decide the width of a year field of an input[type=date]
+ with the multiple fields UI, we need to take account of the
+ current value width because we allow to set overflowing values to
+ the input[type=date].
+
+ This change affects only platforms with INPUT_TYPE_DATE &&
+ INPUT_MULTIPLE_FIELDS_UI.
+
+ Test: fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value.html
+
+ * html/shadow/DateTimeNumericFieldElement.cpp:
+ (WebCore::DateTimeNumericFieldElement::customStyleForRenderer):
+ Take account of the current value width.
+
2012-10-08 Tony Chang <[email protected]>
image not displayed in flexbox
Modified: trunk/Source/WebCore/html/shadow/DateTimeNumericFieldElement.cpp (130715 => 130716)
--- trunk/Source/WebCore/html/shadow/DateTimeNumericFieldElement.cpp 2012-10-09 01:52:58 UTC (rev 130715)
+++ trunk/Source/WebCore/html/shadow/DateTimeNumericFieldElement.cpp 2012-10-09 02:18:20 UTC (rev 130716)
@@ -81,6 +81,7 @@
RefPtr<RenderStyle> style = RenderStyle::clone(originalStyle.get());
float maxiumWidth = style->font().width(m_placeholder);
maxiumWidth = std::max(maxiumWidth, style->font().width(formatValue(maximum())));
+ maxiumWidth = std::max(maxiumWidth, style->font().width(value()));
style->setWidth(Length(maxiumWidth, Fixed));
return style.release();
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes