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

Issue 1763553002: Invalidate :default pseudo classes when a default button is added or removed. (Closed)

Created:
4 years, 9 months ago by tkent
Modified:
4 years, 9 months ago
Reviewers:
keishi, rune
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Invalidate :default pseudo classes when a default button is added or removed. "default button" is the first submit button in tree order [1]. We need to invalidate :default pseudo class when: - Form control type is changed - A submit button is associated to a form. - A submit btuton is disassociated to a form. for - The submit button, and - Other submit buttons associated to the form. Implementation: * HTMLButtonElement.cpp Invalidate submit buttons associated to the form owner when |type| attribute is udpated. * HTMLInputElement.cpp Invalidate submit buttons associated to the form owner when |type| attribute is udpated and the previous type or the current type is a submit button. * HTMLFormControlElement.cpp When the form owner is changed, invalidate submit buttons associated to the old form owner and the new form owner. * HTMLFormElement.{cpp,h} - Introduce HTMLFormElmement::invalidateDefaultButtonStyle. - Introduce m_hasElementsAssociatedByFormAttribute Refer to it during collecting associated elements instead of IdTargetObserverRegistry::hasObservers. IdTargetObserverRegistry::hasObservers didn't work well in HTMLFormControlElement::didChangeForm because an observer is registered after didChangeForm. [1] https://html.spec.whatwg.org/multipage/forms.html#default-button BUG=557683 TEST=automated Committed: https://crrev.com/37d28d9b0dd82479ee7a1fc85ae11fcab6a4246b Cr-Commit-Position: refs/heads/master@{#379190}

Patch Set 1 #

Total comments: 5

Patch Set 2 : return -> continue #

Unified diffs Side-by-side diffs Delta from patch set Stats (+115 lines, -4 lines) Patch
A third_party/WebKit/LayoutTests/fast/css/pseudo-default-dynamic.html View 1 1 chunk +89 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/RuleFeature.cpp View 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLButtonElement.cpp View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp View 1 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLFormElement.h View 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLFormElement.cpp View 1 5 chunks +14 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLInputElement.cpp View 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (4 generated)
tkent
keishi@, rune@, would you review this please?
4 years, 9 months ago (2016-03-03 01:32:05 UTC) #2
rune
https://codereview.chromium.org/1763553002/diff/1/third_party/WebKit/LayoutTests/fast/css/pseudo-default-dynamic.html File third_party/WebKit/LayoutTests/fast/css/pseudo-default-dynamic.html (right): https://codereview.chromium.org/1763553002/diff/1/third_party/WebKit/LayoutTests/fast/css/pseudo-default-dynamic.html#newcode2 third_party/WebKit/LayoutTests/fast/css/pseudo-default-dynamic.html:2: <body> <body> can be dropped. https://codereview.chromium.org/1763553002/diff/1/third_party/WebKit/LayoutTests/fast/css/pseudo-default-dynamic.html#newcode16 third_party/WebKit/LayoutTests/fast/css/pseudo-default-dynamic.html:16: const NOT_DEFAULT ...
4 years, 9 months ago (2016-03-03 09:11:03 UTC) #3
tkent
Uploaded new patch set. https://codereview.chromium.org/1763553002/diff/1/third_party/WebKit/LayoutTests/fast/css/pseudo-default-dynamic.html File third_party/WebKit/LayoutTests/fast/css/pseudo-default-dynamic.html (right): https://codereview.chromium.org/1763553002/diff/1/third_party/WebKit/LayoutTests/fast/css/pseudo-default-dynamic.html#newcode2 third_party/WebKit/LayoutTests/fast/css/pseudo-default-dynamic.html:2: <body> On 2016/03/03 at 09:11:03, ...
4 years, 9 months ago (2016-03-04 00:05:08 UTC) #4
rune
lgtm
4 years, 9 months ago (2016-03-04 00:14:24 UTC) #5
tkent
Keishi, would you double-check form-related code please?
4 years, 9 months ago (2016-03-04 00:23:27 UTC) #6
keishi
LGTM
4 years, 9 months ago (2016-03-04 01:37:27 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1763553002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1763553002/20001
4 years, 9 months ago (2016-03-04 01:49:36 UTC) #9
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 9 months ago (2016-03-04 02:53:59 UTC) #11
commit-bot: I haz the power
4 years, 9 months ago (2016-03-04 02:55:29 UTC) #13
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/37d28d9b0dd82479ee7a1fc85ae11fcab6a4246b
Cr-Commit-Position: refs/heads/master@{#379190}

Powered by Google App Engine
This is Rietveld 408576698