Add runtime feature and property names for unprefixed CSS Transforms

Adds a runtime flag (enabled only for testing) and defines property names
for each property defined in CSS Transforms[1]. Future patches will make
these properties functional.

[1] http://www.w3.org/TR/css3-transforms/

NOTRY=true
BUG=154772

Review URL: https://codereview.chromium.org/211033002

git-svn-id: svn://svn.chromium.org/blink/trunk@170005 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 127a969a
...@@ -13,6 +13,7 @@ animationIterationCount ...@@ -13,6 +13,7 @@ animationIterationCount
animationName animationName
animationPlayState animationPlayState
animationTimingFunction animationTimingFunction
backfaceVisibility
background background
backgroundAttachment backgroundAttachment
backgroundBlendMode backgroundBlendMode
...@@ -184,6 +185,8 @@ pageBreakBefore ...@@ -184,6 +185,8 @@ pageBreakBefore
pageBreakInside pageBreakInside
paintOrder paintOrder
parentRule parentRule
perspective
perspectiveOrigin
pointerEvents pointerEvents
position position
quotes quotes
...@@ -240,6 +243,9 @@ textUnderlineWidth ...@@ -240,6 +243,9 @@ textUnderlineWidth
top top
touchAction touchAction
touchActionDelay touchActionDelay
transform
transformOrigin
transformStyle
transition transition
transitionDelay transitionDelay
transitionDuration transitionDuration
......
...@@ -2768,6 +2768,15 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu ...@@ -2768,6 +2768,15 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();
break; break;
// FIXME: crbug.com/154772 Unimplemented css-transforms properties
case CSSPropertyBackfaceVisibility:
case CSSPropertyPerspective:
case CSSPropertyPerspectiveOrigin:
case CSSPropertyTransform:
case CSSPropertyTransformOrigin:
case CSSPropertyTransformStyle:
break;
/* Unimplemented @font-face properties */ /* Unimplemented @font-face properties */
case CSSPropertyFontStretch: case CSSPropertyFontStretch:
case CSSPropertySrc: case CSSPropertySrc:
......
...@@ -522,6 +522,7 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID) ...@@ -522,6 +522,7 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID)
case CSSPropertyWebkitAnimationPlayState: case CSSPropertyWebkitAnimationPlayState:
case CSSPropertyWebkitAnimationTimingFunction: case CSSPropertyWebkitAnimationTimingFunction:
case CSSPropertyWebkitAppearance: case CSSPropertyWebkitAppearance:
case CSSPropertyBackfaceVisibility:
case CSSPropertyWebkitBackfaceVisibility: case CSSPropertyWebkitBackfaceVisibility:
case CSSPropertyWebkitBackgroundClip: case CSSPropertyWebkitBackgroundClip:
case CSSPropertyWebkitBackgroundComposite: case CSSPropertyWebkitBackgroundComposite:
...@@ -640,15 +641,20 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID) ...@@ -640,15 +641,20 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID)
case CSSPropertyWebkitPaddingBefore: case CSSPropertyWebkitPaddingBefore:
case CSSPropertyWebkitPaddingEnd: case CSSPropertyWebkitPaddingEnd:
case CSSPropertyWebkitPaddingStart: case CSSPropertyWebkitPaddingStart:
case CSSPropertyPerspective:
case CSSPropertyWebkitPerspective: case CSSPropertyWebkitPerspective:
case CSSPropertyPerspectiveOrigin:
case CSSPropertyWebkitPerspectiveOrigin: case CSSPropertyWebkitPerspectiveOrigin:
case CSSPropertyWebkitPerspectiveOriginX: case CSSPropertyWebkitPerspectiveOriginX:
case CSSPropertyWebkitPerspectiveOriginY: case CSSPropertyWebkitPerspectiveOriginY:
case CSSPropertyTransform:
case CSSPropertyWebkitTransform: case CSSPropertyWebkitTransform:
case CSSPropertyTransformOrigin:
case CSSPropertyWebkitTransformOrigin: case CSSPropertyWebkitTransformOrigin:
case CSSPropertyWebkitTransformOriginX: case CSSPropertyWebkitTransformOriginX:
case CSSPropertyWebkitTransformOriginY: case CSSPropertyWebkitTransformOriginY:
case CSSPropertyWebkitTransformOriginZ: case CSSPropertyWebkitTransformOriginZ:
case CSSPropertyTransformStyle:
case CSSPropertyWebkitTransformStyle: case CSSPropertyWebkitTransformStyle:
case CSSPropertyWebkitTransition: case CSSPropertyWebkitTransition:
case CSSPropertyWebkitTransitionDelay: case CSSPropertyWebkitTransitionDelay:
......
...@@ -234,6 +234,7 @@ word-wrap ...@@ -234,6 +234,7 @@ word-wrap
z-index z-index
-webkit-appearance -webkit-appearance
-webkit-aspect-ratio -webkit-aspect-ratio
backface-visibility
-webkit-backface-visibility -webkit-backface-visibility
-webkit-background-clip -webkit-background-clip
-webkit-background-composite -webkit-background-composite
...@@ -374,7 +375,9 @@ order ...@@ -374,7 +375,9 @@ order
-webkit-padding-before -webkit-padding-before
-webkit-padding-end -webkit-padding-end
-webkit-padding-start -webkit-padding-start
perspective
-webkit-perspective -webkit-perspective
perspective-origin
-webkit-perspective-origin -webkit-perspective-origin
-webkit-perspective-origin-x -webkit-perspective-origin-x
-webkit-perspective-origin-y -webkit-perspective-origin-y
...@@ -396,11 +399,14 @@ order ...@@ -396,11 +399,14 @@ order
-webkit-text-stroke -webkit-text-stroke
-webkit-text-stroke-color -webkit-text-stroke-color
-webkit-text-stroke-width -webkit-text-stroke-width
transform
-webkit-transform -webkit-transform
transform-origin
-webkit-transform-origin -webkit-transform-origin
-webkit-transform-origin-x -webkit-transform-origin-x
-webkit-transform-origin-y -webkit-transform-origin-y
-webkit-transform-origin-z -webkit-transform-origin-z
transform-style
-webkit-transform-style -webkit-transform-style
-webkit-user-drag -webkit-user-drag
-webkit-user-modify -webkit-user-modify
......
...@@ -106,6 +106,16 @@ static void setPropertySwitchesFromRuntimeFeatures() ...@@ -106,6 +106,16 @@ static void setPropertySwitchesFromRuntimeFeatures()
}; };
setCSSPropertiesEnabled(animationProperties, WTF_ARRAY_LENGTH(animationProperties), RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled()); setCSSPropertiesEnabled(animationProperties, WTF_ARRAY_LENGTH(animationProperties), RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled());
CSSPropertyID transformProperties[] = {
CSSPropertyBackfaceVisibility,
CSSPropertyPerspective,
CSSPropertyPerspectiveOrigin,
CSSPropertyTransform,
CSSPropertyTransformOrigin,
CSSPropertyTransformStyle
};
setCSSPropertiesEnabled(transformProperties, WTF_ARRAY_LENGTH(transformProperties), RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
RuntimeCSSEnabled::setCSSPropertyEnabled(CSSPropertyMixBlendMode, RuntimeEnabledFeatures::cssCompositingEnabled()); RuntimeCSSEnabled::setCSSPropertyEnabled(CSSPropertyMixBlendMode, RuntimeEnabledFeatures::cssCompositingEnabled());
RuntimeCSSEnabled::setCSSPropertyEnabled(CSSPropertyIsolation, RuntimeEnabledFeatures::cssCompositingEnabled()); RuntimeCSSEnabled::setCSSPropertyEnabled(CSSPropertyIsolation, RuntimeEnabledFeatures::cssCompositingEnabled());
RuntimeCSSEnabled::setCSSPropertyEnabled(CSSPropertyTouchAction, RuntimeEnabledFeatures::cssTouchActionEnabled()); RuntimeCSSEnabled::setCSSPropertyEnabled(CSSPropertyTouchAction, RuntimeEnabledFeatures::cssTouchActionEnabled());
......
...@@ -1612,6 +1612,14 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important) ...@@ -1612,6 +1612,14 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important)
case CSSPropertyUserZoom: case CSSPropertyUserZoom:
validPrimitive = false; validPrimitive = false;
break; break;
// FIXME: crbug.com/154772 Unimplemented css-transforms properties
case CSSPropertyBackfaceVisibility:
case CSSPropertyPerspective:
case CSSPropertyPerspectiveOrigin:
case CSSPropertyTransform:
case CSSPropertyTransformOrigin:
case CSSPropertyTransformStyle:
return false;
default: default:
return parseSVGValue(propId, important); return parseSVGValue(propId, important);
} }
......
...@@ -1740,6 +1740,14 @@ void StyleBuilder::oldApplyProperty(CSSPropertyID id, StyleResolverState& state, ...@@ -1740,6 +1740,14 @@ void StyleBuilder::oldApplyProperty(CSSPropertyID id, StyleResolverState& state,
return; return;
} }
// FIXME: crbug.com/154772 Unimplemented css-transforms properties
case CSSPropertyBackfaceVisibility:
case CSSPropertyPerspective:
case CSSPropertyPerspectiveOrigin:
case CSSPropertyTransform:
case CSSPropertyTransformOrigin:
case CSSPropertyTransformStyle:
return;
// These properties are aliased and we already applied the property on the prefixed version. // These properties are aliased and we already applied the property on the prefixed version.
case CSSPropertyAnimationDelay: case CSSPropertyAnimationDelay:
case CSSPropertyAnimationDirection: case CSSPropertyAnimationDirection:
......
...@@ -500,6 +500,12 @@ int UseCounter::mapCSSPropertyIdToCSSSampleIdForHistogram(int id) ...@@ -500,6 +500,12 @@ int UseCounter::mapCSSPropertyIdToCSSSampleIdForHistogram(int id)
case CSSPropertyJustifySelf: return 443; case CSSPropertyJustifySelf: return 443;
case CSSPropertyScrollBehavior: return 444; case CSSPropertyScrollBehavior: return 444;
case CSSPropertyWillChange: return 445; case CSSPropertyWillChange: return 445;
case CSSPropertyTransform: return 446;
case CSSPropertyTransformOrigin: return 447;
case CSSPropertyTransformStyle: return 448;
case CSSPropertyPerspective: return 449;
case CSSPropertyPerspectiveOrigin: return 450;
case CSSPropertyBackfaceVisibility: return 451;
// Add new features above this line (don't change the assigned numbers of the existing // Add new features above this line (don't change the assigned numbers of the existing
// items) and update maximumCSSSampleId() with the new maximum value. // items) and update maximumCSSSampleId() with the new maximum value.
...@@ -519,7 +525,7 @@ int UseCounter::mapCSSPropertyIdToCSSSampleIdForHistogram(int id) ...@@ -519,7 +525,7 @@ int UseCounter::mapCSSPropertyIdToCSSSampleIdForHistogram(int id)
return 0; return 0;
} }
static int maximumCSSSampleId() { return 445; } static int maximumCSSSampleId() { return 451; }
void UseCounter::muteForInspector() void UseCounter::muteForInspector()
{ {
......
...@@ -58,9 +58,14 @@ using namespace SVGNames; ...@@ -58,9 +58,14 @@ using namespace SVGNames;
void mapAttributeToCSSProperty(HashMap<StringImpl*, CSSPropertyID>* propertyNameToIdMap, const QualifiedName& attrName) void mapAttributeToCSSProperty(HashMap<StringImpl*, CSSPropertyID>* propertyNameToIdMap, const QualifiedName& attrName)
{ {
// FIXME: when CSS supports "transform-origin" the special case for transform_originAttr can be removed. // FIXME: when CSS supports "transform-origin" the special case for transform_originAttr can be removed.
// FIXME: It's not clear the above is strictly true, as -webkit-transform-origin has non-standard behavior.
CSSPropertyID propertyId = cssPropertyID(attrName.localName()); CSSPropertyID propertyId = cssPropertyID(attrName.localName());
if (!propertyId && attrName == transform_originAttr) if (!propertyId && attrName == transform_originAttr)
propertyId = CSSPropertyWebkitTransformOrigin; // cssPropertyID("-webkit-transform-origin") propertyId = CSSPropertyWebkitTransformOrigin; // cssPropertyID("-webkit-transform-origin")
if (propertyId == CSSPropertyTransformOrigin) {
ASSERT(RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
propertyId = CSSPropertyWebkitTransformOrigin;
}
ASSERT(propertyId > 0); ASSERT(propertyId > 0);
propertyNameToIdMap->set(attrName.localName().impl(), propertyId); propertyNameToIdMap->set(attrName.localName().impl(), propertyId);
} }
......
...@@ -36,6 +36,7 @@ CSSShapes status=experimental ...@@ -36,6 +36,7 @@ CSSShapes status=experimental
CSSStickyPosition status=experimental CSSStickyPosition status=experimental
CSSTouchAction status=stable CSSTouchAction status=stable
CSSTouchActionDelay status=test CSSTouchActionDelay status=test
CSSTransformsUnprefixed status=test
CSSViewport status=experimental CSSViewport status=experimental
CSSWillChange status=experimental CSSWillChange status=experimental
CSS3Text status=experimental CSS3Text status=experimental
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment