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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 450 } | 450 } |
| 451 LayoutRectOutsets borderImageOutsets() const | 451 LayoutRectOutsets borderImageOutsets() const |
| 452 { | 452 { |
| 453 return imageOutsets(borderImage()); | 453 return imageOutsets(borderImage()); |
| 454 } | 454 } |
| 455 | 455 |
| 456 // Returns |true| if any property that renders using filter operations is | 456 // Returns |true| if any property that renders using filter operations is |
| 457 // used (including, but not limited to, 'filter'). | 457 // used (including, but not limited to, 'filter'). |
| 458 bool hasFilterInducingProperty() const { return hasFilter() || (RuntimeEnabl edFeatures::cssBoxReflectFilterEnabled() && hasBoxReflect()); } | 458 bool hasFilterInducingProperty() const { return hasFilter() || (RuntimeEnabl edFeatures::cssBoxReflectFilterEnabled() && hasBoxReflect()); } |
| 459 | 459 |
| 460 // Returns |true| if opacity should be considered to have non-initial value for the purpose | |
| 461 // of creating stacking contexts. | |
| 462 bool hasNonInitialOpacity() const { return opacity() != 1.0f || hasWillChang eOpacityHint() || hasCurrentOpacityAnimation(); } | |
|
chrishtr
2016/06/15 16:06:41
hasOpacity() is the way to check for inequality wi
trchen
2016/06/18 00:27:09
Done.
| |
| 463 | |
| 464 // Returns whether this style contains any grouping property as defined by [ css-transforms]. | |
| 465 // The main purpose of this is to adjust the used value of transform-style p roperty. | |
| 466 // Note: We currently don't include every grouping property on the spec to m aintain | |
| 467 // backward compatibility. | |
| 468 // [css-transforms] https://drafts.csswg.org/css-transforms/#grouping-proper ty-values | |
| 469 bool hasGroupingProperty() const { return !isOverflowVisible() || hasFilterI nducingProperty() || hasNonInitialOpacity(); } | |
| 470 | |
| 460 Order rtlOrdering() const { return static_cast<Order>(inherited_flags.m_rtlO rdering); } | 471 Order rtlOrdering() const { return static_cast<Order>(inherited_flags.m_rtlO rdering); } |
| 461 void setRTLOrdering(Order o) { inherited_flags.m_rtlOrdering = o; } | 472 void setRTLOrdering(Order o) { inherited_flags.m_rtlOrdering = o; } |
| 462 | 473 |
| 463 bool isStyleAvailable() const; | 474 bool isStyleAvailable() const; |
| 464 | 475 |
| 465 bool hasAnyPublicPseudoStyles() const; | 476 bool hasAnyPublicPseudoStyles() const; |
| 466 bool hasPseudoStyle(PseudoId) const; | 477 bool hasPseudoStyle(PseudoId) const; |
| 467 void setHasPseudoStyle(PseudoId); | 478 void setHasPseudoStyle(PseudoId); |
| 468 bool hasUniquePseudoStyle() const; | 479 bool hasUniquePseudoStyle() const; |
| 469 bool hasPseudoElementStyle() const; | 480 bool hasPseudoElementStyle() const; |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 952 | 963 |
| 953 // Apple-specific property getter methods | 964 // Apple-specific property getter methods |
| 954 EPointerEvents pointerEvents() const { return static_cast<EPointerEvents>(in herited_flags._pointerEvents); } | 965 EPointerEvents pointerEvents() const { return static_cast<EPointerEvents>(in herited_flags._pointerEvents); } |
| 955 const CSSAnimationData* animations() const { return rareNonInheritedData->m_ animations.get(); } | 966 const CSSAnimationData* animations() const { return rareNonInheritedData->m_ animations.get(); } |
| 956 const CSSTransitionData* transitions() const { return rareNonInheritedData-> m_transitions.get(); } | 967 const CSSTransitionData* transitions() const { return rareNonInheritedData-> m_transitions.get(); } |
| 957 | 968 |
| 958 CSSAnimationData& accessAnimations(); | 969 CSSAnimationData& accessAnimations(); |
| 959 CSSTransitionData& accessTransitions(); | 970 CSSTransitionData& accessTransitions(); |
| 960 | 971 |
| 961 ETransformStyle3D transformStyle3D() const { return static_cast<ETransformSt yle3D>(rareNonInheritedData->m_transformStyle3D); } | 972 ETransformStyle3D transformStyle3D() const { return static_cast<ETransformSt yle3D>(rareNonInheritedData->m_transformStyle3D); } |
| 962 bool preserves3D() const { return rareNonInheritedData->m_transformStyle3D = = TransformStyle3DPreserve3D; } | 973 ETransformStyle3D usedTransformStyle3D() const; |
| 974 bool preserves3D() const { return usedTransformStyle3D() != TransformStyle3D Flat; } | |
| 963 | 975 |
| 964 EBackfaceVisibility backfaceVisibility() const { return static_cast<EBackfac eVisibility>(rareNonInheritedData->m_backfaceVisibility); } | 976 EBackfaceVisibility backfaceVisibility() const { return static_cast<EBackfac eVisibility>(rareNonInheritedData->m_backfaceVisibility); } |
| 965 float perspective() const { return rareNonInheritedData->m_perspective; } | 977 float perspective() const { return rareNonInheritedData->m_perspective; } |
| 966 bool hasPerspective() const { return rareNonInheritedData->m_perspective > 0 ; } | 978 bool hasPerspective() const { return rareNonInheritedData->m_perspective > 0 ; } |
| 967 const LengthPoint& perspectiveOrigin() const { return rareNonInheritedData-> m_perspectiveOrigin; } | 979 const LengthPoint& perspectiveOrigin() const { return rareNonInheritedData-> m_perspectiveOrigin; } |
| 968 const Length& perspectiveOriginX() const { return perspectiveOrigin().x(); } | 980 const Length& perspectiveOriginX() const { return perspectiveOrigin().x(); } |
| 969 const Length& perspectiveOriginY() const { return perspectiveOrigin().y(); } | 981 const Length& perspectiveOriginY() const { return perspectiveOrigin().y(); } |
| 970 const FloatSize& pageSize() const { return rareNonInheritedData->m_pageSize; } | 982 const FloatSize& pageSize() const { return rareNonInheritedData->m_pageSize; } |
| 971 PageSizeType getPageSizeType() const { return static_cast<PageSizeType>(rare NonInheritedData->m_pageSizeType); } | 983 PageSizeType getPageSizeType() const { return static_cast<PageSizeType>(rare NonInheritedData->m_pageSizeType); } |
| 972 | 984 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1020 ScrollSnapType getScrollSnapType() const { return static_cast<ScrollSnapType >(rareNonInheritedData->m_scrollSnapType); } | 1032 ScrollSnapType getScrollSnapType() const { return static_cast<ScrollSnapType >(rareNonInheritedData->m_scrollSnapType); } |
| 1021 const ScrollSnapPoints& scrollSnapPointsX() const { return rareNonInheritedD ata->m_scrollSnap->m_xPoints; } | 1033 const ScrollSnapPoints& scrollSnapPointsX() const { return rareNonInheritedD ata->m_scrollSnap->m_xPoints; } |
| 1022 const ScrollSnapPoints& scrollSnapPointsY() const { return rareNonInheritedD ata->m_scrollSnap->m_yPoints; } | 1034 const ScrollSnapPoints& scrollSnapPointsY() const { return rareNonInheritedD ata->m_scrollSnap->m_yPoints; } |
| 1023 const Vector<LengthPoint>& scrollSnapCoordinate() const { return rareNonInhe ritedData->m_scrollSnap->m_coordinates; } | 1035 const Vector<LengthPoint>& scrollSnapCoordinate() const { return rareNonInhe ritedData->m_scrollSnap->m_coordinates; } |
| 1024 const LengthPoint& scrollSnapDestination() const { return rareNonInheritedDa ta->m_scrollSnap->m_destination; } | 1036 const LengthPoint& scrollSnapDestination() const { return rareNonInheritedDa ta->m_scrollSnap->m_destination; } |
| 1025 | 1037 |
| 1026 const Vector<CSSPropertyID>& willChangeProperties() const { return rareNonIn heritedData->m_willChange->m_properties; } | 1038 const Vector<CSSPropertyID>& willChangeProperties() const { return rareNonIn heritedData->m_willChange->m_properties; } |
| 1027 bool willChangeContents() const { return rareNonInheritedData->m_willChange- >m_contents; } | 1039 bool willChangeContents() const { return rareNonInheritedData->m_willChange- >m_contents; } |
| 1028 bool willChangeScrollPosition() const { return rareNonInheritedData->m_willC hange->m_scrollPosition; } | 1040 bool willChangeScrollPosition() const { return rareNonInheritedData->m_willC hange->m_scrollPosition; } |
| 1029 bool hasWillChangeCompositingHint() const; | 1041 bool hasWillChangeCompositingHint() const; |
| 1042 bool hasWillChangeOpacityHint() const { return willChangeProperties().contai ns(CSSPropertyOpacity); } | |
| 1030 bool hasWillChangeTransformHint() const; | 1043 bool hasWillChangeTransformHint() const; |
| 1031 bool subtreeWillChangeContents() const { return rareInheritedData->m_subtree WillChangeContents; } | 1044 bool subtreeWillChangeContents() const { return rareInheritedData->m_subtree WillChangeContents; } |
| 1032 | 1045 |
| 1033 // attribute setter methods | 1046 // attribute setter methods |
| 1034 | 1047 |
| 1035 void setDisplay(EDisplay v) { noninherited_flags.effectiveDisplay = v; } | 1048 void setDisplay(EDisplay v) { noninherited_flags.effectiveDisplay = v; } |
| 1036 void setOriginalDisplay(EDisplay v) { noninherited_flags.originalDisplay = v ; } | 1049 void setOriginalDisplay(EDisplay v) { noninherited_flags.originalDisplay = v ; } |
| 1037 void setPosition(EPosition v) { noninherited_flags.position = v; } | 1050 void setPosition(EPosition v) { noninherited_flags.position = v; } |
| 1038 void setFloating(EFloat v) { noninherited_flags.floating = v; } | 1051 void setFloating(EFloat v) { noninherited_flags.floating = v; } |
| 1039 | 1052 |
| (...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2025 } | 2038 } |
| 2026 | 2039 |
| 2027 inline bool ComputedStyle::hasPseudoElementStyle() const | 2040 inline bool ComputedStyle::hasPseudoElementStyle() const |
| 2028 { | 2041 { |
| 2029 return noninherited_flags.pseudoBits & ElementPseudoIdMask; | 2042 return noninherited_flags.pseudoBits & ElementPseudoIdMask; |
| 2030 } | 2043 } |
| 2031 | 2044 |
| 2032 } // namespace blink | 2045 } // namespace blink |
| 2033 | 2046 |
| 2034 #endif // ComputedStyle_h | 2047 #endif // ComputedStyle_h |
| OLD | NEW |