[Webkit-unassigned] [Bug 153768] Factor style sharing code out of StyleResolver

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 1 19:44:11 PST 2016


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

--- Comment #7 from Antti Koivisto <koivisto at iki.fi> ---
> Should we lazily compute this value to avoid looking up the hash table
> proactively?

Probably though I'm not sure if it makes much difference in practice.

> > Source/WebCore/style/StyleSharingResolver.cpp:77
> > +    if (!element.parentElement())
> > +        return nullptr;
> 
> You no longer check the existence of parent style.  Is that expected?

I'll put the check back. I'm not sure if it ever matters but can't really prove it.

> > Source/WebCore/style/StyleSharingResolver.cpp:362
> > +    for (unsigned i = 0; i < classNames.size(); ++i) {
> 
> Should we store classNames.size() in a local variable instead?

Or rather use range-for.

> I got confused by this name because it sounded as if we need to do further
> verification to make sure we can share a style with it.
> How about "findStyleSharableElement" or "findElementToShareStyle"?

The class name is Style::SharingResolver so I feel "style" and "share" are redundant in the function name. I sort of like "similar" since it communicates why we can share style with it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160202/e66690fd/attachment.html>


More information about the webkit-unassigned mailing list