Chromium Code Reviews| Index: Source/core/css/ComputedStyleCSSValueMapping.cpp |
| diff --git a/Source/core/css/ComputedStyleCSSValueMapping.cpp b/Source/core/css/ComputedStyleCSSValueMapping.cpp |
| index ea627de1c5b19239dab13553fd77bc6c2934bf06..37299cfb6c0849f2706580ca92efea730b9a3821 100644 |
| --- a/Source/core/css/ComputedStyleCSSValueMapping.cpp |
| +++ b/Source/core/css/ComputedStyleCSSValueMapping.cpp |
| @@ -955,7 +955,7 @@ static PassRefPtrWillBeRawPtr<CSSValue> computedTransform(const LayoutObject* la |
| box = pixelSnappedIntRect(toLayoutBox(layoutObject)->borderBoxRect()); |
| TransformationMatrix transform; |
| - style.applyTransform(transform, LayoutSize(box.size()), ComputedStyle::ExcludeTransformOrigin, ComputedStyle::ExcludeMotionPath); |
| + style.applyTransform(transform, LayoutSize(box.size()), ComputedStyle::ExcludeTransformOrigin, ComputedStyle::ExcludeMotionPath, ComputedStyle::ExcludeTransformProperty); |
| // FIXME: Need to print out individual functions (https://bugs.webkit.org/show_bug.cgi?id=23924) |
| RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| @@ -2592,7 +2592,58 @@ PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID |
| return zoomAdjustedPixelValueForLength(svgStyle.rx(), style); |
| case CSSPropertyRy: |
| return zoomAdjustedPixelValueForLength(svgStyle.ry(), style); |
| + case CSSPropertyTranslate: { |
| + if (!style.hasTranslateProperty()) { |
| + return cssValuePool().createIdentifierValue(CSSValueNone); |
|
Eric Willigers
2015/06/05 01:58:22
0px
|
| + } |
| + RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| + if (layoutObject && layoutObject->isBox()) { |
| + LayoutRect box = toLayoutBox(layoutObject)->borderBoxRect(); |
| + list->append(zoomAdjustedPixelValue(floatValueForLength(style.translate()->x(), box.width().toFloat()), style)); |
| + |
| + if (style.translate()->type() != TransformOperation::TranslateX) { |
| + list->append(zoomAdjustedPixelValue(floatValueForLength(style.translate()->y(), box.height().toFloat()), style)); |
| + } |
| + |
| + } else { |
| + // No box to resolve the percentage values |
| + list->append(zoomAdjustedPixelValueForLength(style.translate()->x(), style)); |
| + |
| + if (style.translate()->type() != TransformOperation::TranslateX) { |
| + list->append(zoomAdjustedPixelValueForLength(style.translate()->y(), style)); |
| + } |
| + } |
| + |
| + if (style.translate()->type() == TransformOperation::Translate3D) { |
| + list->append(zoomAdjustedPixelValue(style.translate()->z(), style)); |
| + } |
| + return list.release(); |
| + } |
| + case CSSPropertyRotate: { |
| + if (!style.hasRotateProperty()) |
| + return cssValuePool().createIdentifierValue(CSSValueNone); |
|
Eric Willigers
2015/06/05 01:58:22
0deg
|
| + RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| + list->append(cssValuePool().createValue(style.rotate()->angle(), CSSPrimitiveValue::CSS_DEG)); |
| + if (style.rotate()->is3DOperation()) { |
| + list->append(cssValuePool().createValue(style.rotate()->x(), CSSPrimitiveValue::CSS_NUMBER)); |
| + list->append(cssValuePool().createValue(style.rotate()->y(), CSSPrimitiveValue::CSS_NUMBER)); |
| + list->append(cssValuePool().createValue(style.rotate()->z(), CSSPrimitiveValue::CSS_NUMBER)); |
| + } |
| + return list.release(); |
| + } |
| + case CSSPropertyScale: { |
| + if (!style.hasScaleProperty()) |
| + return cssValuePool().createIdentifierValue(CSSValueNone); |
|
Eric Willigers
2015/06/05 01:58:22
1
|
| + RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| + list->append(cssValuePool().createValue(style.scale()->x(), CSSPrimitiveValue::CSS_NUMBER)); |
| + if (style.scale()->type() == TransformOperation::ScaleX) |
| + return list.release(); |
| + list->append(cssValuePool().createValue(style.scale()->y(), CSSPrimitiveValue::CSS_NUMBER)); |
| + if (style.scale()->type() == TransformOperation::Scale3D) |
| + list->append(cssValuePool().createValue(style.scale()->z(), CSSPrimitiveValue::CSS_NUMBER)); |
| + return list.release(); |
| + } |
| case CSSPropertyAll: |
| return nullptr; |
| default: |