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

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

Issue 22839023: Add support for the object-position CSS property. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 } 863 }
864 864
865 Length StyleBuilderConverter::convertLengthMaxSizing(StyleResolverState& state, CSSValue* value) 865 Length StyleBuilderConverter::convertLengthMaxSizing(StyleResolverState& state, CSSValue* value)
866 { 866 {
867 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 867 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
868 if (primitiveValue->getValueID() == CSSValueNone) 868 if (primitiveValue->getValueID() == CSSValueNone)
869 return Length(Undefined); 869 return Length(Undefined);
870 return convertLengthSizing(state, value); 870 return convertLengthSizing(state, value);
871 } 871 }
872 872
873 LengthPoint StyleBuilderConverter::convertLengthPoint(StyleResolverState& state, CSSValue* value)
874 {
875 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
876 Pair* pair = primitiveValue->getPairValue();
877 Length x = pair->first()->convertToLength<FixedIntegerConversion | PercentCo nversion>(state.style(), state.rootElementStyle(), state.style()->effectiveZoom( ));
878 Length y = pair->second()->convertToLength<FixedIntegerConversion | PercentC onversion>(state.style(), state.rootElementStyle(), state.style()->effectiveZoom ());
879 return LengthPoint(x, y);
880 }
881
873 LengthSize StyleBuilderConverter::convertRadius(StyleResolverState& state, CSSVa lue* value) 882 LengthSize StyleBuilderConverter::convertRadius(StyleResolverState& state, CSSVa lue* value)
874 { 883 {
875 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 884 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
876 Pair* pair = primitiveValue->getPairValue(); 885 Pair* pair = primitiveValue->getPairValue();
877 Length radiusWidth = pair->first()->convertToLength<FixedIntegerConversion | PercentConversion>(state.style(), state.rootElementStyle(), state.style()->effe ctiveZoom()); 886 Length radiusWidth = pair->first()->convertToLength<FixedIntegerConversion | PercentConversion>(state.style(), state.rootElementStyle(), state.style()->effe ctiveZoom());
878 Length radiusHeight = pair->second()->convertToLength<FixedIntegerConversion | PercentConversion>(state.style(), state.rootElementStyle(), state.style()->ef fectiveZoom()); 887 Length radiusHeight = pair->second()->convertToLength<FixedIntegerConversion | PercentConversion>(state.style(), state.rootElementStyle(), state.style()->ef fectiveZoom());
879 float width = radiusWidth.value(); 888 float width = radiusWidth.value();
880 float height = radiusHeight.value(); 889 float height = radiusHeight.value();
881 ASSERT(width >= 0 && height >= 0); 890 ASSERT(width >= 0 && height >= 0);
882 if (width <= 0 || height <= 0) 891 if (width <= 0 || height <= 0)
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 case CSSPropertyBorderImage: 1442 case CSSPropertyBorderImage:
1434 case CSSPropertyBorderLeft: 1443 case CSSPropertyBorderLeft:
1435 case CSSPropertyBorderRadius: 1444 case CSSPropertyBorderRadius:
1436 case CSSPropertyBorderRight: 1445 case CSSPropertyBorderRight:
1437 case CSSPropertyBorderSpacing: 1446 case CSSPropertyBorderSpacing:
1438 case CSSPropertyBorderStyle: 1447 case CSSPropertyBorderStyle:
1439 case CSSPropertyBorderTop: 1448 case CSSPropertyBorderTop:
1440 case CSSPropertyBorderWidth: 1449 case CSSPropertyBorderWidth:
1441 case CSSPropertyListStyle: 1450 case CSSPropertyListStyle:
1442 case CSSPropertyMargin: 1451 case CSSPropertyMargin:
1452 case CSSPropertyObjectPosition:
1443 case CSSPropertyOutline: 1453 case CSSPropertyOutline:
1444 case CSSPropertyOverflow: 1454 case CSSPropertyOverflow:
1445 case CSSPropertyPadding: 1455 case CSSPropertyPadding:
1446 case CSSPropertyTransition: 1456 case CSSPropertyTransition:
1447 case CSSPropertyWebkitAnimation: 1457 case CSSPropertyWebkitAnimation:
1448 case CSSPropertyWebkitBorderAfter: 1458 case CSSPropertyWebkitBorderAfter:
1449 case CSSPropertyWebkitBorderBefore: 1459 case CSSPropertyWebkitBorderBefore:
1450 case CSSPropertyWebkitBorderEnd: 1460 case CSSPropertyWebkitBorderEnd:
1451 case CSSPropertyWebkitBorderStart: 1461 case CSSPropertyWebkitBorderStart:
1452 case CSSPropertyWebkitBorderRadius: 1462 case CSSPropertyWebkitBorderRadius:
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
2380 break; 2390 break;
2381 } 2391 }
2382 case CSSPropertyEnableBackground: 2392 case CSSPropertyEnableBackground:
2383 // Silently ignoring this property for now 2393 // Silently ignoring this property for now
2384 // http://bugs.webkit.org/show_bug.cgi?id=6022 2394 // http://bugs.webkit.org/show_bug.cgi?id=6022
2385 break; 2395 break;
2386 } 2396 }
2387 } 2397 }
2388 2398
2389 } // namespace WebCore 2399 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698