OLD | NEW |
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 25 matching lines...) Expand all Loading... |
36 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 36 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
37 */ | 37 */ |
38 | 38 |
39 #include "config.h" | 39 #include "config.h" |
40 | 40 |
41 #include "core/CSSPropertyNames.h" | 41 #include "core/CSSPropertyNames.h" |
42 #include "core/CSSValueKeywords.h" | 42 #include "core/CSSValueKeywords.h" |
43 #include "core/StyleBuilderFunctions.h" | 43 #include "core/StyleBuilderFunctions.h" |
44 #include "core/StylePropertyShorthand.h" | 44 #include "core/StylePropertyShorthand.h" |
45 #include "core/css/BasicShapeFunctions.h" | 45 #include "core/css/BasicShapeFunctions.h" |
46 #include "core/css/CSSAspectRatioValue.h" | |
47 #include "core/css/CSSCursorImageValue.h" | 46 #include "core/css/CSSCursorImageValue.h" |
48 #include "core/css/CSSFontValue.h" | 47 #include "core/css/CSSFontValue.h" |
49 #include "core/css/CSSGradientValue.h" | 48 #include "core/css/CSSGradientValue.h" |
50 #include "core/css/CSSGridTemplateAreasValue.h" | 49 #include "core/css/CSSGridTemplateAreasValue.h" |
51 #include "core/css/CSSHelper.h" | 50 #include "core/css/CSSHelper.h" |
52 #include "core/css/CSSImageSetValue.h" | 51 #include "core/css/CSSImageSetValue.h" |
53 #include "core/css/CSSLineBoxContainValue.h" | 52 #include "core/css/CSSLineBoxContainValue.h" |
54 #include "core/css/CSSPrimitiveValueMappings.h" | 53 #include "core/css/CSSPrimitiveValueMappings.h" |
55 #include "core/css/CSSPropertyMetadata.h" | 54 #include "core/css/CSSPropertyMetadata.h" |
56 #include "core/css/Counter.h" | 55 #include "core/css/Counter.h" |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 resetEffectiveZoom(state); | 726 resetEffectiveZoom(state); |
728 if (float percent = primitiveValue->getFloatValue()) | 727 if (float percent = primitiveValue->getFloatValue()) |
729 state.setZoom(percent / 100.0f); | 728 state.setZoom(percent / 100.0f); |
730 } else if (primitiveValue->isNumber()) { | 729 } else if (primitiveValue->isNumber()) { |
731 resetEffectiveZoom(state); | 730 resetEffectiveZoom(state); |
732 if (float number = primitiveValue->getFloatValue()) | 731 if (float number = primitiveValue->getFloatValue()) |
733 state.setZoom(number); | 732 state.setZoom(number); |
734 } | 733 } |
735 } | 734 } |
736 | 735 |
737 void StyleBuilderFunctions::applyInitialCSSPropertyWebkitAspectRatio(StyleResolv
erState& state) | |
738 { | |
739 state.style()->setHasAspectRatio(RenderStyle::initialHasAspectRatio()); | |
740 state.style()->setAspectRatioDenominator(RenderStyle::initialAspectRatioDeno
minator()); | |
741 state.style()->setAspectRatioNumerator(RenderStyle::initialAspectRatioNumera
tor()); | |
742 } | |
743 | |
744 void StyleBuilderFunctions::applyInheritCSSPropertyWebkitAspectRatio(StyleResolv
erState& state) | |
745 { | |
746 if (!state.parentStyle()->hasAspectRatio()) | |
747 return; | |
748 state.style()->setHasAspectRatio(true); | |
749 state.style()->setAspectRatioDenominator(state.parentStyle()->aspectRatioDen
ominator()); | |
750 state.style()->setAspectRatioNumerator(state.parentStyle()->aspectRatioNumer
ator()); | |
751 } | |
752 | |
753 void StyleBuilderFunctions::applyValueCSSPropertyWebkitAspectRatio(StyleResolver
State& state, CSSValue* value) | |
754 { | |
755 if (!value->isAspectRatioValue()) { | |
756 state.style()->setHasAspectRatio(false); | |
757 return; | |
758 } | |
759 CSSAspectRatioValue* aspectRatioValue = toCSSAspectRatioValue(value); | |
760 state.style()->setHasAspectRatio(true); | |
761 state.style()->setAspectRatioDenominator(aspectRatioValue->denominatorValue(
)); | |
762 state.style()->setAspectRatioNumerator(aspectRatioValue->numeratorValue()); | |
763 } | |
764 | |
765 void StyleBuilderFunctions::applyValueCSSPropertyWebkitBorderImage(StyleResolver
State& state, CSSValue* value) | 736 void StyleBuilderFunctions::applyValueCSSPropertyWebkitBorderImage(StyleResolver
State& state, CSSValue* value) |
766 { | 737 { |
767 NinePieceImage image; | 738 NinePieceImage image; |
768 state.styleMap().mapNinePieceImage(state.style(), CSSPropertyWebkitBorderIma
ge, value, image); | 739 state.styleMap().mapNinePieceImage(state.style(), CSSPropertyWebkitBorderIma
ge, value, image); |
769 state.style()->setBorderImage(image); | 740 state.style()->setBorderImage(image); |
770 } | 741 } |
771 | 742 |
772 void StyleBuilderFunctions::applyValueCSSPropertyWebkitClipPath(StyleResolverSta
te& state, CSSValue* value) | 743 void StyleBuilderFunctions::applyValueCSSPropertyWebkitClipPath(StyleResolverSta
te& state, CSSValue* value) |
773 { | 744 { |
774 if (value->isPrimitiveValue()) { | 745 if (value->isPrimitiveValue()) { |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 return; | 1095 return; |
1125 case CSSValueSuper: | 1096 case CSSValueSuper: |
1126 svgStyle.setBaselineShift(BS_SUPER); | 1097 svgStyle.setBaselineShift(BS_SUPER); |
1127 return; | 1098 return; |
1128 default: | 1099 default: |
1129 ASSERT_NOT_REACHED(); | 1100 ASSERT_NOT_REACHED(); |
1130 } | 1101 } |
1131 } | 1102 } |
1132 | 1103 |
1133 } // namespace blink | 1104 } // namespace blink |
OLD | NEW |