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 15 matching lines...) Expand all Loading... |
26 */ | 26 */ |
27 | 27 |
28 #include "config.h" | 28 #include "config.h" |
29 #include "core/css/resolver/CSSToStyleMap.h" | 29 #include "core/css/resolver/CSSToStyleMap.h" |
30 | 30 |
31 #include "core/CSSValueKeywords.h" | 31 #include "core/CSSValueKeywords.h" |
32 #include "core/animation/css/CSSAnimationData.h" | 32 #include "core/animation/css/CSSAnimationData.h" |
33 #include "core/css/CSSBorderImageSliceValue.h" | 33 #include "core/css/CSSBorderImageSliceValue.h" |
34 #include "core/css/CSSPrimitiveValue.h" | 34 #include "core/css/CSSPrimitiveValue.h" |
35 #include "core/css/CSSPrimitiveValueMappings.h" | 35 #include "core/css/CSSPrimitiveValueMappings.h" |
| 36 #include "core/css/CSSQuadValue.h" |
36 #include "core/css/CSSTimingFunctionValue.h" | 37 #include "core/css/CSSTimingFunctionValue.h" |
37 #include "core/css/Pair.h" | 38 #include "core/css/Pair.h" |
38 #include "core/css/Rect.h" | |
39 #include "core/css/resolver/StyleBuilderConverter.h" | 39 #include "core/css/resolver/StyleBuilderConverter.h" |
40 #include "core/css/resolver/StyleResolverState.h" | 40 #include "core/css/resolver/StyleResolverState.h" |
41 #include "core/style/BorderImageLengthBox.h" | 41 #include "core/style/BorderImageLengthBox.h" |
42 #include "core/style/FillLayer.h" | 42 #include "core/style/FillLayer.h" |
43 | 43 |
44 namespace blink { | 44 namespace blink { |
45 | 45 |
46 void CSSToStyleMap::mapFillAttachment(StyleResolverState&, FillLayer* layer, CSS
Value* value) | 46 void CSSToStyleMap::mapFillAttachment(StyleResolverState&, FillLayer* layer, CSS
Value* value) |
47 { | 47 { |
48 if (value->isInitialValue()) { | 48 if (value->isInitialValue()) { |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 void CSSToStyleMap::mapNinePieceImageSlice(StyleResolverState&, CSSValue* value,
NinePieceImage& image) | 485 void CSSToStyleMap::mapNinePieceImageSlice(StyleResolverState&, CSSValue* value,
NinePieceImage& image) |
486 { | 486 { |
487 if (!value || !value->isBorderImageSliceValue()) | 487 if (!value || !value->isBorderImageSliceValue()) |
488 return; | 488 return; |
489 | 489 |
490 // Retrieve the border image value. | 490 // Retrieve the border image value. |
491 CSSBorderImageSliceValue* borderImageSlice = toCSSBorderImageSliceValue(valu
e); | 491 CSSBorderImageSliceValue* borderImageSlice = toCSSBorderImageSliceValue(valu
e); |
492 | 492 |
493 // Set up a length box to represent our image slices. | 493 // Set up a length box to represent our image slices. |
494 LengthBox box; | 494 LengthBox box; |
495 Quad* slices = borderImageSlice->slices(); | 495 CSSQuadValue* slices = borderImageSlice->slices(); |
496 if (slices->top()->isPercentage()) | 496 if (slices->top()->isPercentage()) |
497 box.m_top = Length(slices->top()->getDoubleValue(), Percent); | 497 box.m_top = Length(slices->top()->getDoubleValue(), Percent); |
498 else | 498 else |
499 box.m_top = Length(slices->top()->getIntValue(), Fixed); | 499 box.m_top = Length(slices->top()->getIntValue(), Fixed); |
500 if (slices->bottom()->isPercentage()) | 500 if (slices->bottom()->isPercentage()) |
501 box.m_bottom = Length(slices->bottom()->getDoubleValue(), Percent); | 501 box.m_bottom = Length(slices->bottom()->getDoubleValue(), Percent); |
502 else | 502 else |
503 box.m_bottom = Length(slices->bottom()->getIntValue(), Fixed); | 503 box.m_bottom = Length(slices->bottom()->getIntValue(), Fixed); |
504 if (slices->left()->isPercentage()) | 504 if (slices->left()->isPercentage()) |
505 box.m_left = Length(slices->left()->getDoubleValue(), Percent); | 505 box.m_left = Length(slices->left()->getDoubleValue(), Percent); |
(...skipping 15 matching lines...) Expand all Loading... |
521 return value.getDoubleValue(); | 521 return value.getDoubleValue(); |
522 if (value.isPercentage()) | 522 if (value.isPercentage()) |
523 return Length(value.getDoubleValue(), Percent); | 523 return Length(value.getDoubleValue(), Percent); |
524 if (value.getValueID() != CSSValueAuto) | 524 if (value.getValueID() != CSSValueAuto) |
525 return value.computeLength<Length>(conversionData); | 525 return value.computeLength<Length>(conversionData); |
526 return Length(Auto); | 526 return Length(Auto); |
527 } | 527 } |
528 | 528 |
529 BorderImageLengthBox CSSToStyleMap::mapNinePieceImageQuad(StyleResolverState& st
ate, CSSValue* value) | 529 BorderImageLengthBox CSSToStyleMap::mapNinePieceImageQuad(StyleResolverState& st
ate, CSSValue* value) |
530 { | 530 { |
531 if (!value || !value->isPrimitiveValue()) | 531 if (!value || !value->isQuadValue()) |
532 return BorderImageLengthBox(Length(Auto)); | 532 return BorderImageLengthBox(Length(Auto)); |
533 | 533 |
534 Quad* slices = toCSSPrimitiveValue(value)->getQuadValue(); | 534 RefPtrWillBeRawPtr<CSSQuadValue> slices = toCSSQuadValue(value); |
535 | 535 |
536 // Set up a border image length box to represent our image slices. | 536 // Set up a border image length box to represent our image slices. |
537 return BorderImageLengthBox( | 537 return BorderImageLengthBox( |
538 toBorderImageLength(*slices->top(), state.cssToLengthConversionData()), | 538 toBorderImageLength(*slices->top(), state.cssToLengthConversionData()), |
539 toBorderImageLength(*slices->right(), state.cssToLengthConversionData())
, | 539 toBorderImageLength(*slices->right(), state.cssToLengthConversionData())
, |
540 toBorderImageLength(*slices->bottom(), state.cssToLengthConversionData()
), | 540 toBorderImageLength(*slices->bottom(), state.cssToLengthConversionData()
), |
541 toBorderImageLength(*slices->left(), state.cssToLengthConversionData()))
; | 541 toBorderImageLength(*slices->left(), state.cssToLengthConversionData()))
; |
542 } | 542 } |
543 | 543 |
544 void CSSToStyleMap::mapNinePieceImageRepeat(StyleResolverState&, CSSValue* value
, NinePieceImage& image) | 544 void CSSToStyleMap::mapNinePieceImageRepeat(StyleResolverState&, CSSValue* value
, NinePieceImage& image) |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 verticalRule = SpaceImageRule; | 583 verticalRule = SpaceImageRule; |
584 break; | 584 break; |
585 default: // CSSValueRepeat | 585 default: // CSSValueRepeat |
586 verticalRule = RepeatImageRule; | 586 verticalRule = RepeatImageRule; |
587 break; | 587 break; |
588 } | 588 } |
589 image.setVerticalRule(verticalRule); | 589 image.setVerticalRule(verticalRule); |
590 } | 590 } |
591 | 591 |
592 }; | 592 }; |
OLD | NEW |