WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
100776
Avoid unnecessary style recalcs on class attribute mutation
https://bugs.webkit.org/show_bug.cgi?id=100776
Summary
Avoid unnecessary style recalcs on class attribute mutation
Antti Koivisto
Reported
2012-10-30 11:48:39 PDT
There is no need to invalidate element style on class attribute change if neither the added or removed classes featured in any active stylesheet.
Attachments
patch
(12.09 KB, patch)
2012-10-30 12:13 PDT
,
Antti Koivisto
kling
: review-
Details
Formatted Diff
Diff
another try
(12.65 KB, patch)
2012-10-30 12:53 PDT
,
Antti Koivisto
kling
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Antti Koivisto
Comment 1
2012-10-30 12:13:11 PDT
Created
attachment 171495
[details]
patch
Andreas Kling
Comment 2
2012-10-30 12:30:26 PDT
Comment on
attachment 171495
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=171495&action=review
Cool idea! r- for causing unnecessary conversions from immutable to mutable attribute data, rest looks good.
> Source/WebCore/css/RuleFeature.cpp:46 > + end = other.classesInRules.end(); > + for (HashSet<AtomicStringImpl*>::iterator it = other.classesInRules.begin(); it != end; ++it) > + classesInRules.add(*it);
Looks like we could be using const_iterators in this function.
> Source/WebCore/dom/Element.cpp:786 > + SpaceSplitString oldClasses = mutableAttributeData()->classNames();
This will force promotion from ImmutableElementAttributeData to MutableElementAttributeData for all elements with a class attribute the first time they're parsed.
> Source/WebCore/dom/SpaceSplitString.cpp:122 > + // FIXME: add() does not allow duplicates but createVector() does.
Huh.
Antti Koivisto
Comment 3
2012-10-30 12:53:58 PDT
Created
attachment 171509
[details]
another try
Antti Koivisto
Comment 4
2012-10-30 13:34:41 PDT
http://trac.webkit.org/changeset/132941
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug