Chromium Code Reviews| 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 | 973 // offset-distance |
|
suzyh_UTC10 (ex-contributor)
2016/09/19 01:21:04
Should these be moved down after object* to mainta
| |
| 974 static StylePath* initialMotionPath() { return nullptr; } | 974 static Length initialOffsetDistance() { return Length(0, Fixed); } |
| 975 StylePath* motionPath() const { return m_rareNonInheritedData->m_transform-> m_motion.m_path.get(); } | 975 const Length& offsetDistance() const { return m_rareNonInheritedData->m_tran sform->m_motion.m_distance; } |
| 976 void setMotionPath(PassRefPtr<StylePath>); | 976 void setOffsetDistance(const Length& offsetDistance) { SET_NESTED_VAR(m_rare NonInheritedData, m_transform, m_motion.m_distance, offsetDistance); } |
| 977 | 977 |
| 978 // motion-offset | 978 // offset-path |
| 979 static Length initialMotionOffset() { return Length(0, Fixed); } | 979 static StylePath* initialOffsetPath() { return nullptr; } |
| 980 const Length& motionOffset() const { return m_rareNonInheritedData->m_transf orm->m_motion.m_offset; } | 980 StylePath* offsetPath() const { return m_rareNonInheritedData->m_transform-> m_motion.m_path.get(); } |
| 981 void setMotionOffset(const Length& motionOffset) { SET_NESTED_VAR(m_rareNonI nheritedData, m_transform, m_motion.m_offset, motionOffset); } | 981 void setOffsetPath(PassRefPtr<StylePath>); |
| 982 | 982 |
| 983 // motion-rotation | 983 // offset-rotation |
| 984 static StyleMotionRotation initialMotionRotation() { return StyleMotionRotat ion(0, MotionRotationAuto); } | 984 static StyleOffsetRotation initialOffsetRotation() { return StyleOffsetRotat ion(0, OffsetRotationAuto); } |
| 985 const StyleMotionRotation& motionRotation() const { return m_rareNonInherite dData->m_transform->m_motion.m_rotation; } | 985 const StyleOffsetRotation& offsetRotation() 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) ; } | 986 void setOffsetRotation(const StyleOffsetRotation& offsetRotation) { SET_NEST ED_VAR(m_rareNonInheritedData, m_transform, m_motion.m_rotation, offsetRotation) ; } |
| 987 | 987 |
| 988 // object-fit | 988 // object-fit |
| 989 static ObjectFit initialObjectFit() { return ObjectFitFill; } | 989 static ObjectFit initialObjectFit() { return ObjectFitFill; } |
| 990 ObjectFit getObjectFit() const { return static_cast<ObjectFit>(m_rareNonInhe ritedData->m_objectFit); } | 990 ObjectFit getObjectFit() const { return static_cast<ObjectFit>(m_rareNonInhe ritedData->m_objectFit); } |
| 991 void setObjectFit(ObjectFit f) { SET_VAR(m_rareNonInheritedData, m_objectFit , f); } | 991 void setObjectFit(ObjectFit f) { SET_VAR(m_rareNonInheritedData, m_objectFit , f); } |
| 992 | 992 |
| 993 // object-position | 993 // object-position |
| 994 static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0, Percent), Length(50.0, Percent)); } | 994 static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0, Percent), Length(50.0, Percent)); } |
| 995 LengthPoint objectPosition() const { return m_rareNonInheritedData->m_object Position; } | 995 LengthPoint objectPosition() const { return m_rareNonInheritedData->m_object Position; } |
| 996 void setObjectPosition(LengthPoint position) { SET_VAR(m_rareNonInheritedDat a, m_objectPosition, position); } | 996 void setObjectPosition(LengthPoint position) { SET_VAR(m_rareNonInheritedDat a, m_objectPosition, position); } |
| (...skipping 1130 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 |