| 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, 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 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 { | 981 { |
| 982 for (CSSPropertyID property : properties) { | 982 for (CSSPropertyID property : properties) { |
| 983 switch (property) { | 983 switch (property) { |
| 984 case CSSPropertyOpacity: | 984 case CSSPropertyOpacity: |
| 985 case CSSPropertyTransform: | 985 case CSSPropertyTransform: |
| 986 case CSSPropertyAliasWebkitTransform: | 986 case CSSPropertyAliasWebkitTransform: |
| 987 case CSSPropertyTransformStyle: | 987 case CSSPropertyTransformStyle: |
| 988 case CSSPropertyAliasWebkitTransformStyle: | 988 case CSSPropertyAliasWebkitTransformStyle: |
| 989 case CSSPropertyPerspective: | 989 case CSSPropertyPerspective: |
| 990 case CSSPropertyAliasWebkitPerspective: | 990 case CSSPropertyAliasWebkitPerspective: |
| 991 case CSSPropertyOffsetPath: |
| 992 case CSSPropertyOffsetPosition: |
| 991 case CSSPropertyWebkitMask: | 993 case CSSPropertyWebkitMask: |
| 992 case CSSPropertyWebkitMaskBoxImage: | 994 case CSSPropertyWebkitMaskBoxImage: |
| 993 case CSSPropertyClipPath: | 995 case CSSPropertyClipPath: |
| 994 case CSSPropertyAliasWebkitClipPath: | 996 case CSSPropertyAliasWebkitClipPath: |
| 995 case CSSPropertyWebkitBoxReflect: | 997 case CSSPropertyWebkitBoxReflect: |
| 996 case CSSPropertyFilter: | 998 case CSSPropertyFilter: |
| 997 case CSSPropertyAliasWebkitFilter: | 999 case CSSPropertyAliasWebkitFilter: |
| 998 case CSSPropertyBackdropFilter: | 1000 case CSSPropertyBackdropFilter: |
| 999 case CSSPropertyZIndex: | 1001 case CSSPropertyZIndex: |
| 1000 case CSSPropertyPosition: | 1002 case CSSPropertyPosition: |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 return scale() || rotate(); | 1104 return scale() || rotate(); |
| 1103 } | 1105 } |
| 1104 | 1106 |
| 1105 void ComputedStyle::applyTransform(TransformationMatrix& result, const LayoutSiz
e& borderBoxSize, ApplyTransformOrigin applyOrigin, ApplyMotionPath applyMotionP
ath, ApplyIndependentTransformProperties applyIndependentTransformProperties) co
nst | 1107 void ComputedStyle::applyTransform(TransformationMatrix& result, const LayoutSiz
e& borderBoxSize, ApplyTransformOrigin applyOrigin, ApplyMotionPath applyMotionP
ath, ApplyIndependentTransformProperties applyIndependentTransformProperties) co
nst |
| 1106 { | 1108 { |
| 1107 applyTransform(result, FloatRect(FloatPoint(), FloatSize(borderBoxSize)), ap
plyOrigin, applyMotionPath, applyIndependentTransformProperties); | 1109 applyTransform(result, FloatRect(FloatPoint(), FloatSize(borderBoxSize)), ap
plyOrigin, applyMotionPath, applyIndependentTransformProperties); |
| 1108 } | 1110 } |
| 1109 | 1111 |
| 1110 void ComputedStyle::applyTransform(TransformationMatrix& result, const FloatRect
& boundingBox, ApplyTransformOrigin applyOrigin, ApplyMotionPath applyMotionPath
, ApplyIndependentTransformProperties applyIndependentTransformProperties) const | 1112 void ComputedStyle::applyTransform(TransformationMatrix& result, const FloatRect
& boundingBox, ApplyTransformOrigin applyOrigin, ApplyMotionPath applyMotionPath
, ApplyIndependentTransformProperties applyIndependentTransformProperties) const |
| 1111 { | 1113 { |
| 1112 if (!hasOffsetPath()) | 1114 if (!hasOffset()) |
| 1113 applyMotionPath = ExcludeMotionPath; | 1115 applyMotionPath = ExcludeMotionPath; |
| 1114 bool applyTransformOrigin = requireTransformOrigin(applyOrigin, applyMotionP
ath); | 1116 bool applyTransformOrigin = requireTransformOrigin(applyOrigin, applyMotionP
ath); |
| 1115 | 1117 |
| 1116 float offsetX = transformOriginX().type() == Percent ? boundingBox.x() : 0; | 1118 float offsetX = transformOriginX().type() == Percent ? boundingBox.x() : 0; |
| 1117 float offsetY = transformOriginY().type() == Percent ? boundingBox.y() : 0; | 1119 float offsetY = transformOriginY().type() == Percent ? boundingBox.y() : 0; |
| 1118 | 1120 |
| 1119 float originX = 0; | 1121 float originX = 0; |
| 1120 float originY = 0; | 1122 float originY = 0; |
| 1121 float originZ = 0; | 1123 float originZ = 0; |
| 1122 | 1124 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1147 transformOperations[i]->apply(result, boundingBox.size()); | 1149 transformOperations[i]->apply(result, boundingBox.size()); |
| 1148 | 1150 |
| 1149 if (applyTransformOrigin) { | 1151 if (applyTransformOrigin) { |
| 1150 result.translate3d(-originX, -originY, -originZ); | 1152 result.translate3d(-originX, -originY, -originZ); |
| 1151 } | 1153 } |
| 1152 } | 1154 } |
| 1153 | 1155 |
| 1154 void ComputedStyle::applyMotionPathTransform(float originX, float originY, Trans
formationMatrix& transform) const | 1156 void ComputedStyle::applyMotionPathTransform(float originX, float originY, Trans
formationMatrix& transform) const |
| 1155 { | 1157 { |
| 1156 const StyleMotionData& motionData = m_rareNonInheritedData->m_transform->m_m
otion; | 1158 const StyleMotionData& motionData = m_rareNonInheritedData->m_transform->m_m
otion; |
| 1157 ASSERT(motionData.m_path); | 1159 // TODO(ericwilligers): crbug.com/638055 Apply offset-position and offset-an
chor. |
| 1160 if (!motionData.m_path) { |
| 1161 return; |
| 1162 } |
| 1158 const StylePath& motionPath = *motionData.m_path; | 1163 const StylePath& motionPath = *motionData.m_path; |
| 1159 float pathLength = motionPath.length(); | 1164 float pathLength = motionPath.length(); |
| 1160 float distance = floatValueForLength(motionData.m_distance, pathLength); | 1165 float distance = floatValueForLength(motionData.m_distance, pathLength); |
| 1161 float computedDistance; | 1166 float computedDistance; |
| 1162 if (motionPath.isClosed() && pathLength > 0) { | 1167 if (motionPath.isClosed() && pathLength > 0) { |
| 1163 computedDistance = fmod(distance, pathLength); | 1168 computedDistance = fmod(distance, pathLength); |
| 1164 if (computedDistance < 0) | 1169 if (computedDistance < 0) |
| 1165 computedDistance += pathLength; | 1170 computedDistance += pathLength; |
| 1166 } else { | 1171 } else { |
| 1167 computedDistance = clampTo<float>(distance, 0, pathLength); | 1172 computedDistance = clampTo<float>(distance, 0, pathLength); |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2053 if (value < 0) | 2058 if (value < 0) |
| 2054 fvalue -= 0.5f; | 2059 fvalue -= 0.5f; |
| 2055 else | 2060 else |
| 2056 fvalue += 0.5f; | 2061 fvalue += 0.5f; |
| 2057 } | 2062 } |
| 2058 | 2063 |
| 2059 return roundForImpreciseConversion<int>(fvalue / zoomFactor); | 2064 return roundForImpreciseConversion<int>(fvalue / zoomFactor); |
| 2060 } | 2065 } |
| 2061 | 2066 |
| 2062 } // namespace blink | 2067 } // namespace blink |
| OLD | NEW |