fieldset:disabled fieldset > legend:first-child input should be disabled
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Feb 2014 02:08:30 +0000 (02:08 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Feb 2014 02:08:30 +0000 (02:08 +0000)
commita1ac56a79a36b8db8191da906268f81db1cd911f
treeb296b011a9e6e286af3de57ed791603087a6beb5
parent1e1ce5179c5adf32e077cae719e4bbdc728d9c03
fieldset:disabled fieldset > legend:first-child input should be disabled
https://bugs.webkit.org/show_bug.cgi?id=129077

Reviewed by Antti Koivisto.

Source/WebCore:

Similar to r164403. When a fieldset inside a disabled fieldset, input elements inside
the inner fieldset's first legend element child should be disabled.

Test: fast/forms/fieldset/fieldset-disabled-2.html

* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::legend): Fixed the bug where it was returning the first
legend element descendent. It should be the first legend element _child_.
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::updateAncestorDisabledState): Fixed the algorithm
to look for any ancestor fieldset that has been disabled instead of the first fieldset
ancestor and checking its disabledness.

LayoutTests:

Added a test case.o

* fast/forms/fieldset/fieldset-disabled-2-expected.txt:
* fast/forms/fieldset/fieldset-disabled-2.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164407 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/fieldset/fieldset-disabled-2-expected.txt
LayoutTests/fast/forms/fieldset/fieldset-disabled-2.html
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLFieldSetElement.cpp
Source/WebCore/html/HTMLFormControlElement.cpp