Bug 100395 - Avoid unnecessary style recalcs on id attribute mutation
Summary: Avoid unnecessary style recalcs on id attribute mutation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-25 10:32 PDT by Antti Koivisto
Modified: 2012-11-02 12:38 PDT (History)
0 users

See Also:


Attachments
patch (4.30 KB, patch)
2012-10-25 10:47 PDT, Antti Koivisto
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2012-10-25 10:32:13 PDT
There is no need to invalidate element style on id attribute change if neither the old nor the new id were mentioned in any stylesheet. This is similar to the optimization we already have for class attributes.
Comment 1 Antti Koivisto 2012-10-25 10:47:13 PDT
Created attachment 170690 [details]
patch
Comment 2 Andreas Kling 2012-10-25 10:55:21 PDT
Comment on attachment 170690 [details]
patch

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

Why didn't we do this already? r=me

> Source/WebCore/css/StyleResolver.cpp:4241
> +bool StyleResolver::hasSelectorForId(const AtomicString &idValue) const

OH GOD & PLACEMENT

> Source/WebCore/dom/Element.cpp:716
> +           StyleResolver* styleResolver = document()->styleResolverIfExists();

Indentation derp.
Comment 3 Antti Koivisto 2012-10-25 12:35:32 PDT
http://trac.webkit.org/changeset/132516
Comment 4 Alexey Proskuryakov 2012-11-02 12:38:03 PDT
This has caused bug 101047.