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

Issue 135183002: Avoid unnecessary style recalc for subtree of focused element. (Closed)

Created:
6 years, 11 months ago by rune
Modified:
6 years, 10 months ago
Reviewers:
esprehn, eseidel
CC:
blink-reviews, dglazkov+blink, sof, eae+blinkwatch, adamk+blink_chromium.org, Inactive
Visibility:
Public.

Description

Avoid unnecessary style recalc for subtree of focused element. Updating the styles for an element that changes its focus state only needs to force a recalc of the subtree if the subtree contains an element that could match a selector which contains a :focus pseudo class left of a child or descendant combinator. At the same time, that :focus pseudo must match the element we are updating focus state for. This is indicated by the return value of Element::childrenAffectedByFocus. This change does a LocalStyleChange when updating the focus state of an element which returns false for childrenAffectedByFocus, and SubtreeStyleChange otherwise. BUG=315923 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=166517

Patch Set 1 #

Patch Set 2 : Added unit test. #

Patch Set 3 : Added layout tests to count recalcStyles using the inspector. #

Patch Set 4 : --no-find-copies #

Patch Set 5 : Fixed contenteditable shadow dom regression. #

Total comments: 5

Patch Set 6 : Rebased onto master #

Patch Set 7 : Bleh. --no-find-copies. #

Patch Set 8 : Reverted shadow dom fix. #

Patch Set 9 : Simplified the code. #

Patch Set 10 : Corrected copyright/license. #

Patch Set 11 : Translated timeline tests into unit tests. #

Patch Set 12 : Corrected comments in tests. #

Total comments: 2

Patch Set 13 : Rebased #

Patch Set 14 : Typos in unit-test code. #

Patch Set 15 : Fixed Clang linking problem. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+266 lines, -4 lines) Patch
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
A Source/core/css/AffectedByFocusTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +253 lines, -0 lines 0 comments Download
M Source/core/dom/ContainerNode.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +12 lines, -4 lines 0 comments Download

Messages

Total messages: 36 (0 generated)
rune
6 years, 11 months ago (2014-01-15 13:34:37 UTC) #1
esprehn
https://codereview.chromium.org/135183002/diff/150001/Source/core/dom/ContainerNode.cpp File Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/135183002/diff/150001/Source/core/dom/ContainerNode.cpp#newcode794 Source/core/dom/ContainerNode.cpp:794: static inline StyleChangeType focusStyleChange(const ContainerNode* node) This should be ...
6 years, 11 months ago (2014-01-22 20:58:52 UTC) #2
rune
Thanks for reviewing. I've found issues with generated content (before/after) too. I'm digging my way ...
6 years, 11 months ago (2014-01-22 21:58:49 UTC) #3
rune
https://codereview.chromium.org/135183002/diff/150001/Source/core/dom/ContainerNode.cpp File Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/135183002/diff/150001/Source/core/dom/ContainerNode.cpp#newcode799 Source/core/dom/ContainerNode.cpp:799: if (node->isElementNode() && (toElement(node)->childrenAffectedByFocus() || toElement(node)->shadow())) On 2014/01/22 20:58:52, ...
6 years, 10 months ago (2014-01-30 17:24:40 UTC) #4
rune
This CL is now ready for review again. Since the shadow dom issue has been ...
6 years, 10 months ago (2014-01-30 23:24:36 UTC) #5
eseidel
Its so awesome that you're working on this, thank you. This causes jank on first ...
6 years, 10 months ago (2014-01-31 06:20:33 UTC) #6
eseidel
As cool as it is to see more unittest infrastructure built up, I wonder if ...
6 years, 10 months ago (2014-01-31 06:25:18 UTC) #7
eseidel
lgtm
6 years, 10 months ago (2014-01-31 06:25:46 UTC) #8
rune
On 2014/01/31 06:25:18, eseidel wrote: > As cool as it is to see more unittest ...
6 years, 10 months ago (2014-01-31 13:26:42 UTC) #9
rune
The CQ bit was checked by rune@opera.com
6 years, 10 months ago (2014-02-04 16:44:24 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rune@opera.com/135183002/330001
6 years, 10 months ago (2014-02-04 16:44:31 UTC) #11
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-04 16:44:33 UTC) #12
commit-bot: I haz the power
Failed to apply patch for Source/core/dom/ContainerNode.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 10 months ago (2014-02-04 16:44:34 UTC) #13
rune
The CQ bit was checked by rune@opera.com
6 years, 10 months ago (2014-02-04 17:30:53 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rune@opera.com/135183002/400001
6 years, 10 months ago (2014-02-04 17:31:06 UTC) #15
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-04 18:38:12 UTC) #16
commit-bot: I haz the power
Retried try job too often on mac_layout for step(s) webkit_lint http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_layout&number=18956
6 years, 10 months ago (2014-02-04 18:38:13 UTC) #17
rune
The CQ bit was checked by rune@opera.com
6 years, 10 months ago (2014-02-04 19:05:24 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rune@opera.com/135183002/630001
6 years, 10 months ago (2014-02-04 19:05:56 UTC) #19
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-04 22:26:57 UTC) #20
commit-bot: I haz the power
Retried try job too often on mac_blink_rel for step(s) blink_heap_unittests, blink_platform_unittests, webkit_lint, webkit_python_tests, webkit_tests, webkit_unit_tests, ...
6 years, 10 months ago (2014-02-04 22:26:58 UTC) #21
rune
The CQ bit was checked by rune@opera.com
6 years, 10 months ago (2014-02-05 10:06:54 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rune@opera.com/135183002/630001
6 years, 10 months ago (2014-02-05 10:07:06 UTC) #23
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-05 10:46:39 UTC) #24
commit-bot: I haz the power
Retried try job too often on mac_blink_rel for step(s) blink_heap_unittests, blink_platform_unittests, webkit_lint, webkit_python_tests, webkit_tests, webkit_unit_tests, ...
6 years, 10 months ago (2014-02-05 10:46:40 UTC) #25
rune
The CQ bit was checked by rune@opera.com
6 years, 10 months ago (2014-02-05 12:44:30 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rune@opera.com/135183002/860001
6 years, 10 months ago (2014-02-05 12:44:37 UTC) #27
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-05 14:11:59 UTC) #28
commit-bot: I haz the power
Retried try job too often on linux_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_blink_rel&number=20532
6 years, 10 months ago (2014-02-05 14:12:00 UTC) #29
rune
The CQ bit was checked by rune@opera.com
6 years, 10 months ago (2014-02-05 14:25:04 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rune@opera.com/135183002/860001
6 years, 10 months ago (2014-02-05 14:25:32 UTC) #31
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-05 15:56:00 UTC) #32
commit-bot: I haz the power
Retried try job too often on linux_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_blink_rel&number=20556
6 years, 10 months ago (2014-02-05 15:56:01 UTC) #33
rune
The CQ bit was checked by rune@opera.com
6 years, 10 months ago (2014-02-05 17:09:03 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rune@opera.com/135183002/860001
6 years, 10 months ago (2014-02-05 17:09:10 UTC) #35
commit-bot: I haz the power
6 years, 10 months ago (2014-02-05 17:32:37 UTC) #36
Message was sent while issue was closed.
Change committed as 166517

Powered by Google App Engine
This is Rietveld 408576698