OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "core/style/StyleBackgroundData.h" | 37 #include "core/style/StyleBackgroundData.h" |
38 #include "core/style/StyleBoxData.h" | 38 #include "core/style/StyleBoxData.h" |
39 #include "core/style/StyleContentAlignmentData.h" | 39 #include "core/style/StyleContentAlignmentData.h" |
40 #include "core/style/StyleDeprecatedFlexibleBoxData.h" | 40 #include "core/style/StyleDeprecatedFlexibleBoxData.h" |
41 #include "core/style/StyleDifference.h" | 41 #include "core/style/StyleDifference.h" |
42 #include "core/style/StyleFilterData.h" | 42 #include "core/style/StyleFilterData.h" |
43 #include "core/style/StyleFlexibleBoxData.h" | 43 #include "core/style/StyleFlexibleBoxData.h" |
44 #include "core/style/StyleGridData.h" | 44 #include "core/style/StyleGridData.h" |
45 #include "core/style/StyleGridItemData.h" | 45 #include "core/style/StyleGridItemData.h" |
46 #include "core/style/StyleInheritedData.h" | 46 #include "core/style/StyleInheritedData.h" |
47 #include "core/style/StyleMotionRotation.h" | |
48 #include "core/style/StyleMultiColData.h" | 47 #include "core/style/StyleMultiColData.h" |
| 48 #include "core/style/StyleOffsetRotation.h" |
49 #include "core/style/StyleRareInheritedData.h" | 49 #include "core/style/StyleRareInheritedData.h" |
50 #include "core/style/StyleRareNonInheritedData.h" | 50 #include "core/style/StyleRareNonInheritedData.h" |
51 #include "core/style/StyleReflection.h" | 51 #include "core/style/StyleReflection.h" |
52 #include "core/style/StyleSelfAlignmentData.h" | 52 #include "core/style/StyleSelfAlignmentData.h" |
53 #include "core/style/StyleSurroundData.h" | 53 #include "core/style/StyleSurroundData.h" |
54 #include "core/style/StyleTransformData.h" | 54 #include "core/style/StyleTransformData.h" |
55 #include "core/style/StyleVisualData.h" | 55 #include "core/style/StyleVisualData.h" |
56 #include "core/style/StyleWillChangeData.h" | 56 #include "core/style/StyleWillChangeData.h" |
57 #include "core/style/TransformOrigin.h" | 57 #include "core/style/TransformOrigin.h" |
58 #include "platform/Length.h" | 58 #include "platform/Length.h" |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 // -webkit-margin-after-collapse (aka -webkit-margin-bottom-collapse) | 963 // -webkit-margin-after-collapse (aka -webkit-margin-bottom-collapse) |
964 static EMarginCollapse initialMarginAfterCollapse() { return MarginCollapseC
ollapse; } | 964 static EMarginCollapse initialMarginAfterCollapse() { return MarginCollapseC
ollapse; } |
965 EMarginCollapse marginBeforeCollapse() const { return static_cast<EMarginCol
lapse>(m_rareNonInheritedData->marginBeforeCollapse); } | 965 EMarginCollapse marginBeforeCollapse() const { return static_cast<EMarginCol
lapse>(m_rareNonInheritedData->marginBeforeCollapse); } |
966 void setMarginAfterCollapse(EMarginCollapse c) { SET_VAR(m_rareNonInheritedD
ata, marginAfterCollapse, c); } | 966 void setMarginAfterCollapse(EMarginCollapse c) { SET_VAR(m_rareNonInheritedD
ata, marginAfterCollapse, c); } |
967 | 967 |
968 // mix-blend-mode | 968 // mix-blend-mode |
969 static WebBlendMode initialBlendMode() { return WebBlendModeNormal; } | 969 static WebBlendMode initialBlendMode() { return WebBlendModeNormal; } |
970 WebBlendMode blendMode() const { return static_cast<WebBlendMode>(m_rareNonI
nheritedData->m_effectiveBlendMode); } | 970 WebBlendMode blendMode() const { return static_cast<WebBlendMode>(m_rareNonI
nheritedData->m_effectiveBlendMode); } |
971 void setBlendMode(WebBlendMode v) { m_rareNonInheritedData.access()->m_effec
tiveBlendMode = v; } | 971 void setBlendMode(WebBlendMode v) { m_rareNonInheritedData.access()->m_effec
tiveBlendMode = v; } |
972 | 972 |
973 // motion-path | |
974 static StylePath* initialMotionPath() { return nullptr; } | |
975 StylePath* motionPath() const { return m_rareNonInheritedData->m_transform->
m_motion.m_path.get(); } | |
976 void setMotionPath(PassRefPtr<StylePath>); | |
977 | |
978 // motion-offset | |
979 static Length initialMotionOffset() { return Length(0, Fixed); } | |
980 const Length& motionOffset() const { return m_rareNonInheritedData->m_transf
orm->m_motion.m_offset; } | |
981 void setMotionOffset(const Length& motionOffset) { SET_NESTED_VAR(m_rareNonI
nheritedData, m_transform, m_motion.m_offset, motionOffset); } | |
982 | |
983 // motion-rotation | |
984 static StyleMotionRotation initialMotionRotation() { return StyleMotionRotat
ion(0, MotionRotationAuto); } | |
985 const StyleMotionRotation& motionRotation() const { return m_rareNonInherite
dData->m_transform->m_motion.m_rotation; } | |
986 void setMotionRotation(const StyleMotionRotation& motionRotation) { SET_NEST
ED_VAR(m_rareNonInheritedData, m_transform, m_motion.m_rotation, motionRotation)
; } | |
987 | |
988 // object-fit | 973 // object-fit |
989 static ObjectFit initialObjectFit() { return ObjectFitFill; } | 974 static ObjectFit initialObjectFit() { return ObjectFitFill; } |
990 ObjectFit getObjectFit() const { return static_cast<ObjectFit>(m_rareNonInhe
ritedData->m_objectFit); } | 975 ObjectFit getObjectFit() const { return static_cast<ObjectFit>(m_rareNonInhe
ritedData->m_objectFit); } |
991 void setObjectFit(ObjectFit f) { SET_VAR(m_rareNonInheritedData, m_objectFit
, f); } | 976 void setObjectFit(ObjectFit f) { SET_VAR(m_rareNonInheritedData, m_objectFit
, f); } |
992 | 977 |
993 // object-position | 978 // object-position |
994 static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0,
Percent), Length(50.0, Percent)); } | 979 static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0,
Percent), Length(50.0, Percent)); } |
995 LengthPoint objectPosition() const { return m_rareNonInheritedData->m_object
Position; } | 980 LengthPoint objectPosition() const { return m_rareNonInheritedData->m_object
Position; } |
996 void setObjectPosition(LengthPoint position) { SET_VAR(m_rareNonInheritedDat
a, m_objectPosition, position); } | 981 void setObjectPosition(LengthPoint position) { SET_VAR(m_rareNonInheritedDat
a, m_objectPosition, position); } |
997 | 982 |
| 983 // offset-distance |
| 984 static Length initialOffsetDistance() { return Length(0, Fixed); } |
| 985 const Length& offsetDistance() const { return m_rareNonInheritedData->m_tran
sform->m_motion.m_distance; } |
| 986 void setOffsetDistance(const Length& offsetDistance) { SET_NESTED_VAR(m_rare
NonInheritedData, m_transform, m_motion.m_distance, offsetDistance); } |
| 987 |
| 988 // offset-path |
| 989 static StylePath* initialOffsetPath() { return nullptr; } |
| 990 StylePath* offsetPath() const { return m_rareNonInheritedData->m_transform->
m_motion.m_path.get(); } |
| 991 void setOffsetPath(PassRefPtr<StylePath>); |
| 992 |
| 993 // offset-rotation |
| 994 static StyleOffsetRotation initialOffsetRotation() { return StyleOffsetRotat
ion(0, OffsetRotationAuto); } |
| 995 const StyleOffsetRotation& offsetRotation() const { return m_rareNonInherite
dData->m_transform->m_motion.m_rotation; } |
| 996 void setOffsetRotation(const StyleOffsetRotation& offsetRotation) { SET_NEST
ED_VAR(m_rareNonInheritedData, m_transform, m_motion.m_rotation, offsetRotation)
; } |
| 997 |
998 // opacity (aka -webkit-opacity) | 998 // opacity (aka -webkit-opacity) |
999 static float initialOpacity() { return 1.0f; } | 999 static float initialOpacity() { return 1.0f; } |
1000 float opacity() const { return m_rareNonInheritedData->opacity; } | 1000 float opacity() const { return m_rareNonInheritedData->opacity; } |
1001 void setOpacity(float f) { float v = clampTo<float>(f, 0, 1); SET_VAR(m_rare
NonInheritedData, opacity, v); } | 1001 void setOpacity(float f) { float v = clampTo<float>(f, 0, 1); SET_VAR(m_rare
NonInheritedData, opacity, v); } |
1002 | 1002 |
1003 // order (aka -webkit-order) | 1003 // order (aka -webkit-order) |
1004 static int initialOrder() { return 0; } | 1004 static int initialOrder() { return 0; } |
1005 int order() const { return m_rareNonInheritedData->m_order; } | 1005 int order() const { return m_rareNonInheritedData->m_order; } |
1006 // We restrict the smallest value to int min + 2 because we use int min and
int min + 1 as special values in a hash set. | 1006 // We restrict the smallest value to int min + 2 because we use int min and
int min + 1 as special values in a hash set. |
1007 void setOrder(int o) { SET_VAR(m_rareNonInheritedData, m_order, max(std::num
eric_limits<int>::min() + 2, o)); } | 1007 void setOrder(int o) { SET_VAR(m_rareNonInheritedData, m_order, max(std::num
eric_limits<int>::min() + 2, o)); } |
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2127 FloatRoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, | 2127 FloatRoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, |
2128 const LayoutRectOutsets insets, bool includeLogicalLeftEdge, bool includ
eLogicalRightEdge) const; | 2128 const LayoutRectOutsets insets, bool includeLogicalLeftEdge, bool includ
eLogicalRightEdge) const; |
2129 | 2129 |
2130 // Float utility functions. | 2130 // Float utility functions. |
2131 bool isFloating() const { return m_nonInheritedData.m_floating != NoFloat; } | 2131 bool isFloating() const { return m_nonInheritedData.m_floating != NoFloat; } |
2132 | 2132 |
2133 // Mix-blend-mode utility functions. | 2133 // Mix-blend-mode utility functions. |
2134 bool hasBlendMode() const { return blendMode() != WebBlendModeNormal; } | 2134 bool hasBlendMode() const { return blendMode() != WebBlendModeNormal; } |
2135 | 2135 |
2136 // Motion utility functions. | 2136 // Motion utility functions. |
2137 bool hasMotionPath() const { return motionPath(); } | 2137 bool hasOffsetPath() const { return offsetPath(); } |
2138 | 2138 |
2139 // Direction utility functions. | 2139 // Direction utility functions. |
2140 bool isLeftToRightDirection() const { return direction() == LTR; } | 2140 bool isLeftToRightDirection() const { return direction() == LTR; } |
2141 | 2141 |
2142 // Perspective utility functions. | 2142 // Perspective utility functions. |
2143 bool hasPerspective() const { return m_rareNonInheritedData->m_perspective >
0; } | 2143 bool hasPerspective() const { return m_rareNonInheritedData->m_perspective >
0; } |
2144 | 2144 |
2145 // Page size utility functions. | 2145 // Page size utility functions. |
2146 void resetPageSizeType() { SET_VAR(m_rareNonInheritedData, m_pageSizeType, P
AGE_SIZE_AUTO); } | 2146 void resetPageSizeType() { SET_VAR(m_rareNonInheritedData, m_pageSizeType, P
AGE_SIZE_AUTO); } |
2147 | 2147 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2235 bool isRunningAnimationOnCompositor() const { return isRunningOpacityAnimati
onOnCompositor() || isRunningTransformAnimationOnCompositor() || isRunningFilter
AnimationOnCompositor() || isRunningBackdropFilterAnimationOnCompositor(); } | 2235 bool isRunningAnimationOnCompositor() const { return isRunningOpacityAnimati
onOnCompositor() || isRunningTransformAnimationOnCompositor() || isRunningFilter
AnimationOnCompositor() || isRunningBackdropFilterAnimationOnCompositor(); } |
2236 | 2236 |
2237 // Opacity utility functions. | 2237 // Opacity utility functions. |
2238 bool hasOpacity() const { return opacity() < 1.0f; } | 2238 bool hasOpacity() const { return opacity() < 1.0f; } |
2239 | 2239 |
2240 // Table layout utility functions. | 2240 // Table layout utility functions. |
2241 bool isFixedTableLayout() const { return tableLayout() == TableLayoutFixed &
& !logicalWidth().isAuto(); } | 2241 bool isFixedTableLayout() const { return tableLayout() == TableLayoutFixed &
& !logicalWidth().isAuto(); } |
2242 | 2242 |
2243 // Filter/transform utility functions. | 2243 // Filter/transform utility functions. |
2244 bool has3DTransform() const { return m_rareNonInheritedData->m_transform->ha
s3DTransform(); } | 2244 bool has3DTransform() const { return m_rareNonInheritedData->m_transform->ha
s3DTransform(); } |
2245 bool hasTransform() const { return hasTransformOperations() || hasMotionPath
() || hasCurrentTransformAnimation() || translate() || rotate() || scale(); } | 2245 bool hasTransform() const { return hasTransformOperations() || hasOffsetPath
() || hasCurrentTransformAnimation() || translate() || rotate() || scale(); } |
2246 bool hasTransformOperations() const { return !m_rareNonInheritedData->m_tran
sform->m_operations.operations().isEmpty(); } | 2246 bool hasTransformOperations() const { return !m_rareNonInheritedData->m_tran
sform->m_operations.operations().isEmpty(); } |
2247 ETransformStyle3D usedTransformStyle3D() const { return hasGroupingProperty(
) ? TransformStyle3DFlat : transformStyle3D(); } | 2247 ETransformStyle3D usedTransformStyle3D() const { return hasGroupingProperty(
) ? TransformStyle3DFlat : transformStyle3D(); } |
2248 bool transformDataEquivalent(const ComputedStyle& otherStyle) const { return
m_rareNonInheritedData->m_transform == otherStyle.m_rareNonInheritedData->m_tra
nsform; } | 2248 bool transformDataEquivalent(const ComputedStyle& otherStyle) const { return
m_rareNonInheritedData->m_transform == otherStyle.m_rareNonInheritedData->m_tra
nsform; } |
2249 bool preserves3D() const { return usedTransformStyle3D() != TransformStyle3D
Flat; } | 2249 bool preserves3D() const { return usedTransformStyle3D() != TransformStyle3D
Flat; } |
2250 enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin }
; | 2250 enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin }
; |
2251 enum ApplyMotionPath { IncludeMotionPath, ExcludeMotionPath }; | 2251 enum ApplyMotionPath { IncludeMotionPath, ExcludeMotionPath }; |
2252 enum ApplyIndependentTransformProperties { IncludeIndependentTransformProper
ties , ExcludeIndependentTransformProperties }; | 2252 enum ApplyIndependentTransformProperties { IncludeIndependentTransformProper
ties , ExcludeIndependentTransformProperties }; |
2253 void applyTransform(TransformationMatrix&, const LayoutSize& borderBoxSize,
ApplyTransformOrigin, ApplyMotionPath, ApplyIndependentTransformProperties) cons
t; | 2253 void applyTransform(TransformationMatrix&, const LayoutSize& borderBoxSize,
ApplyTransformOrigin, ApplyMotionPath, ApplyIndependentTransformProperties) cons
t; |
2254 void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, App
lyTransformOrigin, ApplyMotionPath, ApplyIndependentTransformProperties) const; | 2254 void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, App
lyTransformOrigin, ApplyMotionPath, ApplyIndependentTransformProperties) const; |
2255 | 2255 |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2615 } | 2615 } |
2616 | 2616 |
2617 inline bool ComputedStyle::hasPseudoElementStyle() const | 2617 inline bool ComputedStyle::hasPseudoElementStyle() const |
2618 { | 2618 { |
2619 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; | 2619 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; |
2620 } | 2620 } |
2621 | 2621 |
2622 } // namespace blink | 2622 } // namespace blink |
2623 | 2623 |
2624 #endif // ComputedStyle_h | 2624 #endif // ComputedStyle_h |
OLD | NEW |