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

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

Issue 1649003002: Use StylePath instead of (Path)StyleMotionPath (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 10 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 12 matching lines...) Expand all
23 #include "core/style/ComputedStyle.h" 23 #include "core/style/ComputedStyle.h"
24 24
25 #include "core/css/resolver/StyleResolver.h" 25 #include "core/css/resolver/StyleResolver.h"
26 #include "core/layout/LayoutTheme.h" 26 #include "core/layout/LayoutTheme.h"
27 #include "core/layout/TextAutosizer.h" 27 #include "core/layout/TextAutosizer.h"
28 #include "core/style/AppliedTextDecoration.h" 28 #include "core/style/AppliedTextDecoration.h"
29 #include "core/style/BorderEdge.h" 29 #include "core/style/BorderEdge.h"
30 #include "core/style/ContentData.h" 30 #include "core/style/ContentData.h"
31 #include "core/style/DataEquivalency.h" 31 #include "core/style/DataEquivalency.h"
32 #include "core/style/ComputedStyleConstants.h" 32 #include "core/style/ComputedStyleConstants.h"
33 #include "core/style/PathStyleMotionPath.h"
34 #include "core/style/QuotesData.h" 33 #include "core/style/QuotesData.h"
35 #include "core/style/ShadowList.h" 34 #include "core/style/ShadowList.h"
36 #include "core/style/StyleImage.h" 35 #include "core/style/StyleImage.h"
37 #include "core/style/StyleInheritedData.h" 36 #include "core/style/StyleInheritedData.h"
38 #include "core/style/StyleVariableData.h" 37 #include "core/style/StyleVariableData.h"
39 #include "platform/LengthFunctions.h" 38 #include "platform/LengthFunctions.h"
40 #include "platform/RuntimeEnabledFeatures.h" 39 #include "platform/RuntimeEnabledFeatures.h"
41 #include "platform/fonts/Font.h" 40 #include "platform/fonts/Font.h"
42 #include "platform/fonts/FontSelector.h" 41 #include "platform/fonts/FontSelector.h"
43 #include "platform/geometry/FloatRoundedRect.h" 42 #include "platform/geometry/FloatRoundedRect.h"
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 transformOperations[i]->apply(result, boundingBox.size()); 984 transformOperations[i]->apply(result, boundingBox.size());
986 985
987 if (applyTransformOrigin) { 986 if (applyTransformOrigin) {
988 result.translate3d(-originX, -originY, -originZ); 987 result.translate3d(-originX, -originY, -originZ);
989 } 988 }
990 } 989 }
991 990
992 void ComputedStyle::applyMotionPathTransform(float originX, float originY, Trans formationMatrix& transform) const 991 void ComputedStyle::applyMotionPathTransform(float originX, float originY, Trans formationMatrix& transform) const
993 { 992 {
994 const StyleMotionData& motionData = rareNonInheritedData->m_transform->m_mot ion; 993 const StyleMotionData& motionData = rareNonInheritedData->m_transform->m_mot ion;
995 ASSERT(motionData.m_path && motionData.m_path->isPathStyleMotionPath()); 994 ASSERT(motionData.m_path);
996 const PathStyleMotionPath& motionPath = toPathStyleMotionPath(*motionData.m_ path); 995 const StylePath& motionPath = *motionData.m_path;
997 float pathLength = motionPath.length(); 996 float pathLength = motionPath.length();
998 float distance = floatValueForLength(motionData.m_offset, pathLength); 997 float distance = floatValueForLength(motionData.m_offset, pathLength);
999 float computedDistance; 998 float computedDistance;
1000 if (motionPath.isClosed() && pathLength > 0) { 999 if (motionPath.isClosed() && pathLength > 0) {
1001 computedDistance = fmod(distance, pathLength); 1000 computedDistance = fmod(distance, pathLength);
1002 if (computedDistance < 0) 1001 if (computedDistance < 0)
1003 computedDistance += pathLength; 1002 computedDistance += pathLength;
1004 } else { 1003 } else {
1005 computedDistance = clampTo<float>(distance, 0, pathLength); 1004 computedDistance = clampTo<float>(distance, 0, pathLength);
1006 } 1005 }
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
1674 else 1673 else
1675 setMarginLeft(margin); 1674 setMarginLeft(margin);
1676 } else { 1675 } else {
1677 if (isLeftToRightDirection()) 1676 if (isLeftToRightDirection())
1678 setMarginBottom(margin); 1677 setMarginBottom(margin);
1679 else 1678 else
1680 setMarginTop(margin); 1679 setMarginTop(margin);
1681 } 1680 }
1682 } 1681 }
1683 1682
1684 void ComputedStyle::setMotionPath(PassRefPtr<StyleMotionPath> path) 1683 void ComputedStyle::setMotionPath(PassRefPtr<StylePath> path)
1685 { 1684 {
1686 ASSERT(path);
1687 rareNonInheritedData.access()->m_transform.access()->m_motion.m_path = path; 1685 rareNonInheritedData.access()->m_transform.access()->m_motion.m_path = path;
1688 } 1686 }
1689 1687
1690 void ComputedStyle::resetMotionPath()
1691 {
1692 rareNonInheritedData.access()->m_transform.access()->m_motion.m_path = nullp tr;
1693 }
1694
1695 int ComputedStyle::outlineOutsetExtent() const 1688 int ComputedStyle::outlineOutsetExtent() const
1696 { 1689 {
1697 if (!hasOutline()) 1690 if (!hasOutline())
1698 return 0; 1691 return 0;
1699 if (outlineStyleIsAuto()) 1692 if (outlineStyleIsAuto())
1700 return GraphicsContext::focusRingOutsetExtent(outlineOffset(), outlineWi dth()); 1693 return GraphicsContext::focusRingOutsetExtent(outlineOffset(), outlineWi dth());
1701 return std::max(0, outlineWidth() + outlineOffset()); 1694 return std::max(0, outlineWidth() + outlineOffset());
1702 } 1695 }
1703 1696
1704 bool ComputedStyle::columnRuleEquivalent(const ComputedStyle* otherStyle) const 1697 bool ComputedStyle::columnRuleEquivalent(const ComputedStyle* otherStyle) const
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1841 if (!shadowList) 1834 if (!shadowList)
1842 return false; 1835 return false;
1843 for (size_t i = shadowList->shadows().size(); i--; ) { 1836 for (size_t i = shadowList->shadows().size(); i--; ) {
1844 if (shadowList->shadows()[i].color().isCurrentColor()) 1837 if (shadowList->shadows()[i].color().isCurrentColor())
1845 return true; 1838 return true;
1846 } 1839 }
1847 return false; 1840 return false;
1848 } 1841 }
1849 1842
1850 } // namespace blink 1843 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | third_party/WebKit/Source/core/style/PathStyleMotionPath.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698