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

Issue 796583002: Use the HashSet of attribute names in SharedStyleFinder. (Closed)

Created:
6 years ago by esprehn
Modified:
6 years ago
Reviewers:
ojan, eseidel
CC:
ojan, abarth-chromium, mojo-reviews_chromium.org
Base URL:
git@github.com:domokit/mojo.git@master
Project:
mojo
Visibility:
Public.

Description

Use the HashSet of attribute names in SharedStyleFinder. Instead of trying to match the actual attribute rules, lets just look at the HashSet of attribute names. This is faster, though possibly less optimal if you use compound rules like .foo[attr]. That's rare though, and removing this extra RuleSet will allow simplifying SelectorChecker since hasAnyMatchingRules required a special mode where it tried to match selectors but ignored if the scope could really match. This paves the way to moving the RuleFeatureSet to be per-TreeScope instead of per-Document. I also made the API of classNamesAffectedByRules match the newly added attributesAffectedByRules to make SharedStyleFinder consistent. R=ojan@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/c5ef9d66e77db0097e024c8649707612917530ee

Patch Set 1 #

Total comments: 1

Patch Set 2 : Use C++11 loops. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -88 lines) Patch
M sky/engine/core/css/ElementRuleCollector.h View 1 chunk +0 lines, -1 line 0 comments Download
M sky/engine/core/css/ElementRuleCollector.cpp View 1 chunk +0 lines, -16 lines 0 comments Download
M sky/engine/core/css/RuleFeature.h View 4 chunks +0 lines, -26 lines 0 comments Download
M sky/engine/core/css/RuleFeature.cpp View 2 chunks +0 lines, -11 lines 0 comments Download
M sky/engine/core/css/RuleSet.cpp View 1 chunk +1 line, -1 line 0 comments Download
M sky/engine/core/css/resolver/SharedStyleFinder.h View 2 chunks +3 lines, -6 lines 0 comments Download
M sky/engine/core/css/resolver/SharedStyleFinder.cpp View 1 6 chunks +19 lines, -12 lines 0 comments Download
M sky/engine/core/css/resolver/StyleResolver.h View 1 chunk +0 lines, -1 line 0 comments Download
M sky/engine/core/css/resolver/StyleResolver.cpp View 4 chunks +1 line, -14 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
esprehn
6 years ago (2014-12-10 21:32:53 UTC) #2
ojan
lgtm https://codereview.chromium.org/796583002/diff/1/sky/engine/core/css/resolver/SharedStyleFinder.cpp File sky/engine/core/css/resolver/SharedStyleFinder.cpp (right): https://codereview.chromium.org/796583002/diff/1/sky/engine/core/css/resolver/SharedStyleFinder.cpp#newcode66 sky/engine/core/css/resolver/SharedStyleFinder.cpp:66: for (AttributeCollection::iterator it = attributes.begin(); it != end; ...
6 years ago (2014-12-10 23:22:58 UTC) #3
esprehn
6 years ago (2014-12-11 01:12:11 UTC) #4
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
c5ef9d66e77db0097e024c8649707612917530ee (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698