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 Review-Url: https://codereview.chromium.org/2293713002 Cr-Commit-Position: refs/heads/master@{#418453}
Showing
Please register or sign in to comment