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

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

Issue 2241993002: CSS Motion Path: New names for properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 3 months 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
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, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 case CSSPropertyClipPath: 982 case CSSPropertyClipPath:
983 case CSSPropertyAliasWebkitClipPath: 983 case CSSPropertyAliasWebkitClipPath:
984 case CSSPropertyWebkitBoxReflect: 984 case CSSPropertyWebkitBoxReflect:
985 case CSSPropertyFilter: 985 case CSSPropertyFilter:
986 case CSSPropertyAliasWebkitFilter: 986 case CSSPropertyAliasWebkitFilter:
987 case CSSPropertyBackdropFilter: 987 case CSSPropertyBackdropFilter:
988 case CSSPropertyZIndex: 988 case CSSPropertyZIndex:
989 case CSSPropertyPosition: 989 case CSSPropertyPosition:
990 case CSSPropertyMixBlendMode: 990 case CSSPropertyMixBlendMode:
991 case CSSPropertyIsolation: 991 case CSSPropertyIsolation:
992 case CSSPropertyOffsetPath:
suzyh_UTC10 (ex-contributor) 2016/09/19 01:21:04 Is this introducing a behaviour change?
Eric Willigers 2016/09/19 01:54:40 Bug fix, can move to a separate CL. https://draft
992 return true; 993 return true;
993 default: 994 default:
994 break; 995 break;
995 } 996 }
996 } 997 }
997 return false; 998 return false;
998 } 999 }
999 1000
1000 void ComputedStyle::updateIsStackingContext(bool isDocumentElement, bool isInTop Layer) 1001 void ComputedStyle::updateIsStackingContext(bool isDocumentElement, bool isInTop Layer)
1001 { 1002 {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 return scale() || rotate(); 1092 return scale() || rotate();
1092 } 1093 }
1093 1094
1094 void ComputedStyle::applyTransform(TransformationMatrix& result, const LayoutSiz e& borderBoxSize, ApplyTransformOrigin applyOrigin, ApplyMotionPath applyMotionP ath, ApplyIndependentTransformProperties applyIndependentTransformProperties) co nst 1095 void ComputedStyle::applyTransform(TransformationMatrix& result, const LayoutSiz e& borderBoxSize, ApplyTransformOrigin applyOrigin, ApplyMotionPath applyMotionP ath, ApplyIndependentTransformProperties applyIndependentTransformProperties) co nst
1095 { 1096 {
1096 applyTransform(result, FloatRect(FloatPoint(), FloatSize(borderBoxSize)), ap plyOrigin, applyMotionPath, applyIndependentTransformProperties); 1097 applyTransform(result, FloatRect(FloatPoint(), FloatSize(borderBoxSize)), ap plyOrigin, applyMotionPath, applyIndependentTransformProperties);
1097 } 1098 }
1098 1099
1099 void ComputedStyle::applyTransform(TransformationMatrix& result, const FloatRect & boundingBox, ApplyTransformOrigin applyOrigin, ApplyMotionPath applyMotionPath , ApplyIndependentTransformProperties applyIndependentTransformProperties) const 1100 void ComputedStyle::applyTransform(TransformationMatrix& result, const FloatRect & boundingBox, ApplyTransformOrigin applyOrigin, ApplyMotionPath applyMotionPath , ApplyIndependentTransformProperties applyIndependentTransformProperties) const
1100 { 1101 {
1101 if (!hasMotionPath()) 1102 if (!hasOffsetPath())
1102 applyMotionPath = ExcludeMotionPath; 1103 applyMotionPath = ExcludeMotionPath;
1103 bool applyTransformOrigin = requireTransformOrigin(applyOrigin, applyMotionP ath); 1104 bool applyTransformOrigin = requireTransformOrigin(applyOrigin, applyMotionP ath);
1104 1105
1105 float offsetX = transformOriginX().type() == Percent ? boundingBox.x() : 0; 1106 float offsetX = transformOriginX().type() == Percent ? boundingBox.x() : 0;
1106 float offsetY = transformOriginY().type() == Percent ? boundingBox.y() : 0; 1107 float offsetY = transformOriginY().type() == Percent ? boundingBox.y() : 0;
1107 1108
1108 float originX = 0; 1109 float originX = 0;
1109 float originY = 0; 1110 float originY = 0;
1110 float originZ = 0; 1111 float originZ = 0;
1111 1112
(...skipping 27 matching lines...) Expand all
1139 result.translate3d(-originX, -originY, -originZ); 1140 result.translate3d(-originX, -originY, -originZ);
1140 } 1141 }
1141 } 1142 }
1142 1143
1143 void ComputedStyle::applyMotionPathTransform(float originX, float originY, Trans formationMatrix& transform) const 1144 void ComputedStyle::applyMotionPathTransform(float originX, float originY, Trans formationMatrix& transform) const
1144 { 1145 {
1145 const StyleMotionData& motionData = m_rareNonInheritedData->m_transform->m_m otion; 1146 const StyleMotionData& motionData = m_rareNonInheritedData->m_transform->m_m otion;
1146 ASSERT(motionData.m_path); 1147 ASSERT(motionData.m_path);
1147 const StylePath& motionPath = *motionData.m_path; 1148 const StylePath& motionPath = *motionData.m_path;
1148 float pathLength = motionPath.length(); 1149 float pathLength = motionPath.length();
1149 float distance = floatValueForLength(motionData.m_offset, pathLength); 1150 float distance = floatValueForLength(motionData.m_distance, pathLength);
1150 float computedDistance; 1151 float computedDistance;
1151 if (motionPath.isClosed() && pathLength > 0) { 1152 if (motionPath.isClosed() && pathLength > 0) {
1152 computedDistance = fmod(distance, pathLength); 1153 computedDistance = fmod(distance, pathLength);
1153 if (computedDistance < 0) 1154 if (computedDistance < 0)
1154 computedDistance += pathLength; 1155 computedDistance += pathLength;
1155 } else { 1156 } else {
1156 computedDistance = clampTo<float>(distance, 0, pathLength); 1157 computedDistance = clampTo<float>(distance, 0, pathLength);
1157 } 1158 }
1158 1159
1159 FloatPoint point; 1160 FloatPoint point;
1160 float angle; 1161 float angle;
1161 motionPath.path().pointAndNormalAtLength(computedDistance, point, angle); 1162 motionPath.path().pointAndNormalAtLength(computedDistance, point, angle);
1162 1163
1163 if (motionData.m_rotation.type == MotionRotationFixed) 1164 if (motionData.m_rotation.type == OffsetRotationFixed)
1164 angle = 0; 1165 angle = 0;
1165 1166
1166 transform.translate(point.x() - originX, point.y() - originY); 1167 transform.translate(point.x() - originX, point.y() - originY);
1167 transform.rotate(angle + motionData.m_rotation.angle); 1168 transform.rotate(angle + motionData.m_rotation.angle);
1168 } 1169 }
1169 1170
1170 void ComputedStyle::setTextShadow(PassRefPtr<ShadowList> s) 1171 void ComputedStyle::setTextShadow(PassRefPtr<ShadowList> s)
1171 { 1172 {
1172 m_rareInheritedData.access()->textShadow = s; 1173 m_rareInheritedData.access()->textShadow = s;
1173 } 1174 }
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
1849 else 1850 else
1850 setMarginLeft(margin); 1851 setMarginLeft(margin);
1851 } else { 1852 } else {
1852 if (isLeftToRightDirection()) 1853 if (isLeftToRightDirection())
1853 setMarginBottom(margin); 1854 setMarginBottom(margin);
1854 else 1855 else
1855 setMarginTop(margin); 1856 setMarginTop(margin);
1856 } 1857 }
1857 } 1858 }
1858 1859
1859 void ComputedStyle::setMotionPath(PassRefPtr<StylePath> path) 1860 void ComputedStyle::setOffsetPath(PassRefPtr<StylePath> path)
1860 { 1861 {
1861 m_rareNonInheritedData.access()->m_transform.access()->m_motion.m_path = pat h; 1862 m_rareNonInheritedData.access()->m_transform.access()->m_motion.m_path = pat h;
1862 } 1863 }
1863 1864
1864 int ComputedStyle::outlineOutsetExtent() const 1865 int ComputedStyle::outlineOutsetExtent() const
1865 { 1866 {
1866 if (!hasOutline()) 1867 if (!hasOutline())
1867 return 0; 1868 return 0;
1868 if (outlineStyleIsAuto()) 1869 if (outlineStyleIsAuto())
1869 return GraphicsContext::focusRingOutsetExtent(outlineOffset(), outlineWi dth()); 1870 return GraphicsContext::focusRingOutsetExtent(outlineOffset(), outlineWi dth());
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
2042 if (value < 0) 2043 if (value < 0)
2043 fvalue -= 0.5f; 2044 fvalue -= 0.5f;
2044 else 2045 else
2045 fvalue += 0.5f; 2046 fvalue += 0.5f;
2046 } 2047 }
2047 2048
2048 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2049 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2049 } 2050 }
2050 2051
2051 } // namespace blink 2052 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698