[Webkit-unassigned] [Bug 87694] New: [CSS] Move StyleResolver::canShareStyleWithElement to StyledElement as virtual method

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 28 22:42:07 PDT 2012


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

           Summary: [CSS] Move StyleResolver::canShareStyleWithElement to
                    StyledElement as virtual method
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: yosin at chromium.org
            Blocks: 80381


I would like to move StyleResolver::canShareStyleWithElement to StyleElement class as virtual method.
The reasons are:

1. Move hasTagName checking to class which implements element. This also removes some #if, e.g. ENABLE(PROGRESS_TAG)
2. Control sharing in fine grain, e.g. if (element->hasTagName(optionTag)) return false is too conservative.



Call site changes are:

inline StyledElement* StyleResolver::findSiblingForStyleSharing(Node* node, unsigned& count) const
{
    for (; node; node = node->previousSibling()) {
        if (!node->isStyledElement())
            continue;
NOW:    if (canShareStyleWithElement(static_cast<StyledElement*>(node)))
NEW:    if (m_element->canShareStyleWithElement(static_cast<StyledElement*>(node))) 
            break;
   ....
}

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