Bug 87694

Summary: [CSS] Move StyleResolver::canShareStyleWithElement to StyledElement as virtual method
Product: WebKit Reporter: yosin
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: bfulgham, eric
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 80381    

yosin
Reported 2012-05-28 22:42:07 PDT
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; .... }
Attachments
Eric Seidel (no email)
Comment 1 2013-03-22 14:16:45 PDT
canShareStyleWith is an insanity-hot function. I do not recommend this approach, unless you're finding ways to avoid calling it.
Brent Fulgham
Comment 2 2022-07-13 15:33:07 PDT
This code has been significantly refactored since this patch was proposed. There doesn't seem to be any action we can take here.
Note You need to log in before you can comment on or make changes to this bug.