Bug 129068 - fieldset:disabled > legend:first-child legend input should not be disabled
Summary: fieldset:disabled > legend:first-child legend input should not be disabled
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks: 129035
  Show dependency treegraph
 
Reported: 2014-02-19 15:31 PST by Ryosuke Niwa
Modified: 2014-02-19 17:02 PST (History)
5 users (show)

See Also:


Attachments
Fixes the bug (6.71 KB, patch)
2014-02-19 15:46 PST, Ryosuke Niwa
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2014-02-19 15:31:05 PST
Input elements inside the first legend element of a disabled fieldset should not be disabled
even if it's inside another legend element as long as the input element itself is not disabled.
Comment 1 Ryosuke Niwa 2014-02-19 15:46:07 PST
Created attachment 224688 [details]
Fixes the bug
Comment 2 Andreas Kling 2014-02-19 16:07:19 PST
Comment on attachment 224688 [details]
Fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=224688&action=review

r=me

> Source/WebCore/ChangeLog:9
> +        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.

It would be interesting to note what other engines do in this scenario.

> Source/WebCore/ChangeLog:11
> +        Prior to this pach, an input element inside such a legend element was erroneously disabled if

patch

> Source/WebCore/html/HTMLFormControlElement.cpp:104
> +    Element* previousAncestor = 0;

nullptr

> Source/WebCore/html/HTMLFormControlElement.cpp:106
>          if (ancestor->hasTagName(fieldsetTag)) {

isHTMLFieldSetElement(ancestor)

> Source/WebCore/html/HTMLFormControlElement.cpp:107
> +            HTMLFieldSetElement* fieldSetAncestor = toHTMLFieldSetElement(ancestor);

I would make this a reference.

> Source/WebCore/html/HTMLFormControlElement.cpp:108
> +            bool isInFirstLegend = previousAncestor && previousAncestor->hasTagName(legendTag) && previousAncestor == fieldSetAncestor->legend();

isHTMLLegendElement(previousAncestor)
Comment 3 Ryosuke Niwa 2014-02-19 17:02:06 PST
Committed r164403: <http://trac.webkit.org/changeset/164403>