Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Issue 837883002: Store features in the ScopedStyleResoolver. (Closed)

Created:
5 years, 11 months ago by esprehn
Modified:
5 years, 11 months ago
Reviewers:
ojan
CC:
abarth-chromium, mojo-reviews_chromium.org, ojan
Base URL:
git@github.com:domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Store features in the ScopedStyleResoolver. This now means that using a class/id/attribute selector in one scope will not cause style recalcs in other scopes in the page when something with that feature changes. It also removes an iteration over all the scopes that used to collect features. I also removed all the extra cases around adding/removing classes since the general case can handle them. In addition I removed the check for classStringHasClassName which looked to see if the string was all whitespace. This check dated way back to fixing an assert in code we don't even have anymore. Assertion fix aside all the extra check optimized for was if you wrote class=" " with no names, which will now cause an extra malloc of the SpaceSplitString::Data. This seems super rare, it makes more sense to not scan the class string every time the list of classes changes which is far more common than setting a string of only whitespace. R=ojan@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/a1fb756cef8219f43af55ded8ea72f6e2af29f99

Patch Set 1 #

Patch Set 2 : Simpler even. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+113 lines, -224 lines) Patch
M sky/engine/core/css/RuleFeature.h View 1 chunk +0 lines, -7 lines 0 comments Download
M sky/engine/core/css/RuleFeature.cpp View 1 chunk +0 lines, -67 lines 0 comments Download
M sky/engine/core/css/resolver/ScopedStyleResolver.h View 1 3 chunks +6 lines, -1 line 0 comments Download
M sky/engine/core/css/resolver/ScopedStyleResolver.cpp View 1 1 chunk +2 lines, -8 lines 0 comments Download
M sky/engine/core/css/resolver/SharedStyleFinder.h View 3 chunks +2 lines, -8 lines 0 comments Download
M sky/engine/core/css/resolver/SharedStyleFinder.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M sky/engine/core/css/resolver/StyleResolver.h View 6 chunks +1 line, -24 lines 0 comments Download
M sky/engine/core/css/resolver/StyleResolver.cpp View 5 chunks +1 line, -33 lines 0 comments Download
M sky/engine/core/dom/Element.h View 2 chunks +6 lines, -0 lines 0 comments Download
M sky/engine/core/dom/Element.cpp View 1 6 chunks +91 lines, -53 lines 1 comment Download
M sky/engine/core/dom/SpaceSplitString.cpp View 1 chunk +1 line, -1 line 0 comments Download
M sky/engine/core/dom/StyleEngine.h View 1 chunk +0 lines, -2 lines 0 comments Download
M sky/engine/core/dom/StyleEngine.cpp View 1 chunk +0 lines, -17 lines 0 comments Download
M sky/engine/core/dom/StyleSheetCollection.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 5 (1 generated)
esprehn
5 years, 11 months ago (2015-01-07 03:52:43 UTC) #2
ojan
lgtm https://codereview.chromium.org/837883002/diff/20001/sky/engine/core/dom/Element.cpp File sky/engine/core/dom/Element.cpp (left): https://codereview.chromium.org/837883002/diff/20001/sky/engine/core/dom/Element.cpp#oldcode716 sky/engine/core/dom/Element.cpp:716: if (classStringHasClassName(newClassString)) { Include in the change description ...
5 years, 11 months ago (2015-01-07 04:03:27 UTC) #3
esprehn
On 2015/01/07 at 04:03:27, ojan wrote: > lgtm > > https://codereview.chromium.org/837883002/diff/20001/sky/engine/core/dom/Element.cpp > File sky/engine/core/dom/Element.cpp (left): ...
5 years, 11 months ago (2015-01-07 04:26:42 UTC) #4
esprehn
5 years, 11 months ago (2015-01-07 06:22:50 UTC) #5
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
a1fb756cef8219f43af55ded8ea72f6e2af29f99 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698