Chromium Code Reviews
DescriptionBlur 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 #Messages
Total messages: 38 (30 generated)
|