| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 namespace blink { | 27 namespace blink { |
| 28 | 28 |
| 29 StyleTransformData::StyleTransformData() | 29 StyleTransformData::StyleTransformData() |
| 30 : m_operations(ComputedStyle::initialTransform()), | 30 : m_operations(ComputedStyle::initialTransform()), |
| 31 m_origin(ComputedStyle::initialTransformOrigin()), | 31 m_origin(ComputedStyle::initialTransformOrigin()), |
| 32 m_motion(ComputedStyle::initialOffsetAnchor(), | 32 m_motion(ComputedStyle::initialOffsetAnchor(), |
| 33 ComputedStyle::initialOffsetPosition(), | 33 ComputedStyle::initialOffsetPosition(), |
| 34 nullptr, | 34 nullptr, |
| 35 ComputedStyle::initialOffsetDistance(), | 35 ComputedStyle::initialOffsetDistance(), |
| 36 ComputedStyle::initialOffsetRotation()), | 36 ComputedStyle::initialOffsetRotation()), |
| 37 m_perspectiveOrigin(ComputedStyle::initialPerspectiveOrigin()), |
| 37 m_translate(ComputedStyle::initialTranslate()), | 38 m_translate(ComputedStyle::initialTranslate()), |
| 38 m_rotate(ComputedStyle::initialRotate()), | 39 m_rotate(ComputedStyle::initialRotate()), |
| 39 m_scale(ComputedStyle::initialScale()) {} | 40 m_scale(ComputedStyle::initialScale()), |
| 41 m_perspective(ComputedStyle::initialPerspective()), |
| 42 m_transformStyle3D(ComputedStyle::initialTransformStyle3D()), |
| 43 m_backfaceVisibility(ComputedStyle::initialBackfaceVisibility()), |
| 44 m_hasInlineTransform(false) {} |
| 40 | 45 |
| 41 StyleTransformData::StyleTransformData(const StyleTransformData& o) | 46 StyleTransformData::StyleTransformData(const StyleTransformData& o) |
| 42 : RefCounted<StyleTransformData>(), | 47 : RefCounted<StyleTransformData>(), |
| 43 m_operations(o.m_operations), | 48 m_operations(o.m_operations), |
| 44 m_origin(o.m_origin), | 49 m_origin(o.m_origin), |
| 45 m_motion(o.m_motion), | 50 m_motion(o.m_motion), |
| 51 m_perspectiveOrigin(o.m_perspectiveOrigin), |
| 46 m_translate(o.m_translate), | 52 m_translate(o.m_translate), |
| 47 m_rotate(o.m_rotate), | 53 m_rotate(o.m_rotate), |
| 48 m_scale(o.m_scale) {} | 54 m_scale(o.m_scale), |
| 55 m_perspective(o.m_perspective), |
| 56 m_transformStyle3D(o.m_transformStyle3D), |
| 57 m_backfaceVisibility(o.m_backfaceVisibility), |
| 58 m_hasInlineTransform(o.m_hasInlineTransform) {} |
| 59 |
| 60 bool StyleTransformData::transformDataEquivalent( |
| 61 const StyleTransformData& other) const { |
| 62 return m_origin == other.m_origin && m_operations == other.m_operations && |
| 63 m_motion == other.m_motion && |
| 64 dataEquivalent<TransformOperation>(m_translate, other.m_translate) && |
| 65 dataEquivalent<TransformOperation>(m_rotate, other.m_rotate) && |
| 66 dataEquivalent<TransformOperation>(m_scale, other.m_scale); |
| 67 } |
| 49 | 68 |
| 50 bool StyleTransformData::operator==(const StyleTransformData& o) const { | 69 bool StyleTransformData::operator==(const StyleTransformData& o) const { |
| 51 return m_origin == o.m_origin && m_operations == o.m_operations && | 70 return transformDataEquivalent(o) && |
| 52 m_motion == o.m_motion && | 71 m_perspectiveOrigin == o.m_perspectiveOrigin && |
| 53 dataEquivalent<TransformOperation>(m_translate, o.m_translate) && | 72 m_perspective == o.m_perspective && |
| 54 dataEquivalent<TransformOperation>(m_rotate, o.m_rotate) && | 73 m_transformStyle3D == o.m_transformStyle3D && |
| 55 dataEquivalent<TransformOperation>(m_scale, o.m_scale); | 74 m_backfaceVisibility == o.m_backfaceVisibility && |
| 75 m_hasInlineTransform == o.m_hasInlineTransform; |
| 56 } | 76 } |
| 57 | 77 |
| 58 bool StyleTransformData::has3DTransform() const { | 78 bool StyleTransformData::has3DTransform() const { |
| 59 return m_operations.has3DOperation() || | 79 return m_operations.has3DOperation() || |
| 60 (m_translate && m_translate->z() != 0) || | 80 (m_translate && m_translate->z() != 0) || |
| 61 (m_rotate && (m_rotate->x() != 0 || m_rotate->y() != 0)) || | 81 (m_rotate && (m_rotate->x() != 0 || m_rotate->y() != 0)) || |
| 62 (m_scale && m_scale->z() != 1); | 82 (m_scale && m_scale->z() != 1); |
| 63 } | 83 } |
| 64 | 84 |
| 65 } // namespace blink | 85 } // namespace blink |
| OLD | NEW |