Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Issue 455223002: Make anchors mouse-focusable (Closed)

Created:
6 years, 4 months ago by robwu
Modified:
6 years, 3 months ago
Reviewers:
tkent, pdr., Xianzhu, eae
CC:
blink-reviews, ed+blinkwatch_opera.com, blink-reviews-rendering, zoltan1, blink-reviews-html_chromium.org, eae+blinkwatch, leviw+renderwatch, kouhei+svg_chromium.org, fs, dglazkov+blink, krit, f(malita), gyuyoung.kim_webkit.org, jchaffraix+rendering, rwlbuis, Stephen Chennney, rune+blink
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Make anchors mouse-focusable Anchors are now also mouse-focusable, to be consistent with Gecko, Trident and Presto. When an anchor is focused by mouse, the default focus ring is not shown (unless tabindex is set), as before. The expectation of fast/events/click-focus-anchor has changed as follows: - a3 is also focusable by mouse, because it is a link. - a7 is focused instead of p7 because a7 is focusable, and therefore get the focus instead of the parent <p> element. BUG=388666 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=181127

Patch Set 1 #

Patch Set 2 : rebase #

Total comments: 6

Patch Set 3 : s/Element/SVGGraphicsElement/ #

Patch Set 4 : De-duplicate using FocusController; update TestExpectations #

Total comments: 20

Patch Set 5 : Change a few phrases, add explicit width/height to layout tests #

Patch Set 6 : add svg focus tests; replace pixel tests with reference tests #

Patch Set 7 : rebase #

Total comments: 1

Patch Set 8 : from scratch: put focus logic in Element #

Total comments: 2

Patch Set 9 : Move m_wasFocusedByMouse to elementData().m_shouldHideFocusRingOnMouseFocus #

Total comments: 2

Patch Set 10 : bitfield 19 -> 27 #

Patch Set 11 : Move m_wasFocusedByMouse into subclasses. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+217 lines, -43 lines) Patch
M LayoutTests/fast/events/click-focus-anchor.html View 1 2 3 4 5 2 chunks +18 lines, -10 lines 0 comments Download
M LayoutTests/fast/events/click-focus-anchor-expected.txt View 1 2 3 4 5 1 chunk +11 lines, -5 lines 0 comments Download
A LayoutTests/fast/events/click-focus-anchor-has-ring.html View 1 2 3 4 5 1 chunk +14 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/click-focus-anchor-has-ring-expected.html View 1 2 3 4 5 1 chunk +14 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/click-focus-anchor-no-ring.html View 1 2 3 4 5 1 chunk +14 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/click-focus-anchor-no-ring-expected.html View 1 2 3 4 5 1 chunk +14 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/click-focus-svganchor-has-ring.html View 1 2 3 4 1 chunk +13 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/click-focus-svganchor-has-ring-expected.html View 1 2 3 4 5 1 chunk +13 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/click-focus-svganchor-no-ring.html View 1 2 3 4 1 chunk +13 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/click-focus-svganchor-no-ring-expected.html View 1 2 3 4 5 1 chunk +13 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/resources/focus-anchor-by-mouse.js View 1 2 3 4 5 1 chunk +7 lines, -0 lines 0 comments Download
M Source/core/dom/Element.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -0 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +15 lines, -1 line 0 comments Download
M Source/core/html/HTMLAnchorElement.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -0 lines 0 comments Download
M Source/core/html/HTMLAnchorElement.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +17 lines, -3 lines 0 comments Download
M Source/core/html/HTMLFormControlElement.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLFormControlElement.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -16 lines 0 comments Download
M Source/core/rendering/RenderTheme.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/svg/SVGAElement.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -0 lines 0 comments Download
M Source/core/svg/SVGAElement.cpp View 1 2 3 4 5 6 7 8 9 10 3 chunks +18 lines, -4 lines 0 comments Download

Messages

Total messages: 50 (1 generated)
robwu
6 years, 4 months ago (2014-08-10 13:37:59 UTC) #1
pdr.
What about touch events? Do the other browsers have the same behavior for touch events? ...
6 years, 4 months ago (2014-08-10 20:21:52 UTC) #2
pdr.
+cc tkent who added the original mouse focus code. (see: https://codereview.chromium.org/16194013#msg12)
6 years, 4 months ago (2014-08-10 21:00:17 UTC) #3
robwu
https://codereview.chromium.org/455223002/diff/20001/LayoutTests/TestExpectations File LayoutTests/TestExpectations (right): https://codereview.chromium.org/455223002/diff/20001/LayoutTests/TestExpectations#newcode742 LayoutTests/TestExpectations:742: crbug.com/388666 fast/events/click-focus-anchor-no-ring.html [ Missing ] On 2014/08/10 20:21:52, pdr ...
6 years, 4 months ago (2014-08-10 23:37:19 UTC) #4
pdr.
On 2014/08/10 23:37:19, robwu wrote: > https://codereview.chromium.org/455223002/diff/20001/LayoutTests/TestExpectations > File LayoutTests/TestExpectations (right): > > https://codereview.chromium.org/455223002/diff/20001/LayoutTests/TestExpectations#newcode742 > ...
6 years, 4 months ago (2014-08-10 23:43:41 UTC) #5
robwu
On 2014/08/10 23:43:41, pdr wrote: > On 2014/08/10 23:37:19, robwu wrote: > > > https://codereview.chromium.org/455223002/diff/20001/LayoutTests/TestExpectations ...
6 years, 4 months ago (2014-08-11 00:07:59 UTC) #6
pdr.
On 2014/08/11 00:07:59, robwu wrote: > > Ah, that thread predates the rebaseline bot. I ...
6 years, 4 months ago (2014-08-11 00:25:54 UTC) #7
tkent
> When an anchor is focused by mouse, the default > focus ring is not ...
6 years, 4 months ago (2014-08-11 02:15:56 UTC) #8
robwu
On 2014/08/11 02:15:56, tkent wrote: > > When an anchor is focused by mouse, the ...
6 years, 4 months ago (2014-08-11 07:49:06 UTC) #9
robwu
On 2014/08/11 00:25:54, pdr wrote: > > In general, we avoid pixel tests unless they ...
6 years, 4 months ago (2014-08-11 10:50:13 UTC) #10
pdr.
I like the direction you took with this patch. A bunch of minor comments below. ...
6 years, 4 months ago (2014-08-12 02:02:23 UTC) #11
pdr.
https://codereview.chromium.org/455223002/diff/60001/Source/core/dom/Node.cpp File Source/core/dom/Node.cpp (right): https://codereview.chromium.org/455223002/diff/60001/Source/core/dom/Node.cpp#newcode2202 Source/core/dom/Node.cpp:2202: renderer()->paintInvalidationForWholeRenderer(); On 2014/08/12 02:02:22, pdr wrote: > Is this ...
6 years, 4 months ago (2014-08-12 02:18:54 UTC) #12
Xianzhu
https://codereview.chromium.org/455223002/diff/60001/Source/core/html/HTMLAnchorElement.cpp File Source/core/html/HTMLAnchorElement.cpp (right): https://codereview.chromium.org/455223002/diff/60001/Source/core/html/HTMLAnchorElement.cpp#newcode92 Source/core/html/HTMLAnchorElement.cpp:92: return !document().page()->focusController().wasFocusedByMouse() || HTMLElement::supportsFocus(); The above code will have ...
6 years, 4 months ago (2014-08-12 03:58:01 UTC) #13
Xianzhu
https://codereview.chromium.org/455223002/diff/60001/Source/core/html/HTMLAnchorElement.cpp File Source/core/html/HTMLAnchorElement.cpp (right): https://codereview.chromium.org/455223002/diff/60001/Source/core/html/HTMLAnchorElement.cpp#newcode92 Source/core/html/HTMLAnchorElement.cpp:92: return !document().page()->focusController().wasFocusedByMouse() || HTMLElement::supportsFocus(); s/agile/fragile/ ..
6 years, 4 months ago (2014-08-12 04:01:11 UTC) #14
robwu
https://codereview.chromium.org/455223002/diff/60001/LayoutTests/fast/events/click-focus-anchor-no-ring.html File LayoutTests/fast/events/click-focus-anchor-no-ring.html (right): https://codereview.chromium.org/455223002/diff/60001/LayoutTests/fast/events/click-focus-anchor-no-ring.html#newcode4 LayoutTests/fast/events/click-focus-anchor-no-ring.html:4: <p>This test ensures that the focus ring is not ...
6 years, 4 months ago (2014-08-12 14:27:49 UTC) #15
Xianzhu
https://codereview.chromium.org/455223002/diff/60001/Source/core/html/HTMLAnchorElement.cpp File Source/core/html/HTMLAnchorElement.cpp (right): https://codereview.chromium.org/455223002/diff/60001/Source/core/html/HTMLAnchorElement.cpp#newcode92 Source/core/html/HTMLAnchorElement.cpp:92: return !document().page()->focusController().wasFocusedByMouse() || HTMLElement::supportsFocus(); On 2014/08/12 14:27:49, robwu wrote: ...
6 years, 4 months ago (2014-08-12 16:03:08 UTC) #16
pdr.
> > I don't think we need any pixel tests are needed here. For your ...
6 years, 4 months ago (2014-08-12 17:53:43 UTC) #17
Xianzhu
https://codereview.chromium.org/455223002/diff/60001/Source/core/html/HTMLAnchorElement.cpp File Source/core/html/HTMLAnchorElement.cpp (right): https://codereview.chromium.org/455223002/diff/60001/Source/core/html/HTMLAnchorElement.cpp#newcode92 Source/core/html/HTMLAnchorElement.cpp:92: return !document().page()->focusController().wasFocusedByMouse() || HTMLElement::supportsFocus(); I no longer insist the ...
6 years, 4 months ago (2014-08-14 19:12:49 UTC) #18
robwu
https://codereview.chromium.org/455223002/diff/60001/LayoutTests/fast/events/resources/focus-anchor-by-mouse.js File LayoutTests/fast/events/resources/focus-anchor-by-mouse.js (right): https://codereview.chromium.org/455223002/diff/60001/LayoutTests/fast/events/resources/focus-anchor-by-mouse.js#newcode5 LayoutTests/fast/events/resources/focus-anchor-by-mouse.js:5: testRunner.dumpAsTextWithPixelResults(); On 2014/08/12 02:02:22, pdr wrote: > I don't ...
6 years, 4 months ago (2014-08-15 22:51:33 UTC) #19
pdr.
On 2014/08/15 22:51:33, robwu wrote: > Great. Anything else besides that? I apologize for the ...
6 years, 4 months ago (2014-08-19 00:35:05 UTC) #20
tkent
The C++ code change looks ok. I tested this CL locally, and I think the ...
6 years, 4 months ago (2014-08-19 02:11:38 UTC) #21
robwu
On 2014/08/19 00:35:05, pdr wrote: > On 2014/08/15 22:51:33, robwu wrote: > > Great. Anything ...
6 years, 4 months ago (2014-08-19 14:37:15 UTC) #22
pdr.
On 2014/08/19 14:37:15, robwu wrote: > On 2014/08/19 00:35:05, pdr wrote: > > On 2014/08/15 ...
6 years, 4 months ago (2014-08-19 14:40:27 UTC) #23
pdr.
The CQ bit was checked by pdr@chromium.org
6 years, 4 months ago (2014-08-19 14:40:44 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rob@robwu.nl/455223002/100001
6 years, 4 months ago (2014-08-19 14:41:29 UTC) #25
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-19 14:41:52 UTC) #26
commit-bot: I haz the power
Failed to apply patch for Source/core/html/HTMLFormControlElement.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 4 months ago (2014-08-19 14:41:53 UTC) #27
robwu
The CQ bit was checked by rob@robwu.nl
6 years, 4 months ago (2014-08-19 14:54:44 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rob@robwu.nl/455223002/120001
6 years, 4 months ago (2014-08-19 14:54:59 UTC) #29
Xianzhu
Thanks for the change. Note that this change will still cause corrupted display if other ...
6 years, 4 months ago (2014-08-19 15:25:47 UTC) #30
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_blink_dbg on tryserver.blink ...
6 years, 4 months ago (2014-08-19 16:05:55 UTC) #31
robwu
https://codereview.chromium.org/455223002/diff/120001/Source/core/dom/Node.cpp File Source/core/dom/Node.cpp (right): https://codereview.chromium.org/455223002/diff/120001/Source/core/dom/Node.cpp#newcode2190 Source/core/dom/Node.cpp:2190: } These lines are bugging me a little bit. ...
6 years, 4 months ago (2014-08-19 17:03:56 UTC) #32
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-19 17:07:59 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_dbg on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/linux_blink_dbg/builds/21951)
6 years, 4 months ago (2014-08-19 17:08:01 UTC) #34
pdr.
On 2014/08/19 17:03:56, robwu wrote: > https://codereview.chromium.org/455223002/diff/120001/Source/core/dom/Node.cpp > File Source/core/dom/Node.cpp (right): > > https://codereview.chromium.org/455223002/diff/120001/Source/core/dom/Node.cpp#newcode2190 > ...
6 years, 4 months ago (2014-08-19 17:41:47 UTC) #35
robwu
pdr@ I have updated the CL, and put the logic in Element. If the trybot ...
6 years, 4 months ago (2014-08-22 23:39:04 UTC) #36
pdr.
This looks good to me. @tkent and Xianzhu, would you take another look as well? ...
6 years, 3 months ago (2014-08-25 17:46:18 UTC) #37
Xianzhu
Change about invalidation lgtm.
6 years, 3 months ago (2014-08-25 17:56:24 UTC) #38
robwu
https://codereview.chromium.org/455223002/diff/140001/Source/core/dom/Element.h File Source/core/dom/Element.h (right): https://codereview.chromium.org/455223002/diff/140001/Source/core/dom/Element.h#newcode643 Source/core/dom/Element.h:643: bool m_wasFocusedByMouse; On 2014/08/25 17:46:18, pdr wrote: > Should ...
6 years, 3 months ago (2014-08-25 22:40:03 UTC) #39
pdr.
https://codereview.chromium.org/455223002/diff/160001/Source/core/dom/ElementData.h File Source/core/dom/ElementData.h (right): https://codereview.chromium.org/455223002/diff/160001/Source/core/dom/ElementData.h#newcode92 Source/core/dom/ElementData.h:92: unsigned m_arraySize : 19; You cannot just take 9 ...
6 years, 3 months ago (2014-08-25 22:57:37 UTC) #40
robwu
https://codereview.chromium.org/455223002/diff/160001/Source/core/dom/ElementData.h File Source/core/dom/ElementData.h (right): https://codereview.chromium.org/455223002/diff/160001/Source/core/dom/ElementData.h#newcode92 Source/core/dom/ElementData.h:92: unsigned m_arraySize : 19; On 2014/08/25 22:57:37, pdr wrote: ...
6 years, 3 months ago (2014-08-25 23:14:59 UTC) #41
pdr.
(not lgtm, just to clear the lgtm bit so nobody accidentally hits commit) On 2014/08/25 ...
6 years, 3 months ago (2014-08-26 00:50:55 UTC) #42
tkent
On 2014/08/26 00:50:55, pdr wrote: > m_shouldHideFocusRingOnMouseFocus is only used in 3 places, all of ...
6 years, 3 months ago (2014-08-26 01:06:46 UTC) #43
robwu
On 2014/08/26 01:06:46, tkent wrote: > On 2014/08/26 00:50:55, pdr wrote: > > m_shouldHideFocusRingOnMouseFocus is ...
6 years, 3 months ago (2014-08-26 08:36:27 UTC) #44
pdr.
On 2014/08/26 08:36:27, robwu wrote: > On 2014/08/26 01:06:46, tkent wrote: > > On 2014/08/26 ...
6 years, 3 months ago (2014-08-26 20:31:17 UTC) #45
robwu
Done. I reverted back to patch set 8, then moved the m_wasFocusedByMouse member to the ...
6 years, 3 months ago (2014-08-29 23:39:44 UTC) #46
pdr.
On 2014/08/29 23:39:44, robwu wrote: > Done. I reverted back to patch set 8, then ...
6 years, 3 months ago (2014-08-30 00:55:54 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rob@robwu.nl/455223002/200001
6 years, 3 months ago (2014-08-30 00:57:14 UTC) #49
commit-bot: I haz the power
6 years, 3 months ago (2014-08-30 02:03:33 UTC) #50
Message was sent while issue was closed.
Committed patchset #11 (id:200001) as 181127

Powered by Google App Engine
This is Rietveld 408576698