fieldset:disabled > legend:first-child legend input should not be disabled
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Feb 2014 01:06:52 +0000 (01:06 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Feb 2014 01:06:52 +0000 (01:06 +0000)
commit28af66badbea1628304044753af31b503e3dcd07
tree24816c1aa8ffeb0ce01b7e6184b92c8e33fe4fea
parent1fd15128d3cc9d494f5d2a7e8b9139cb78c0ae44
fieldset:disabled > legend:first-child legend input should not be disabled
https://bugs.webkit.org/show_bug.cgi?id=129068

Reviewed by Andreas Kling.

Source/WebCore:

An input element inside a disabled fieldset element is ordinarily disabled unless it's inside
a legend element that is the first of its kind to appear in the fieldset's child node list.

Prior to this patch, an input element inside such a legend element was erroneously disabled if
we had another legend element between the two as in <fieldset disabled><legend><legend><input>.

Fixed the bug by correcting the algorithm in updateAncestorDisabledState.

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

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::updateAncestorDisabledState):

LayoutTests:

Added a new regression test.

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164403 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/fieldset/fieldset-disabled-2-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/fieldset/fieldset-disabled-2.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLFormControlElement.cpp