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

Side by Side Diff: Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 211233003: CSS Transforms: Implement perspective (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase and update interpolation tests. Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after
1422 state.style()->setTextStrokeWidth(width); 1422 state.style()->setTextStrokeWidth(width);
1423 return; 1423 return;
1424 } 1424 }
1425 case CSSPropertyWebkitTransform: { 1425 case CSSPropertyWebkitTransform: {
1426 HANDLE_INHERIT_AND_INITIAL(transform, Transform); 1426 HANDLE_INHERIT_AND_INITIAL(transform, Transform);
1427 TransformOperations operations; 1427 TransformOperations operations;
1428 TransformBuilder::createTransformOperations(value, state.cssToLengthConv ersionData(), operations); 1428 TransformBuilder::createTransformOperations(value, state.cssToLengthConv ersionData(), operations);
1429 state.style()->setTransform(operations); 1429 state.style()->setTransform(operations);
1430 return; 1430 return;
1431 } 1431 }
1432 case CSSPropertyPerspective:
1432 case CSSPropertyWebkitPerspective: { 1433 case CSSPropertyWebkitPerspective: {
1433 HANDLE_INHERIT_AND_INITIAL(perspective, Perspective) 1434 HANDLE_INHERIT_AND_INITIAL(perspective, Perspective)
1434 1435
1435 if (!primitiveValue) 1436 if (!primitiveValue)
1436 return; 1437 return;
1437 1438
1438 if (primitiveValue->getValueID() == CSSValueNone) { 1439 if (primitiveValue->getValueID() == CSSValueNone) {
1439 state.style()->setPerspective(0); 1440 state.style()->setPerspective(0);
1440 return; 1441 return;
1441 } 1442 }
1442 1443
1443 float perspectiveValue; 1444 float perspectiveValue;
1444 if (primitiveValue->isLength()) { 1445 if (primitiveValue->isLength()) {
1445 perspectiveValue = primitiveValue->computeLength<float>(state.cssToL engthConversionData()); 1446 perspectiveValue = primitiveValue->computeLength<float>(state.cssToL engthConversionData());
1446 } else if (primitiveValue->isNumber()) { 1447 } else if (id == CSSPropertyWebkitPerspective && primitiveValue->isNumbe r()) {
1447 // For backward compatibility, treat valueless numbers as px. 1448 // Prefixed version treats unitless numbers as px.
1448 perspectiveValue = CSSPrimitiveValue::create(primitiveValue->getDoub leValue(), CSSPrimitiveValue::CSS_PX)->computeLength<float>(state.cssToLengthCon versionData()); 1449 perspectiveValue = CSSPrimitiveValue::create(primitiveValue->getDoub leValue(), CSSPrimitiveValue::CSS_PX)->computeLength<float>(state.cssToLengthCon versionData());
1449 } else { 1450 } else {
1450 return; 1451 return;
1451 } 1452 }
1452 1453
1453 if (perspectiveValue >= 0.0f) 1454 if (perspectiveValue >= 0.0f)
1454 state.style()->setPerspective(perspectiveValue); 1455 state.style()->setPerspective(perspectiveValue);
1455 return; 1456 return;
1456 } 1457 }
1457 case CSSPropertyWebkitTapHighlightColor: { 1458 case CSSPropertyWebkitTapHighlightColor: {
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
1734 if (Pair* pairValue = primitiveValue->getPairValue()) { 1735 if (Pair* pairValue = primitiveValue->getPairValue()) {
1735 state.style()->setAlignItems(*pairValue->first()); 1736 state.style()->setAlignItems(*pairValue->first());
1736 state.style()->setAlignItemsOverflowAlignment(*pairValue->second()); 1737 state.style()->setAlignItemsOverflowAlignment(*pairValue->second());
1737 } else { 1738 } else {
1738 state.style()->setAlignItems(*primitiveValue); 1739 state.style()->setAlignItems(*primitiveValue);
1739 } 1740 }
1740 return; 1741 return;
1741 } 1742 }
1742 1743
1743 // FIXME: crbug.com/154772 Unimplemented css-transforms properties 1744 // FIXME: crbug.com/154772 Unimplemented css-transforms properties
1744 case CSSPropertyPerspective:
1745 case CSSPropertyPerspectiveOrigin: 1745 case CSSPropertyPerspectiveOrigin:
1746 case CSSPropertyTransform: 1746 case CSSPropertyTransform:
1747 case CSSPropertyTransformOrigin: 1747 case CSSPropertyTransformOrigin:
1748 return; 1748 return;
1749 // These properties are aliased and we already applied the property on the p refixed version. 1749 // These properties are aliased and we already applied the property on the p refixed version.
1750 case CSSPropertyAnimationDelay: 1750 case CSSPropertyAnimationDelay:
1751 case CSSPropertyAnimationDirection: 1751 case CSSPropertyAnimationDirection:
1752 case CSSPropertyAnimationDuration: 1752 case CSSPropertyAnimationDuration:
1753 case CSSPropertyAnimationFillMode: 1753 case CSSPropertyAnimationFillMode:
1754 case CSSPropertyAnimationIterationCount: 1754 case CSSPropertyAnimationIterationCount:
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
2185 break; 2185 break;
2186 } 2186 }
2187 case CSSPropertyEnableBackground: 2187 case CSSPropertyEnableBackground:
2188 // Silently ignoring this property for now 2188 // Silently ignoring this property for now
2189 // http://bugs.webkit.org/show_bug.cgi?id=6022 2189 // http://bugs.webkit.org/show_bug.cgi?id=6022
2190 break; 2190 break;
2191 } 2191 }
2192 } 2192 }
2193 2193
2194 } // namespace WebCore 2194 } // namespace WebCore
OLDNEW
« Source/core/animation/css/CSSAnimations.cpp ('K') | « Source/core/css/resolver/StyleAdjuster.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698