Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: third_party/WebKit/Source/core/style/StyleTransformData.cpp

Issue 2454543002: Correct the initial value of CSS independent transform properties (Closed)
Patch Set: git cl format Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 15 matching lines...) Expand all
26 26
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_translate(ComputedStyle::initialTranslate()),
38 m_rotate(ComputedStyle::initialRotate()),
39 m_scale(ComputedStyle::initialScale()) {}
37 40
38 StyleTransformData::StyleTransformData(const StyleTransformData& o) 41 StyleTransformData::StyleTransformData(const StyleTransformData& o)
39 : RefCounted<StyleTransformData>(), 42 : RefCounted<StyleTransformData>(),
40 m_operations(o.m_operations), 43 m_operations(o.m_operations),
41 m_origin(o.m_origin), 44 m_origin(o.m_origin),
42 m_motion(o.m_motion), 45 m_motion(o.m_motion),
43 m_translate(o.m_translate), 46 m_translate(o.m_translate),
44 m_rotate(o.m_rotate), 47 m_rotate(o.m_rotate),
45 m_scale(o.m_scale) {} 48 m_scale(o.m_scale) {}
46 49
47 bool StyleTransformData::operator==(const StyleTransformData& o) const { 50 bool StyleTransformData::operator==(const StyleTransformData& o) const {
48 return m_origin == o.m_origin && m_operations == o.m_operations && 51 return m_origin == o.m_origin && m_operations == o.m_operations &&
49 m_motion == o.m_motion && 52 m_motion == o.m_motion &&
50 dataEquivalent<TransformOperation>(m_translate, o.m_translate) && 53 dataEquivalent<TransformOperation>(m_translate, o.m_translate) &&
51 dataEquivalent<TransformOperation>(m_rotate, o.m_rotate) && 54 dataEquivalent<TransformOperation>(m_rotate, o.m_rotate) &&
52 dataEquivalent<TransformOperation>(m_scale, o.m_scale); 55 dataEquivalent<TransformOperation>(m_scale, o.m_scale);
53 } 56 }
54 57
55 bool StyleTransformData::has3DTransform() const { 58 bool StyleTransformData::has3DTransform() const {
56 return m_operations.has3DOperation() || 59 return m_operations.has3DOperation() ||
57 (m_translate && m_translate->z() != 0) || 60 (m_translate && m_translate->z() != 0) ||
58 (m_rotate && (m_rotate->x() != 0 || m_rotate->y() != 0)) || 61 (m_rotate && (m_rotate->x() != 0 || m_rotate->y() != 0)) ||
59 (m_scale && m_scale->z() != 1); 62 (m_scale && m_scale->z() != 1);
60 } 63 }
61 64
62 } // namespace blink 65 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698