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

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

Issue 947983002: Move zoom handling for x and y properties to svg (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: move function Created 5 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 } 498 }
499 499
500 Length StyleBuilderConverter::convertLengthOrAuto(const StyleResolverState& stat e, CSSValue* value) 500 Length StyleBuilderConverter::convertLengthOrAuto(const StyleResolverState& stat e, CSSValue* value)
501 { 501 {
502 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 502 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
503 if (primitiveValue->getValueID() == CSSValueAuto) 503 if (primitiveValue->getValueID() == CSSValueAuto)
504 return Length(Auto); 504 return Length(Auto);
505 return primitiveValue->convertToLength(state.cssToLengthConversionData()); 505 return primitiveValue->convertToLength(state.cssToLengthConversionData());
506 } 506 }
507 507
508 Length StyleBuilderConverter::convertLengthUnzoomed(const StyleResolverState& st ate, CSSValue* value)
509 {
510 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
511 CSSToLengthConversionData conversionData = state.cssToLengthConversionData() .copyWithAdjustedZoom(1.0f);
512 return primitiveValue->convertToLength(conversionData);
513 }
514
515 Length StyleBuilderConverter::convertLengthSizing(StyleResolverState& state, CSS Value* value) 508 Length StyleBuilderConverter::convertLengthSizing(StyleResolverState& state, CSS Value* value)
516 { 509 {
517 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 510 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
518 switch (primitiveValue->getValueID()) { 511 switch (primitiveValue->getValueID()) {
519 case CSSValueInvalid: 512 case CSSValueInvalid:
520 return convertLength(state, value); 513 return convertLength(state, value);
521 case CSSValueIntrinsic: 514 case CSSValueIntrinsic:
522 return Length(Intrinsic); 515 return Length(Intrinsic);
523 case CSSValueMinIntrinsic: 516 case CSSValueMinIntrinsic:
524 return Length(MinIntrinsic); 517 return Length(MinIntrinsic);
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 CSSPrimitiveValue* primitiveValueZ = toCSSPrimitiveValue(list->item(2)); 867 CSSPrimitiveValue* primitiveValueZ = toCSSPrimitiveValue(list->item(2));
875 868
876 return TransformOrigin( 869 return TransformOrigin(
877 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX) , 870 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX) ,
878 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY) , 871 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY) ,
879 StyleBuilderConverter::convertComputedLength<float>(state, primitiveValu eZ) 872 StyleBuilderConverter::convertComputedLength<float>(state, primitiveValu eZ)
880 ); 873 );
881 } 874 }
882 875
883 } // namespace blink 876 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleBuilderConverter.h ('k') | Source/core/layout/svg/LayoutSVGRect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698