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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp

Issue 2662203002: CSS: Rotate support for none and fixed responsive-test.js (Closed)
Patch Set: avoid expectation failure on Mac Created 3 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * * Redistributions of source code must retain the above copyright 4 * * Redistributions of source code must retain the above copyright
5 * notice, this list of conditions and the following disclaimer. 5 * notice, this list of conditions and the following disclaimer.
6 * * Redistributions in binary form must reproduce the above 6 * * Redistributions in binary form must reproduce the above
7 * copyright notice, this list of conditions and the following disclaimer 7 * copyright notice, this list of conditions and the following disclaimer
8 * in the documentation and/or other materials provided with the 8 * in the documentation and/or other materials provided with the
9 * distribution. 9 * distribution.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1280 ty = convertLength(state, list.item(1)); 1280 ty = convertLength(state, list.item(1));
1281 if (list.length() == 3) 1281 if (list.length() == 3)
1282 tz = toCSSPrimitiveValue(list.item(2)) 1282 tz = toCSSPrimitiveValue(list.item(2))
1283 .computeLength<double>(state.cssToLengthConversionData()); 1283 .computeLength<double>(state.cssToLengthConversionData());
1284 1284
1285 return TranslateTransformOperation::create(tx, ty, tz, 1285 return TranslateTransformOperation::create(tx, ty, tz,
1286 TransformOperation::Translate3D); 1286 TransformOperation::Translate3D);
1287 } 1287 }
1288 1288
1289 Rotation StyleBuilderConverter::convertRotation(const CSSValue& value) { 1289 Rotation StyleBuilderConverter::convertRotation(const CSSValue& value) {
1290 if (value.isIdentifierValue()) {
1291 DCHECK_EQ(toCSSIdentifierValue(value).getValueID(), CSSValueNone);
1292 return Rotation(FloatPoint3D(0, 0, 1), 0);
1293 }
1294
1290 const CSSValueList& list = toCSSValueList(value); 1295 const CSSValueList& list = toCSSValueList(value);
1291 ASSERT(list.length() == 1 || list.length() == 4); 1296 ASSERT(list.length() == 1 || list.length() == 4);
1292 double x = 0; 1297 double x = 0;
1293 double y = 0; 1298 double y = 0;
1294 double z = 1; 1299 double z = 1;
1295 if (list.length() == 4) { 1300 if (list.length() == 4) {
1296 x = toCSSPrimitiveValue(list.item(0)).getDoubleValue(); 1301 x = toCSSPrimitiveValue(list.item(0)).getDoubleValue();
1297 y = toCSSPrimitiveValue(list.item(1)).getDoubleValue(); 1302 y = toCSSPrimitiveValue(list.item(1)).getDoubleValue();
1298 z = toCSSPrimitiveValue(list.item(2)).getDoubleValue(); 1303 z = toCSSPrimitiveValue(list.item(2)).getDoubleValue();
1299 } 1304 }
1300 double angle = 1305 double angle =
1301 toCSSPrimitiveValue(list.item(list.length() - 1)).computeDegrees(); 1306 toCSSPrimitiveValue(list.item(list.length() - 1)).computeDegrees();
1302 return Rotation(FloatPoint3D(x, y, z), angle); 1307 return Rotation(FloatPoint3D(x, y, z), angle);
1303 } 1308 }
1304 1309
1305 PassRefPtr<RotateTransformOperation> StyleBuilderConverter::convertRotate( 1310 PassRefPtr<RotateTransformOperation> StyleBuilderConverter::convertRotate(
1306 StyleResolverState& state, 1311 StyleResolverState& state,
1307 const CSSValue& value) { 1312 const CSSValue& value) {
1313 if (value.isIdentifierValue()) {
1314 DCHECK_EQ(toCSSIdentifierValue(value).getValueID(), CSSValueNone);
1315 return nullptr;
1316 }
1317
1308 return RotateTransformOperation::create(convertRotation(value), 1318 return RotateTransformOperation::create(convertRotation(value),
1309 TransformOperation::Rotate3D); 1319 TransformOperation::Rotate3D);
1310 } 1320 }
1311 1321
1312 PassRefPtr<ScaleTransformOperation> StyleBuilderConverter::convertScale( 1322 PassRefPtr<ScaleTransformOperation> StyleBuilderConverter::convertScale(
1313 StyleResolverState& state, 1323 StyleResolverState& state,
1314 const CSSValue& value) { 1324 const CSSValue& value) {
1315 if (value.isIdentifierValue()) { 1325 if (value.isIdentifierValue()) {
1316 DCHECK_EQ(toCSSIdentifierValue(value).getValueID(), CSSValueNone); 1326 DCHECK_EQ(toCSSIdentifierValue(value).getValueID(), CSSValueNone);
1317 return nullptr; 1327 return nullptr;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1385 } 1395 }
1386 1396
1387 const CSSValue& StyleBuilderConverter::convertRegisteredPropertyValue( 1397 const CSSValue& StyleBuilderConverter::convertRegisteredPropertyValue(
1388 const StyleResolverState& state, 1398 const StyleResolverState& state,
1389 const CSSValue& value) { 1399 const CSSValue& value) {
1390 return computeRegisteredPropertyValue(state.cssToLengthConversionData(), 1400 return computeRegisteredPropertyValue(state.cssToLengthConversionData(),
1391 value); 1401 value);
1392 } 1402 }
1393 1403
1394 } // namespace blink 1404 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698