|
Mouse press should focus on any types of form controls.
* Background
In WebKit, form controls except text fields and <select> are not
mouse-focusable. This behavior is based on Cocoa native controls.
Though Firefox on Mac behaves same as WebKit, IE, Firefox (non-Mac),
and Opera(Presto) set focus by mouse press.
The WebKit behavior is not Web-compatible.
* Behavior change
We change the behavior so that mouse press sets focus to form controls
to improve web compatibility. However, We haven't set focus until now and
this behavior change might make existing users uncomfortable with focus
rings which appear on click. So, we don't draw focus rings if a form control
was focused by mouse press.
* Implementation
The main part of this CL is to remove HTMLFormControlElement::isMouseFocusable.
It means we use Node::isMouseFocusable, which is just isFocusable. We
can remove many isMouseFocusable implementations of
HTMLFormControlElement subclasses.
We change the followings to hide focus rings on mouse-focus:
- Introduce FocusDirectionMouse so that form control can distinguish
mouse focus from others.
- HTMLFormControlElement has m_wasFocusedByMouse flag. It is cleared
when a keydown event is delivered.
- Introduce HTMLFormControlElement::shouldShowFocusRingOnMouseFocus,
which represents differences between button controls and text/select
controls.
- RenderTheme, RenderObject, RenderInline don't draw focus rings if
conditions match.
We introduced Node::willCallDefaultEventHandler to re-show focus rings
after keyboard operations.
Test changes:
- Add many tests for new behavior.
- Remove fast/events/click-focus-control.html because now it is covered
by existing and new tests.
- Need rebaseline for afast/repaint/slider-thumb-float.html. We show
a focus ring for a control without -webkit-appearance.
BUG= 89708
R=arv@chromium.org, keishi@chromium.org
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=153039
Total comments: 6
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+410 lines, -145 lines) |
Patch |
|
M |
LayoutTests/TestExpectations
|
View
|
1
2
3
4
|
2 chunks |
+14 lines, -0 lines |
0 comments
|
Download
|
|
D |
LayoutTests/fast/events/click-focus-control.html
|
View
|
|
1 chunk |
+0 lines, -90 lines |
0 comments
|
Download
|
|
D |
LayoutTests/fast/events/click-focus-control-expected.txt
|
View
|
|
1 chunk |
+0 lines, -9 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/button/button-reset-focus-by-mouse.html
|
View
|
1
2
3
|
1 chunk |
+22 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/button/button-reset-focus-by-mouse-expected.html
|
View
|
1
2
3
|
1 chunk |
+18 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/button/button-reset-focus-by-mouse-then-keydown.html
|
View
|
1
2
3
|
1 chunk |
+11 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/button/button-reset-focus-by-mouse-then-keydown-expected.html
|
View
|
1
2
3
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/checkbox/checkbox-focus-by-mouse.html
|
View
|
1
2
3
|
1 chunk |
+22 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/checkbox/checkbox-focus-by-mouse-expected.html
|
View
|
1
2
3
|
1 chunk |
+19 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/checkbox/checkbox-focus-by-mouse-then-keydown.html
|
View
|
1
2
3
|
1 chunk |
+11 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/checkbox/checkbox-focus-by-mouse-then-keydown-expected.html
|
View
|
1
2
3
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/radio/radio-focus-by-mouse.html
|
View
|
1
2
3
|
1 chunk |
+21 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/radio/radio-focus-by-mouse-expected.html
|
View
|
1
2
3
|
1 chunk |
+19 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/radio/radio-focus-by-mouse-then-keydown.html
|
View
|
1
2
3
|
1 chunk |
+11 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/radio/radio-focus-by-mouse-then-keydown-expected.html
|
View
|
1
2
3
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/range/range-focus-by-mouse.html
|
View
|
1
2
3
|
1 chunk |
+22 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/range/range-focus-by-mouse-expected.html
|
View
|
1
2
3
|
1 chunk |
+19 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/range/range-focus-by-mouse-then-keydown.html
|
View
|
1
2
3
|
1 chunk |
+11 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/range/range-focus-by-mouse-then-keydown-expected.html
|
View
|
1
2
3
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/submit/submit-focus-by-mouse.html
|
View
|
1
2
3
|
1 chunk |
+22 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/submit/submit-focus-by-mouse-expected.html
|
View
|
1
2
3
|
1 chunk |
+19 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/submit/submit-focus-by-mouse-then-keydown.html
|
View
|
1
2
3
|
1 chunk |
+11 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/forms/submit/submit-focus-by-mouse-then-keydown-expected.html
|
View
|
1
2
3
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/dom/EventDispatcher.cpp
|
View
|
1
2
3
4
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/dom/Node.h
|
View
|
1
2
3
4
|
2 chunks |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/dom/Node.cpp
|
View
|
1
2
3
4
|
2 chunks |
+10 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/html/BaseChooserOnlyDateAndTimeInputType.h
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
Source/core/html/BaseChooserOnlyDateAndTimeInputType.cpp
|
View
|
|
1 chunk |
+0 lines, -5 lines |
0 comments
|
Download
|
|
M |
Source/core/html/BaseDateAndTimeInputType.h
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/html/BaseDateAndTimeInputType.cpp
|
View
|
1
2
3
4
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/html/BaseMultipleFieldsDateAndTimeInputType.h
|
View
|
1
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp
|
View
|
1
2
3
4
|
2 chunks |
+1 line, -6 lines |
0 comments
|
Download
|
|
M |
Source/core/html/HTMLFormControlElement.h
|
View
|
1
2
3
|
2 chunks |
+5 lines, -2 lines |
0 comments
|
Download
|
|
M |
Source/core/html/HTMLFormControlElement.cpp
|
View
|
1
2
3
|
2 chunks |
+26 lines, -1 line |
0 comments
|
Download
|
|
M |
Source/core/html/HTMLInputElement.h
|
View
|
1
2
3
4
|
2 chunks |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
Source/core/html/HTMLInputElement.cpp
|
View
|
1
2
3
4
|
2 chunks |
+2 lines, -7 lines |
0 comments
|
Download
|
|
M |
Source/core/html/HTMLSelectElement.h
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/html/HTMLSelectElement.cpp
|
View
|
1
2
3
4
|
1 chunk |
+2 lines, -4 lines |
0 comments
|
Download
|
|
M |
Source/core/html/HTMLTextAreaElement.h
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/html/HTMLTextAreaElement.cpp
|
View
|
1
2
3
4
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
Source/core/html/InputType.h
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/html/InputType.cpp
|
View
|
1
2
3
4
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
Source/core/html/TextFieldInputType.h
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/html/TextFieldInputType.cpp
|
View
|
1
2
3
4
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
Source/core/page/EventHandler.cpp
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/page/FocusDirection.h
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
Source/core/rendering/RenderInline.cpp
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/rendering/RenderObject.cpp
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/rendering/RenderTheme.h
|
View
|
1
2
|
2 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
|
M |
Source/core/rendering/RenderTheme.cpp
|
View
|
1
2
|
2 chunks |
+17 lines, -1 line |
0 comments
|
Download
|
Total messages: 16 (0 generated)
|