[Webkit-unassigned] [Bug 88059] New: REGRESSION(r109729) [Form] The optgroup element's "disabled" attribute has no effect to rendering and selection Rendering of select/optgroup/option combination is too slow.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 1 00:56:51 PDT 2012


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

           Summary: REGRESSION(r109729) [Form] The optgroup element's
                    "disabled" attribute has no effect to rendering and
                    selection Rendering of select/optgroup/option
                    combination is too slow.
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Forms
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: yosin at chromium.org


This bug is imported from http://crbug.com/129334

Slowness is brought by StyleResolver::locateSharedStyle. When style object is shared among optgroup element, StyleResolver::locateSharedStyle checks option elements before it in document order.

For example, if we have following HTML:

<select>
  <optgroup label="1"> <option value="1-1>1-1</option> ... x 100 </optgroup>
  <optgroup label="2"> <option value="2-1>2-1</option> ... x 100 </optgroup>
  ...
  <optgroup label="10"> <option value="2-1>2-1</option> ... x 100 </optgroup>
</select>

locateSharedStyle checks last 10 option elements in optgroup[label="9" to label="1"] for option elements in optgroup[label="10"] by

            if (currentNode->renderStyle() == parentStyle && currentNode->lastChild()) {
                // Adjust for unused reserved tries.
                visitedNodeCount -= cStyleSearchThreshold - subcount;
                return currentNode->lastChild();
            }

Before r109729, style object isn't shared for optgroup element by:

bool StyleResolver::canShareStyleWithControl(StyledElement* element) const
{
    HTMLInputElement* thisInputElement = element->toInputElement();
    HTMLInputElement* otherInputElement = m_element->toInputElement();

    if (!thisInputElement || !otherInputElement)
        return false;

Because, "optgroup" element isn't "input" element.

BTW, canShareStyleWithControl should be smarter than non-input element to reduce memory usage for RenderStyle object.

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