[Webkit-unassigned] [Bug 92833] New: [Forms] In selects, when disabled, browser skips first option if not in optgroup, then selects first option in optgroup

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 31 20:46:52 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=92833

           Summary: [Forms] In selects, when disabled, browser skips first
                    option if not in optgroup, then selects first option
                    in optgroup
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
               URL: http://jsfiddle.net/UZBKd/
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Forms
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: yosin at chromium.org


The select element should pick up not "disable" option element for selected option when there is no "selected" option.

HTMLSelectElement::recalcListItems() does this by checking HTMLOptionElement::option().

It seems implementation of HTMLOPtionElement::option() isn't matched to HTML5 specification[1]:

  An option element is disabled if its disabled attribute is present or 
  if it is a child of an optgroup element whose disabled attribute is present.

However, current implementation checks "disabled" attribute regardless element tag name:
  bool HTMLOptionElement::disabled() const
  {
      return ownElementDisabled() || (parentNode() && parentNode()->isHTMLElement() && static_cast<HTMLElement*>(parentNode())->disabled());
  }

In sample URI[2], the parent element is the "select" element having "disabled" attribute. So, HTMLOptionElement::disable() return true
rather than false. This is the reason we pick up the first "option" element in the first "optgroup" element.

= References =
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-option-element
[2] http://jsfiddle.net/UZBKd/

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list