 Chromium Code Reviews
 Chromium Code Reviews Issue 128203003:
  Teach mapFill{X,Y}Position about initial values to individual background layers  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 128203003:
  Teach mapFill{X,Y}Position about initial values to individual background layers  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| OLD | NEW | 
|---|---|
| 1 /* | 1 /* | 
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 
| 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 
| 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 
| 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights reserved. | 
| 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 
| 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) | 
| 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 
| 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 211 secondLength = Length(); | 211 secondLength = Length(); | 
| 212 } | 212 } | 
| 213 | 213 | 
| 214 b.setWidth(firstLength); | 214 b.setWidth(firstLength); | 
| 215 b.setHeight(secondLength); | 215 b.setHeight(secondLength); | 
| 216 layer->setSizeLength(b); | 216 layer->setSizeLength(b); | 
| 217 } | 217 } | 
| 218 | 218 | 
| 219 void CSSToStyleMap::mapFillXPosition(CSSPropertyID propertyID, FillLayer* layer, CSSValue* value) const | 219 void CSSToStyleMap::mapFillXPosition(CSSPropertyID propertyID, FillLayer* layer, CSSValue* value) const | 
| 220 { | 220 { | 
| 221 if (value->isInitialValue()) { | |
| 
Julien - ping for review
2014/01/10 13:37:03
Shouldn't you also handle the keyword 'inherit' he
 
davve
2014/01/10 14:09:49
Hm, I don't think so. The added code is for handli
 | |
| 222 layer->setXPosition(FillLayer::initialFillXPosition(layer->type())); | |
| 223 return; | |
| 224 } | |
| 225 | |
| 221 if (!value->isPrimitiveValue()) | 226 if (!value->isPrimitiveValue()) | 
| 222 return; | 227 return; | 
| 223 | 228 | 
| 224 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 229 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 
| 225 Pair* pair = primitiveValue->getPairValue(); | 230 Pair* pair = primitiveValue->getPairValue(); | 
| 226 if (pair) { | 231 if (pair) { | 
| 227 ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionX | | propertyID == CSSPropertyWebkitMaskPositionX); | 232 ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionX | | propertyID == CSSPropertyWebkitMaskPositionX); | 
| 228 primitiveValue = pair->second(); | 233 primitiveValue = pair->second(); | 
| 229 } | 234 } | 
| 230 | 235 | 
| 231 Length length = primitiveValue->convertToLength<FixedConversion | PercentCon version>(cssToLengthConversionData()); | 236 Length length = primitiveValue->convertToLength<FixedConversion | PercentCon version>(cssToLengthConversionData()); | 
| 232 | 237 | 
| 233 layer->setXPosition(length); | 238 layer->setXPosition(length); | 
| 234 if (pair) | 239 if (pair) | 
| 235 layer->setBackgroundXOrigin(*(pair->first())); | 240 layer->setBackgroundXOrigin(*(pair->first())); | 
| 236 } | 241 } | 
| 237 | 242 | 
| 238 void CSSToStyleMap::mapFillYPosition(CSSPropertyID propertyID, FillLayer* layer, CSSValue* value) const | 243 void CSSToStyleMap::mapFillYPosition(CSSPropertyID propertyID, FillLayer* layer, CSSValue* value) const | 
| 239 { | 244 { | 
| 245 if (value->isInitialValue()) { | |
| 246 layer->setYPosition(FillLayer::initialFillYPosition(layer->type())); | |
| 247 return; | |
| 248 } | |
| 249 | |
| 240 if (!value->isPrimitiveValue()) | 250 if (!value->isPrimitiveValue()) | 
| 241 return; | 251 return; | 
| 242 | 252 | 
| 243 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 253 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 
| 244 Pair* pair = primitiveValue->getPairValue(); | 254 Pair* pair = primitiveValue->getPairValue(); | 
| 245 if (pair) { | 255 if (pair) { | 
| 246 ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionY | | propertyID == CSSPropertyWebkitMaskPositionY); | 256 ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionY | | propertyID == CSSPropertyWebkitMaskPositionY); | 
| 247 primitiveValue = pair->second(); | 257 primitiveValue = pair->second(); | 
| 248 } | 258 } | 
| 249 | 259 | 
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 646 verticalRule = SpaceImageRule; | 656 verticalRule = SpaceImageRule; | 
| 647 break; | 657 break; | 
| 648 default: // CSSValueRepeat | 658 default: // CSSValueRepeat | 
| 649 verticalRule = RepeatImageRule; | 659 verticalRule = RepeatImageRule; | 
| 650 break; | 660 break; | 
| 651 } | 661 } | 
| 652 image.setVerticalRule(verticalRule); | 662 image.setVerticalRule(verticalRule); | 
| 653 } | 663 } | 
| 654 | 664 | 
| 655 }; | 665 }; | 
| OLD | NEW |