|
Add a fast-path for independent inherited properties
(Note: This patch was reverted in crrev.com/2213223004 because of issues
crbug.com/633859 and crbug.com/634254. These issues were caused from
setting isInherited to false instead of true for the StyleBuilder
generated inherit functions, and a slotting bug from skipping child
recalc in HTMLSlotElement and InsertionPoints, which have both now been
fixed in this patch & have tests added.)
Add a fast-path for inherited properties which do not depend on and do
not affect any other properties on ComputedStyle. When these properties
are modified in a parent element, set them directly on ComputedStyle and
skip doing a full recalc for elements only affected by this change.
Also implemented two of these properties: visibility and pointer-events,
storing an extra 2 bits per ComputedStyle. This increases the size of
ComputedStyle by 1 byte on Windows and some Android builds (due to
aligned fields), which increases the memory usage for a standard page
with ~1000 elements by up to 1kb (although potentially up to 4/8kb on
32/64 bit builds due to packing, although this depends on the allocator
implementation details) but realistically less since style sharing only
creates one ComputedStyle object for each unique style.
Benchmarks show a speed increase of up to 2x for setting these
properties on the root element of a typical web page (Facebook, Twitter,
Pinterest, Amazon, Wikipedia) and letting the change propagate directly
onto the child ComputedStyle objects, rather than doing a full style
recalc.
Initial Benchmarks:
https://docs.google.com/spreadsheets/d/1mUuJEs8cPWyNTR7tQw27oxq6fDTvWiAwgatf_g--B4w/edit#gid=1597242813
Follow-up Benchmarks:
https://docs.google.com/spreadsheets/d/1mUuJEs8cPWyNTR7tQw27oxq6fDTvWiAwgatf_g--B4w/edit#gid=918856082
BUG= 622138
Committed: https://crrev.com/d0c57905368c76aba662dbda3b4e13cb9bd454bf
Cr-Commit-Position: refs/heads/master@{#413406}
Total comments: 6
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+512 lines, -20 lines) |
Patch |
 |
A |
third_party/WebKit/LayoutTests/fast/css/invalidation/independent-inheritance-fast-path.html
|
View
|
|
1 chunk |
+72 lines, -0 lines |
0 comments
|
Download
|
 |
A |
third_party/WebKit/LayoutTests/fast/css/invalidation/independent-inheritance-fast-path-inherit-keyword.html
|
View
|
1
2
3
|
1 chunk |
+22 lines, -0 lines |
0 comments
|
Download
|
 |
A |
third_party/WebKit/LayoutTests/fast/css/invalidation/independent-inheritance-fast-path-initial-keyword.html
|
View
|
1
2
3
|
1 chunk |
+25 lines, -0 lines |
0 comments
|
Download
|
 |
A |
third_party/WebKit/LayoutTests/fast/css/invalidation/independent-inheritance-fast-path-multiple-properties.html
|
View
|
|
1 chunk |
+95 lines, -0 lines |
0 comments
|
Download
|
 |
A |
third_party/WebKit/LayoutTests/fast/css/invalidation/independent-inheritance-fast-path-slots.html
|
View
|
1
2
|
1 chunk |
+63 lines, -0 lines |
0 comments
|
Download
|
 |
A |
third_party/WebKit/LayoutTests/fast/css/invalidation/non-independent-inheritance-identical-computed-styles.html
|
View
|
|
1 chunk |
+74 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/build/scripts/css_properties.py
|
View
|
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/build/scripts/make_style_builder.py
|
View
|
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
|
View
|
1
2
|
4 chunks |
+12 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/css/CSSProperties.in
|
View
|
1
2
|
3 chunks |
+8 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/css/resolver/StyleResolverStats.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/css/resolver/StyleResolverStats.cpp
|
View
|
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/dom/Element.h
|
View
|
1
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/dom/Element.cpp
|
View
|
1
|
3 chunks |
+32 lines, -6 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/dom/Node.h
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/html/HTMLSlotElement.cpp
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/style/ComputedStyle.h
|
View
|
1
2
|
10 chunks |
+54 lines, -6 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/style/ComputedStyle.cpp
|
View
|
1
2
|
5 chunks |
+37 lines, -3 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/style/ComputedStyleConstants.h
|
View
|
1
2
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
Total messages: 26 (17 generated)
|