| 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;
|
| }
|
|
|