Bug 119542 - Kill the presentation attribute cache.
Summary: Kill the presentation attribute cache.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-07 04:13 PDT by Andreas Kling
Modified: 2017-02-12 21:39 PST (History)
6 users (show)

See Also:


Attachments
Patch (9.89 KB, patch)
2013-08-07 04:14 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff
Patch (10.45 KB, patch)
2017-01-17 14:45 PST, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2013-08-07 04:13:58 PDT
Kill the presentation attribute cache.
Comment 1 Andreas Kling 2013-08-07 04:14:36 PDT
Created attachment 208249 [details]
Patch
Comment 2 Andreas Kling 2013-08-07 06:18:07 PDT
Comment on attachment 208249 [details]
Patch

I withdraw this patch... for now.
Comment 3 Antti Koivisto 2013-08-07 06:25:03 PDT
Comment on attachment 208249 [details]
Patch

This optimisation helps by making attribute parsing faster and by allowing more style sharing (which both saves memory and speeds up style resolve). I'm not entirely convinced that presentation attributes are rare enough that this is completely worthless. I imagine that there are some sites with lots of <img width height> where the attributes are currently getting shared. It would be nice to get some actual data about the effectiveness.

It is pretty clear this is nor particularly valuable optimisation in any case. If removing this allows better optimisation of modern cases or cleans up architecture significantly then it definitely should go.
Comment 4 Andreas Kling 2017-01-17 14:45:57 PST
Created attachment 299062 [details]
Patch
Comment 5 Antti Koivisto 2017-01-17 14:46:57 PST
Comment on attachment 299062 [details]
Patch

Let's try it!
Comment 6 WebKit Commit Bot 2017-01-17 15:25:56 PST
Comment on attachment 299062 [details]
Patch

Clearing flags on attachment: 299062

Committed r210826: <http://trac.webkit.org/changeset/210826>
Comment 7 WebKit Commit Bot 2017-01-17 15:26:01 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Darin Adler 2017-02-12 21:39:29 PST
Comment on attachment 299062 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=299062&action=review

> Source/WebCore/dom/StyledElement.cpp:223
> +    RefPtr<StyleProperties> style = MutableStyleProperties::create(isSVGElement() ? SVGAttributeMode : HTMLQuirksMode);

Should be a Ref, not a RefPtr. Normally I use auto in a case like this, which would give use Ref<MutableStyleProperties>.

> Source/WebCore/dom/StyledElement.cpp:224
> +    for (const Attribute& attribute : attributesIterator())

I like auto& here.

> Source/WebCore/dom/StyledElement.cpp:225
> +        collectStyleForPresentationAttribute(attribute.name(), attribute.value(), static_cast<MutableStyleProperties&>(*style));

Typecast would not be needed here if we used the correct type above. If we used auto, then I think the argument could just be "style".