diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-31 20:23:39 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-31 20:23:39 +0000 |
commit | 8acfeb388ff606818c6c05bfbff1c567a403f5b9 (patch) | |
tree | 770404f80a834b4f05508ea878f55438d6406f0a | |
parent | ab0e2220a2038f42c47ce6cf68691cc0e24b3eb0 (diff) | |
download | chromium_src-8acfeb388ff606818c6c05bfbff1c567a403f5b9.zip chromium_src-8acfeb388ff606818c6c05bfbff1c567a403f5b9.tar.gz chromium_src-8acfeb388ff606818c6c05bfbff1c567a403f5b9.tar.bz2 |
Adjust the readonly form control state to no longer look
disabled. This matches other browsers and is roughly
the patch I sent upstream.
Our classic mode text inputs still needs some love, but
I will do that in a separate change.
BUG=1542
Review URL: http://codereview.chromium.org/8941
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4316 0039d316-1c4b-4281-b951-d872f2087c98
8 files changed, 11 insertions, 17 deletions
diff --git a/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-appearance-readonly-expected.checksum b/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-appearance-readonly-expected.checksum index 6d72a65..c901478 100644 --- a/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-appearance-readonly-expected.checksum +++ b/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-appearance-readonly-expected.checksum @@ -1 +1 @@ -6e3a71182acc3aea2dde9ef466061e04
\ No newline at end of file +2a8fcbf03fceabdc26b9d90f28235082
\ No newline at end of file diff --git a/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-appearance-readonly-expected.png b/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-appearance-readonly-expected.png Binary files differindex a4fbb76..9549e45 100644 --- a/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-appearance-readonly-expected.png +++ b/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-appearance-readonly-expected.png diff --git a/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-readonly-dimmed-expected.checksum b/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-readonly-dimmed-expected.checksum index fef75e6..b54bba8c 100644 --- a/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-readonly-dimmed-expected.checksum +++ b/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-readonly-dimmed-expected.checksum @@ -1 +1 @@ -df9c7fad4c3e7ab48eab54b633f690cd
\ No newline at end of file +1dec66ed353db4787216d7561c877158
\ No newline at end of file diff --git a/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-readonly-dimmed-expected.png b/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-readonly-dimmed-expected.png Binary files differindex 601e24b..a11a3b3 100644 --- a/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-readonly-dimmed-expected.png +++ b/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-readonly-dimmed-expected.png diff --git a/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-readonly-empty-expected.checksum b/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-readonly-empty-expected.checksum index efa3775..9ecfeb8 100644 --- a/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-readonly-empty-expected.checksum +++ b/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-readonly-empty-expected.checksum @@ -1 +1 @@ -47e7d1c11bdd7f3b636fe1ae9b98d17f
\ No newline at end of file +628cd22fc1350094ef07129e982a9f0a
\ No newline at end of file diff --git a/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-readonly-empty-expected.png b/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-readonly-empty-expected.png Binary files differindex 3a09c40..fdfce51 100644 --- a/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-readonly-empty-expected.png +++ b/webkit/data/layout_test_results/v8/LayoutTests/fast/forms/input-readonly-empty-expected.png diff --git a/webkit/port/rendering/RenderThemeWin.cpp b/webkit/port/rendering/RenderThemeWin.cpp index 859df7d..aeac95d 100644 --- a/webkit/port/rendering/RenderThemeWin.cpp +++ b/webkit/port/rendering/RenderThemeWin.cpp @@ -414,22 +414,17 @@ bool RenderThemeWin::supportsFocusRing(const RenderStyle* style) const unsigned RenderThemeWin::determineState(RenderObject* o) { unsigned result = TS_NORMAL; - if (!isEnabled(o)) { + EAppearance appearance = o->style()->appearance(); + if (!isEnabled(o)) result = TS_DISABLED; - } else if (isReadOnlyControl(o)) { - if (o->style()->appearance() == CheckboxAppearance || - o->style()->appearance() == RadioAppearance) { - result = TS_DISABLED; - } else if (o->style()->appearance() == TextFieldAppearance) { - result = ETS_READONLY; // Readonly is supported on textfields. - } - } else if (isPressed(o)) { // Active overrides hover and focused. + else if (isReadOnlyControl(o) && (TextFieldAppearance == appearance || TextAreaAppearance == appearance)) + result = ETS_READONLY; // Readonly is supported on textfields. + else if (isPressed(o)) // Active overrides hover and focused. result = TS_PRESSED; - } else if (supportsFocus(o->style()->appearance()) && isFocused(o)) { + else if (supportsFocus(appearance) && isFocused(o)) result = ETS_FOCUSED; - } else if (isHovered(o)) { + else if (isHovered(o)) result = TS_HOT; - } if (isChecked(o)) result += 4; // 4 unchecked states, 4 checked states. return result; @@ -438,7 +433,7 @@ unsigned RenderThemeWin::determineState(RenderObject* o) unsigned RenderThemeWin::determineClassicState(RenderObject* o) { unsigned result = 0; - if (!isEnabled(o) || isReadOnlyControl(o)) + if (!isEnabled(o)) result = DFCS_INACTIVE; else if (isPressed(o)) // Active supersedes hover result = DFCS_PUSHED; diff --git a/webkit/tools/layout_tests/test_lists/win/tests_fixable.txt b/webkit/tools/layout_tests/test_lists/win/tests_fixable.txt index 3c91e53..2882481 100644 --- a/webkit/tools/layout_tests/test_lists/win/tests_fixable.txt +++ b/webkit/tools/layout_tests/test_lists/win/tests_fixable.txt @@ -1274,7 +1274,6 @@ V8 | KJS # LayoutTests/fast/forms/select-initial-position.html = FAIL V8 | KJS # LayoutTests/fast/forms/select-item-background-clip.html = FAIL V8 | KJS # LayoutTests/fast/forms/select-visual-hebrew.html = FAIL | PASS V8 | KJS # LayoutTests/fast/forms/textarea-rows-cols.html = FAIL -V8 | KJS # LayoutTests/fast/forms/visual-hebrew-text-field.html = FAIL V8 | KJS # LayoutTests/fast/frames/invalid.html = FAIL V8 | KJS # LayoutTests/fast/frames/onlyCommentInIFrame.html = FAIL V8 | KJS # LayoutTests/fast/frames/valid.html = FAIL |