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

Unified Diff: Source/core/css/parser/CSSPropertyParser.cpp

Issue 212673002: CSS Transforms: Implement perspective-origin (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.h ('k') | Source/core/css/resolver/AnimatedStyleBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
index 067160cd49d4d0ef19a237fb652fcb84d5852e17..21652330195808c40a682450b7d8fc5ba871d481 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -1168,13 +1168,23 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important)
return true;
}
break;
+ case CSSPropertyPerspectiveOrigin: {
+ RefPtrWillBeRawPtr<CSSValueList> list = parseTransformOrigin();
+ if (!list || list->length() == 3)
+ return false;
+ // This values are added to match gecko serialization.
+ if (list->length() == 1)
+ list->append(cssValuePool().createValue(50, CSSPrimitiveValue::CSS_PERCENTAGE));
+ addProperty(propId, list.release(), important);
+ return true;
+ }
case CSSPropertyWebkitPerspectiveOrigin:
case CSSPropertyWebkitPerspectiveOriginX:
case CSSPropertyWebkitPerspectiveOriginY: {
RefPtrWillBeRawPtr<CSSValue> val1 = nullptr;
RefPtrWillBeRawPtr<CSSValue> val2 = nullptr;
CSSPropertyID propId1, propId2;
- if (parsePerspectiveOrigin(propId, propId1, propId2, val1, val2)) {
+ if (parseWebkitPerspectiveOrigin(propId, propId1, propId2, val1, val2)) {
addProperty(propId1, val1.release(), important);
if (val2)
addProperty(propId2, val2.release(), important);
@@ -1624,9 +1634,6 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important)
case CSSPropertyUserZoom:
validPrimitive = false;
break;
- // FIXME: crbug.com/154772 Unimplemented css-transforms properties
- case CSSPropertyPerspectiveOrigin:
- return false;
default:
return parseSVGValue(propId, important);
}
@@ -7352,7 +7359,7 @@ bool CSSPropertyParser::parseWebkitTransformOrigin(CSSPropertyID propId, CSSProp
return value;
}
-bool CSSPropertyParser::parsePerspectiveOrigin(CSSPropertyID propId, CSSPropertyID& propId1, CSSPropertyID& propId2, RefPtrWillBeRawPtr<CSSValue>& value, RefPtrWillBeRawPtr<CSSValue>& value2)
+bool CSSPropertyParser::parseWebkitPerspectiveOrigin(CSSPropertyID propId, CSSPropertyID& propId1, CSSPropertyID& propId2, RefPtrWillBeRawPtr<CSSValue>& value, RefPtrWillBeRawPtr<CSSValue>& value2)
{
propId1 = propId;
propId2 = propId;
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.h ('k') | Source/core/css/resolver/AnimatedStyleBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698