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

Issue 2293713002: Made ElementRareData store ComputedStyle on LayoutObject if possible. (Closed)

Created:
4 years, 3 months ago by Bugs Nash
Modified:
4 years, 3 months ago
CC:
blink-reviews, blink-reviews-dom_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Made ElementRareData store ComputedStyle on LayoutObject if possible. Made ElementRareData store ComputedStyle on LayoutObject of it's base class NodeRareDataBase if it has a LayoutObject. Otherwise it is stored on the ComputedStyle member of ElementRareData. The reason for this is to make it consistent with storage of ComputedStyle on Node, which stores a union that can be one of: 1) a ComputedStyle 2) a LayoutObject (ComputedStyle can be stored on this) 3) a NodeRareData (LayoutObject can be stored on this which stores ComputedStyle or if no LayoutObject ComputedStyle can be stored directly on ElementRareData) This patch encapsulates the logic of where to store the ComputedStyle on the ElementRareData so that it doesn't need to be done at the call site (e.g. in new method Node::setComputedStyle from https://codereview.chromium.org/2001453002) The clearComputedStyle method is special and only clears the ComputedStyle member as its current use is not intended to clear a LayoutObject's ComputedStyle. BUG=595137 Committed: https://crrev.com/c542d3744b905a2a00f5ac2dd2047a6a323ec181 Cr-Commit-Position: refs/heads/master@{#418453}

Patch Set 1 #

Patch Set 2 : removed whitespace #

Patch Set 3 : Added unit test #

Total comments: 4

Patch Set 4 : Addressed reviewer comments #

Patch Set 5 : Added CORE_EXPORT to NodeRareDataBase #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -8 lines) Patch
M third_party/WebKit/Source/core/BUILD.gn View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Element.cpp View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/dom/ElementRareData.h View 1 2 3 1 chunk +19 lines, -3 lines 2 comments Download
A third_party/WebKit/Source/core/dom/ElementRareDataTest.cpp View 1 2 1 chunk +30 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Node.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/NodeRareData.h View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 51 (31 generated)
Bugs Nash
4 years, 3 months ago (2016-08-30 04:36:48 UTC) #7
nainar
The change looks good. Would suggest adding a Unit Test that tests our ability to ...
4 years, 3 months ago (2016-08-30 04:59:43 UTC) #8
Bugs Nash
On 2016/08/30 at 04:59:43, nainar wrote: > The change looks good. > > Would suggest ...
4 years, 3 months ago (2016-08-30 05:05:22 UTC) #9
meade_UTC10
This seems fine to me, modulo questions about whether the structure should be simplified so ...
4 years, 3 months ago (2016-09-02 03:33:37 UTC) #10
Bugs Nash
On 2016/09/02 at 03:33:37, meade wrote: > This seems fine to me, modulo questions about ...
4 years, 3 months ago (2016-09-02 04:27:02 UTC) #11
meade_UTC10
lgtm
4 years, 3 months ago (2016-09-02 04:42:49 UTC) #12
Bugs Nash
4 years, 3 months ago (2016-09-04 22:01:30 UTC) #14
Bugs Nash
Have added unit test
4 years, 3 months ago (2016-09-05 05:41:14 UTC) #18
nainar
On 2016/09/05 at 05:41:14, bugsnash wrote: > Have added unit test lgtm :) thanks for ...
4 years, 3 months ago (2016-09-05 05:44:38 UTC) #19
nainar
Sorry for coming back to this again. Could you please add the fact that clearComputedStyle ...
4 years, 3 months ago (2016-09-06 06:31:24 UTC) #24
Timothy Loh
ok lgtm but you still have a red bot (maybe needs CORE_EXPORT on NodeRareDataBase?) https://codereview.chromium.org/2293713002/diff/40001/third_party/WebKit/Source/core/dom/ElementRareData.h ...
4 years, 3 months ago (2016-09-07 04:56:07 UTC) #25
Bugs Nash
Tim can you please confirm you're ok with the clearComputedStyle solution before I commit? https://codereview.chromium.org/2293713002/diff/40001/third_party/WebKit/Source/core/dom/ElementRareData.h ...
4 years, 3 months ago (2016-09-13 21:46:55 UTC) #39
Timothy Loh
On 2016/09/13 21:46:55, Bugs Nash wrote: > Tim can you please confirm you're ok with ...
4 years, 3 months ago (2016-09-14 01:42:25 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2293713002/100001
4 years, 3 months ago (2016-09-14 01:48:01 UTC) #43
commit-bot: I haz the power
Committed patchset #5 (id:100001)
4 years, 3 months ago (2016-09-14 01:58:44 UTC) #44
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/c542d3744b905a2a00f5ac2dd2047a6a323ec181 Cr-Commit-Position: refs/heads/master@{#418453}
4 years, 3 months ago (2016-09-14 02:01:49 UTC) #46
esprehn
So I think there's been some confusion here and in the other patch https://codereview.chromium.org/2001453002 Maybe ...
4 years, 3 months ago (2016-09-24 02:10:53 UTC) #48
blink-reviews
Seems like we need a meeting and another redesign of the squad project Bugs On ...
4 years, 3 months ago (2016-09-24 03:44:16 UTC) #49
chromium-reviews
Seems like we need a meeting and another redesign of the squad project Bugs On ...
4 years, 3 months ago (2016-09-24 03:44:16 UTC) #50
Bugs Nash
4 years, 2 months ago (2016-09-28 02:15:58 UTC) #51
Message was sent while issue was closed.
A revert of this CL (patchset #5 id:100001) has been created in
https://codereview.chromium.org/2378573002/ by bugsnash@chromium.org.

The reason for reverting is: Storage of ComputedStyle on LayoutObject causes
invalid LayoutObject state. Also no longer required for consistency as Squad
project requires redesign and will no longer store ComputedStyle on Node's data
union..

Powered by Google App Engine
This is Rietveld 408576698