Commit 2134a7cb authored by tkent@chromium.org's avatar tkent@chromium.org
Browse files

2011-01-24 Kent Tamura <tkent@chromium.org>

        Reviewed by Dimitri Glazkov.

        [Windows] Textfield <input>s have different widths.
        https://bugs.webkit.org/show_bug.cgi?id=48405

        * fast/forms/input-widths-expected.txt: Added.
        * fast/forms/input-widths.html: Added.
2011-01-24  Kent Tamura  <tkent@chromium.org>

        Reviewed by Dimitri Glazkov.

        [Windows] Textfield <input>s have different widths.
        https://bugs.webkit.org/show_bug.cgi?id=48405

        - Apply the padding override for type=text to other textfield types too.
        - Reset margin value of outer spin button, which is not used in Windows.
        - Don't add inner spin button width to the preferred text field width.
          Text fields should have the identical widths regardless of the
          existence of spin buttons.

        Test: fast/forms/input-widths.html

        * css/themeWin.css:
        (input[type="week"]):
        (input[type="week"]:disabled):
        (input[type="search"]::-webkit-search-cancel-button):
        (input::-webkit-outer-spin-button):
        * rendering/RenderTextControlSingleLine.cpp:
        (WebCore::RenderTextControlSingleLine::preferredContentWidth):
        Don't add inner spin button width to the preferred width.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76567 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ee540fdb
2011-01-24 Kent Tamura <tkent@chromium.org>
Reviewed by Dimitri Glazkov.
[Windows] Textfield <input>s have different widths.
https://bugs.webkit.org/show_bug.cgi?id=48405
* fast/forms/input-widths-expected.txt: Added.
* fast/forms/input-widths.html: Added.
2011-01-24 Kent Tamura <tkent@chromium.org>
 
Reviewed by Dimitri Glazkov.
......
Text field types should have the same default widths.
PASS document.getElementById("email").offsetWidth is baseWidth
PASS document.getElementById("number").offsetWidth is baseWidth
PASS document.getElementById("password").offsetWidth is baseWidth
PASS document.getElementById("tel").offsetWidth is baseWidth
PASS document.getElementById("url").offsetWidth is baseWidth
PASS document.getElementById("color").offsetWidth is baseWidth
PASS document.getElementById("date").offsetWidth is baseWidth
PASS document.getElementById("datetime").offsetWidth is baseWidth
PASS document.getElementById("datetimelocal").offsetWidth is baseWidth
PASS document.getElementById("month").offsetWidth is baseWidth
PASS document.getElementById("time").offsetWidth is baseWidth
PASS document.getElementById("week").offsetWidth is baseWidth
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<p id="description">Text field types should have the same default widths.</p>
<div id="console"></div>
<div id=parent>
<input type=text id=text>
<input type=email id=email>
<input type=number id=number>
<input type=password id=password>
<input type=tel id=tel>
<input type=url id=url>
<input type=color id=color>
<input type=date id=date>
<input type=datetime id=datetime>
<input type=datetime-local id=datetimelocal>
<input type=month id=month>
<input type=time id=time>
<input type=week id=week>
</div>
<script>
var baseWidth = document.getElementById('text').offsetWidth;
shouldBe('document.getElementById("email").offsetWidth', 'baseWidth');
shouldBe('document.getElementById("number").offsetWidth', 'baseWidth');
shouldBe('document.getElementById("password").offsetWidth', 'baseWidth');
shouldBe('document.getElementById("tel").offsetWidth', 'baseWidth');
shouldBe('document.getElementById("url").offsetWidth', 'baseWidth');
// type=search is not tested intentionally.
// The folloiwng types should be removed when dedicated UIs are implemented.
shouldBe('document.getElementById("color").offsetWidth', 'baseWidth');
shouldBe('document.getElementById("date").offsetWidth', 'baseWidth');
shouldBe('document.getElementById("datetime").offsetWidth', 'baseWidth');
shouldBe('document.getElementById("datetimelocal").offsetWidth', 'baseWidth');
shouldBe('document.getElementById("month").offsetWidth', 'baseWidth');
shouldBe('document.getElementById("time").offsetWidth', 'baseWidth');
shouldBe('document.getElementById("week").offsetWidth', 'baseWidth');
document.getElementById('parent').innerHTML = '';
var successfullyParsed = true;
</script>
<script src="../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
2011-01-24 Kent Tamura <tkent@chromium.org>
Reviewed by Dimitri Glazkov.
[Windows] Textfield <input>s have different widths.
https://bugs.webkit.org/show_bug.cgi?id=48405
- Apply the padding override for type=text to other textfield types too.
- Reset margin value of outer spin button, which is not used in Windows.
- Don't add inner spin button width to the preferred text field width.
Text fields should have the identical widths regardless of the
existence of spin buttons.
Test: fast/forms/input-widths.html
* css/themeWin.css:
(input[type="week"]):
(input[type="week"]:disabled):
(input[type="search"]::-webkit-search-cancel-button):
(input::-webkit-outer-spin-button):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::preferredContentWidth):
Don't add inner spin button width to the preferred width.
2011-01-24 Kent Tamura <tkent@chromium.org>
 
Reviewed by Dimitri Glazkov.
......@@ -33,8 +33,19 @@
making our form elements match Firefox's. */
input:not([type]),
input[type="color"],
input[type="date"],
input[type="datetime"],
input[type="datetime-local"],
input[type="email"],
input[type="month"],
input[type="number"],
input[type="password"],
input[type="tel"],
input[type="text"],
input[type="password"] {
input[type="time"],
input[type="url"],
input[type="week"] {
padding:1px 0;
}
......@@ -59,14 +70,25 @@ input[type="radio"] {
*/
textarea:disabled,
input:not([type]):disabled,
input[type="text"]:disabled,
input[type="color"]:disabled,
input[type="date"]:disabled,
input[type="datetime"]:disabled,
input[type="datetime-local"]:disabled,
input[type="email"]:disabled,
input[type="month"]:disabled,
input[type="password"]:disabled,
input[type="search"]:disabled {
input[type="number"]:disabled,
input[type="search"]:disabled,
input[type="tel"]:disabled,
input[type="text"]:disabled,
input[type="time"]:disabled,
input[type="url"]:disabled,
input[type="week"]:disabled {
background-color: #EBEBE4;
}
input[type="search"]::-webkit-search-cancel-button {
margin-right: 3px;
margin-right: 3px;
}
input[type="search"]::-webkit-search-results-decoration {
......@@ -77,6 +99,10 @@ input[type="search"]::-webkit-search-results-button {
margin: 0 3px 0 2px;
}
input::-webkit-outer-spin-button {
margin: 0;
}
input[type="button"], input[type="submit"], input[type="reset"], input[type="file"]::-webkit-file-upload-button, button {
padding: 1px 6px;
}
......
......@@ -560,9 +560,6 @@ int RenderTextControlSingleLine::preferredContentWidth(float charWidth) const
result += cancelRenderer->borderLeft() + cancelRenderer->borderRight() +
cancelRenderer->paddingLeft() + cancelRenderer->paddingRight();
if (RenderBox* spinRenderer = m_innerSpinButton ? m_innerSpinButton->renderBox() : 0)
result += spinRenderer->minPreferredLogicalWidth();
#if ENABLE(INPUT_SPEECH)
if (RenderBox* speechRenderer = m_speechButton ? m_speechButton->renderBox() : 0) {
result += speechRenderer->borderLeft() + speechRenderer->borderRight() +
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment