Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp |
| diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp |
| index af0f0c3cf40f1fca8abf92558a84da81dabc8e3c..be0cbbd9c681dc19ab1c2e9b7eafe6a02f8569e3 100644 |
| --- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp |
| +++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp |
| @@ -90,13 +90,6 @@ inline static CSSValue* zoomAdjustedPixelValueOrAuto( |
| return zoomAdjustedPixelValue(length.value(), style); |
| } |
| -inline static CSSPrimitiveValue* zoomAdjustedNumberValue( |
| - double value, |
| - const ComputedStyle& style) { |
| - return CSSPrimitiveValue::create(value / style.effectiveZoom(), |
| - CSSPrimitiveValue::UnitType::Number); |
| -} |
| - |
| static CSSValue* zoomAdjustedPixelValueForLength(const Length& length, |
| const ComputedStyle& style) { |
| if (length.isFixed()) |
| @@ -1356,6 +1349,7 @@ static CSSFunctionValue* valueForMatrixTransform( |
| const TransformationMatrix& transform, |
| const ComputedStyle& style) { |
| CSSFunctionValue* transformValue = nullptr; |
| + double zoomFactor = style.effectiveZoom(); |
|
pdr.
2016/11/08 07:04:08
I wonder if we could simplify this by moving it up
Franklin Ta
2016/11/08 07:52:18
There are a lot of other functions in this file in
Franklin Ta
2016/11/08 16:47:02
Terminology note: I just noticed you guys define T
|
| if (transform.isAffine()) { |
| transformValue = CSSFunctionValue::create(CSSValueMatrix); |
| @@ -1367,8 +1361,10 @@ static CSSFunctionValue* valueForMatrixTransform( |
| transform.c(), CSSPrimitiveValue::UnitType::Number)); |
| transformValue->append(*CSSPrimitiveValue::create( |
| transform.d(), CSSPrimitiveValue::UnitType::Number)); |
| - transformValue->append(*zoomAdjustedNumberValue(transform.e(), style)); |
| - transformValue->append(*zoomAdjustedNumberValue(transform.f(), style)); |
| + transformValue->append(*CSSPrimitiveValue::create( |
| + transform.e() / zoomFactor, CSSPrimitiveValue::UnitType::Number)); |
| + transformValue->append(*CSSPrimitiveValue::create( |
| + transform.f() / zoomFactor, CSSPrimitiveValue::UnitType::Number)); |
| } else { |
| transformValue = CSSFunctionValue::create(CSSValueMatrix3d); |
| @@ -1379,7 +1375,7 @@ static CSSFunctionValue* valueForMatrixTransform( |
| transformValue->append(*CSSPrimitiveValue::create( |
| transform.m13(), CSSPrimitiveValue::UnitType::Number)); |
| transformValue->append(*CSSPrimitiveValue::create( |
| - transform.m14(), CSSPrimitiveValue::UnitType::Number)); |
| + transform.m14() * zoomFactor, CSSPrimitiveValue::UnitType::Number)); |
| transformValue->append(*CSSPrimitiveValue::create( |
| transform.m21(), CSSPrimitiveValue::UnitType::Number)); |
| @@ -1388,7 +1384,7 @@ static CSSFunctionValue* valueForMatrixTransform( |
| transformValue->append(*CSSPrimitiveValue::create( |
| transform.m23(), CSSPrimitiveValue::UnitType::Number)); |
| transformValue->append(*CSSPrimitiveValue::create( |
| - transform.m24(), CSSPrimitiveValue::UnitType::Number)); |
| + transform.m24() * zoomFactor, CSSPrimitiveValue::UnitType::Number)); |
| transformValue->append(*CSSPrimitiveValue::create( |
| transform.m31(), CSSPrimitiveValue::UnitType::Number)); |
| @@ -1397,11 +1393,14 @@ static CSSFunctionValue* valueForMatrixTransform( |
| transformValue->append(*CSSPrimitiveValue::create( |
| transform.m33(), CSSPrimitiveValue::UnitType::Number)); |
| transformValue->append(*CSSPrimitiveValue::create( |
| - transform.m34(), CSSPrimitiveValue::UnitType::Number)); |
| + transform.m34() * zoomFactor, CSSPrimitiveValue::UnitType::Number)); |
| - transformValue->append(*zoomAdjustedNumberValue(transform.m41(), style)); |
| - transformValue->append(*zoomAdjustedNumberValue(transform.m42(), style)); |
| - transformValue->append(*zoomAdjustedNumberValue(transform.m43(), style)); |
| + transformValue->append(*CSSPrimitiveValue::create( |
| + transform.m41() / zoomFactor, CSSPrimitiveValue::UnitType::Number)); |
| + transformValue->append(*CSSPrimitiveValue::create( |
| + transform.m42() / zoomFactor, CSSPrimitiveValue::UnitType::Number)); |
| + transformValue->append(*CSSPrimitiveValue::create( |
| + transform.m43() / zoomFactor, CSSPrimitiveValue::UnitType::Number)); |
|
alancutter (OOO until 2018)
2016/11/09 02:35:59
I'd push the Matrix3DTransformOperation::zoom() lo
Franklin Ta
2016/11/09 07:12:06
This is a great idea and tidies up everything! Don
|
| transformValue->append(*CSSPrimitiveValue::create( |
| transform.m44(), CSSPrimitiveValue::UnitType::Number)); |
| } |