| Index: third_party/WebKit/Source/core/dom/NodeComputedStyle.h
|
| diff --git a/third_party/WebKit/Source/core/dom/NodeComputedStyle.h b/third_party/WebKit/Source/core/dom/NodeComputedStyle.h
|
| index d7345264df9b5a75a8206a69643b3dba166c56d9..1ce6c888a28b70e6adb1d30f0c5ad9a87693f760 100644
|
| --- a/third_party/WebKit/Source/core/dom/NodeComputedStyle.h
|
| +++ b/third_party/WebKit/Source/core/dom/NodeComputedStyle.h
|
| @@ -59,6 +59,27 @@ inline ComputedStyle* Node::mutableComputedStyle() const
|
| return m_data.m_computedStyle;
|
| }
|
|
|
| +inline void Node::setComputedStyle(PassRefPtr<ComputedStyle> computedStyle)
|
| +{
|
| + if (mutableComputedStyle() == computedStyle.get())
|
| + return;
|
| +
|
| + if (hasRareData()) {
|
| + // If the DataUnion is an ElementRareData - set the ComputedStyle on that ElementRareData.
|
| + NodeRareData* rareData = this->rareData();
|
| + if (rareData->isElementRareData())
|
| + static_cast<ElementRareData*>(rareData)->setComputedStyle(computedStyle);
|
| + } else if (hasLayoutObject()) {
|
| + // If the DataUnion is a LayoutObject - set the ComputedStyle on that LayoutObject.
|
| + m_data.m_layoutObject->setStyleFromNodeOrElement(computedStyle);
|
| + } else {
|
| + // If the DataUnion is a ComputedStyle - make it point to the new ComputedStyle passed in.
|
| + if (m_data.m_computedStyle)
|
| + m_data.m_computedStyle->deref();
|
| + m_data.m_computedStyle = computedStyle.leakRef();
|
| + }
|
| +}
|
| +
|
| inline const ComputedStyle* Node::parentComputedStyle() const
|
| {
|
| if (isSlotOrActiveInsertionPoint())
|
|
|