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

Unified Diff: third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp

Issue 2648213006: FIELDSET element: Correct nested FIELDSET behavior for descendant |disabled| state. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-fieldset-element/disabled-001-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp b/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp
index 65461fc858675b32b3b0ed0e5a5575f6e5feca5a..b80f79cf0fa0ee4f3be98b053ac1f5182dcca54e 100644
--- a/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp
@@ -109,20 +109,19 @@ bool HTMLFormControlElement::formNoValidate() const {
}
void HTMLFormControlElement::updateAncestorDisabledState() const {
- HTMLFieldSetElement* fieldSetAncestor = 0;
- ContainerNode* legendAncestor = 0;
+ HTMLFieldSetElement* highestDisabledFieldSetAncestor = nullptr;
+ ContainerNode* highestLegendAncestor = nullptr;
for (HTMLElement* ancestor = Traversal<HTMLElement>::firstAncestor(*this);
ancestor; ancestor = Traversal<HTMLElement>::firstAncestor(*ancestor)) {
- if (!legendAncestor && isHTMLLegendElement(*ancestor))
- legendAncestor = ancestor;
- if (isHTMLFieldSetElement(*ancestor)) {
- fieldSetAncestor = toHTMLFieldSetElement(ancestor);
- break;
- }
+ if (isHTMLLegendElement(*ancestor))
+ highestLegendAncestor = ancestor;
+ if (isHTMLFieldSetElement(*ancestor) && ancestor->isDisabledFormControl())
+ highestDisabledFieldSetAncestor = toHTMLFieldSetElement(ancestor);
}
m_ancestorDisabledState =
- (fieldSetAncestor && fieldSetAncestor->isDisabledFormControl() &&
- !(legendAncestor && legendAncestor == fieldSetAncestor->legend()))
+ (highestDisabledFieldSetAncestor &&
+ !(highestLegendAncestor &&
+ highestLegendAncestor == highestDisabledFieldSetAncestor->legend()))
? AncestorDisabledStateDisabled
: AncestorDisabledStateEnabled;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-fieldset-element/disabled-001-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698