| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/ObjectPaintProperties.h" | 5 #include "core/paint/ObjectPaintProperties.h" |
| 6 | 6 |
| 7 namespace blink { | 7 namespace blink { |
| 8 | 8 |
| 9 void ObjectPaintProperties::updateContentsProperties() const { | 9 std::unique_ptr<PropertyTreeState> ObjectPaintProperties::contentsProperties( |
| 10 DCHECK(m_localBorderBoxProperties); | 10 PropertyTreeState* localBorderBoxProperties, |
| 11 DCHECK(!m_contentsProperties); | 11 ObjectPaintProperties* paintProperties) { |
| 12 if (!localBorderBoxProperties) |
| 13 return nullptr; |
| 12 | 14 |
| 13 m_contentsProperties = | 15 std::unique_ptr<PropertyTreeState> contents = |
| 14 WTF::makeUnique<PropertyTreeState>(*m_localBorderBoxProperties); | 16 WTF::makeUnique<PropertyTreeState>(*localBorderBoxProperties); |
| 15 | 17 |
| 16 if (scrollTranslation()) | 18 if (paintProperties) { |
| 17 m_contentsProperties->setTransform(scrollTranslation()); | 19 if (paintProperties->scrollTranslation()) |
| 18 if (overflowClip()) | 20 contents->setTransform(paintProperties->scrollTranslation()); |
| 19 m_contentsProperties->setClip(overflowClip()); | 21 if (paintProperties->overflowClip()) |
| 20 else if (cssClip()) | 22 contents->setClip(paintProperties->overflowClip()); |
| 21 m_contentsProperties->setClip(cssClip()); | 23 else if (paintProperties->cssClip()) |
| 24 contents->setClip(paintProperties->cssClip()); |
| 25 } |
| 22 | 26 |
| 23 // TODO(chrishtr): cssClipFixedPosition needs to be handled somehow. | 27 // TODO(chrishtr): cssClipFixedPosition needs to be handled somehow. |
| 28 |
| 29 return contents; |
| 24 } | 30 } |
| 25 | 31 |
| 26 } // namespace blink | 32 } // namespace blink |
| OLD | NEW |