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

Issue 2586143004: Blur immediately if an attribute change made an element unfocasable. (Closed)

Created:
4 years ago by tkent
Modified:
4 years ago
Reviewers:
kochi
CC:
blink-reviews, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, blink-reviews-w3ctests_chromium.org, chromium-reviews, dglazkov+blink, krit, eae+blinkwatch, f(malita), fs, gyuyoung2, kouhei+svg_chromium.org, pdr+svgwatchlist_chromium.org, rwlbuis, Stephen Chennney, sof, tfarina
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Blur immediately if an attribute change made an element unfocusable. tabindex, hidden, contenteditable, disabled, href attributes affect element focusability, however we didn't remove focus from the element immediately after an attribute change made the element unfocusable because dispatching events in parseAttribute() looks dangerous. Actually, dispatching events for update of some specific attributes in parseAttribute() can cause bugs. With this CL, we remove focus in Element::attributeChanged(). * Element::AttributeModificationReason Add kByParser, and update existing item names. We don't check focusability for kByParser and kByCloning because the element can't be focused in these cases. * Element::attributeChanged() Stop using a default argument. Move focus check for tabindex change from parseAttribute(). * HTMLAnchorElement Move focus check for href change from parseAttribute() to attributeChanged(). * HTMLElement Move focus check for hidden and contenteditable change from parseAttribute() to attributeChanged(). * HTMLFormControlElement Move focus check for disabled change from parseAttribute() to attributeChanged(). * HTMLFieldSetElement Check focusability of descendant form controls when the fieldset element is disabled, or a legend element is inserted. BUG=660999 Committed: https://crrev.com/40ccb2581137efc2fc7d2a1041073fa00caed75a Cr-Commit-Position: refs/heads/master@{#440063}

Patch Set 1 : tests #

Patch Set 2 : rebase #

Total comments: 8

Patch Set 3 : Update comments and a function name #

Unified diffs Side-by-side diffs Delta from patch set Stats (+165 lines, -86 lines) Patch
M third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/remove-href-from-focused-anchor.html View 1 chunk +4 lines, -13 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/remove-href-from-focused-anchor-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/imported/wpt/html/editing/focus/processing-model/focus-fixup-rule-one-no-dialogs-expected.txt View 1 1 chunk +0 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 1 chunk +0 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Element.h View 1 2 1 chunk +15 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Element.cpp View 1 2 8 chunks +28 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLAnchorElement.h View 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp View 2 chunks +14 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLElement.h View 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLElement.cpp View 1 2 1 chunk +23 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLFieldSetElement.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLFieldSetElement.cpp View 1 2 2 chunks +32 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLFormControlElement.h View 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp View 1 3 chunks +19 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLInputElement.cpp View 1 1 chunk +9 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLSlotElement.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/SVGElement.h View 1 chunk +4 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGElement.cpp View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 38 (30 generated)
tkent
kochi@, would you review this please?
4 years ago (2016-12-20 07:03:30 UTC) #17
kochi
https://codereview.chromium.org/2586143004/diff/60001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2586143004/diff/60001/third_party/WebKit/Source/core/dom/Element.cpp#newcode1317 third_party/WebKit/Source/core/dom/Element.cpp:1317: // to call it, and it needs up-to-date style. ...
4 years ago (2016-12-21 05:58:09 UTC) #24
tkent
https://codereview.chromium.org/2586143004/diff/60001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2586143004/diff/60001/third_party/WebKit/Source/core/dom/Element.cpp#newcode1317 third_party/WebKit/Source/core/dom/Element.cpp:1317: // to call it, and it needs up-to-date style. ...
4 years ago (2016-12-21 06:51:15 UTC) #25
tkent
Uploaded a new patch set.
4 years ago (2016-12-21 07:30:25 UTC) #27
kochi
lgtm https://codereview.chromium.org/2586143004/diff/60001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2586143004/diff/60001/third_party/WebKit/Source/core/dom/Element.cpp#newcode1317 third_party/WebKit/Source/core/dom/Element.cpp:1317: // to call it, and it needs up-to-date ...
4 years ago (2016-12-21 08:05:19 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2586143004/60002
4 years ago (2016-12-21 09:41:07 UTC) #33
commit-bot: I haz the power
Committed patchset #3 (id:60002)
4 years ago (2016-12-21 09:46:16 UTC) #36
commit-bot: I haz the power
4 years ago (2016-12-21 09:48:51 UTC) #38
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/40ccb2581137efc2fc7d2a1041073fa00caed75a
Cr-Commit-Position: refs/heads/master@{#440063}

Powered by Google App Engine
This is Rietveld 408576698