| 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 ObjectPaintProperties::PropertyTreeStateWithOffset | 9 ObjectPaintProperties::PropertyTreeStateWithOffset |
| 10 ObjectPaintProperties::contentsProperties() const { | 10 ObjectPaintProperties::contentsProperties() const { |
| 11 ObjectPaintProperties::PropertyTreeStateWithOffset propertiesWithOffset = | 11 ObjectPaintProperties::PropertyTreeStateWithOffset propertiesWithOffset = |
| 12 *localBorderBoxProperties(); | 12 *localBorderBoxProperties(); |
| 13 if (svgLocalToBorderBoxTransform()) { | 13 |
| 14 propertiesWithOffset.propertyTreeState.setTransform( | 14 if (scrollTranslation()) |
| 15 svgLocalToBorderBoxTransform()); | |
| 16 // There's no paint offset for the contents because | |
| 17 // svgLocalToBorderBoxTransform bakes in the paint offset. | |
| 18 propertiesWithOffset.paintOffset = LayoutPoint(); | |
| 19 } else if (scrollTranslation()) { | |
| 20 propertiesWithOffset.propertyTreeState.setTransform(scrollTranslation()); | 15 propertiesWithOffset.propertyTreeState.setTransform(scrollTranslation()); |
| 21 } | |
| 22 | 16 |
| 23 if (overflowClip()) | 17 if (overflowClip()) |
| 24 propertiesWithOffset.propertyTreeState.setClip(overflowClip()); | 18 propertiesWithOffset.propertyTreeState.setClip(overflowClip()); |
| 25 else if (cssClip()) | 19 else if (cssClip()) |
| 26 propertiesWithOffset.propertyTreeState.setClip(cssClip()); | 20 propertiesWithOffset.propertyTreeState.setClip(cssClip()); |
| 27 | 21 |
| 28 // TODO(chrishtr): cssClipFixedPosition needs to be handled somehow. | 22 // TODO(chrishtr): cssClipFixedPosition needs to be handled somehow. |
| 29 | 23 |
| 30 return propertiesWithOffset; | 24 return propertiesWithOffset; |
| 31 } | 25 } |
| 32 | 26 |
| 33 } // namespace blink | 27 } // namespace blink |
| OLD | NEW |