Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.h

Issue 2888703002: Revert "Incorporate ComputedStyle::hasTransform when diffing transform styles." (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 3300 matching lines...) Expand 10 before | Expand all | Expand 10 after
3311 return hasTransformOperations() || hasOffset() || 3311 return hasTransformOperations() || hasOffset() ||
3312 hasCurrentTransformAnimation() || translate() || rotate() || scale(); 3312 hasCurrentTransformAnimation() || translate() || rotate() || scale();
3313 } 3313 }
3314 bool hasTransformOperations() const { 3314 bool hasTransformOperations() const {
3315 return !m_rareNonInheritedData->m_transform->m_operations.operations() 3315 return !m_rareNonInheritedData->m_transform->m_operations.operations()
3316 .isEmpty(); 3316 .isEmpty();
3317 } 3317 }
3318 ETransformStyle3D usedTransformStyle3D() const { 3318 ETransformStyle3D usedTransformStyle3D() const {
3319 return hasGroupingProperty() ? TransformStyle3DFlat : transformStyle3D(); 3319 return hasGroupingProperty() ? TransformStyle3DFlat : transformStyle3D();
3320 } 3320 }
3321 // Returns whether the transform operations for |otherStyle| differ from the
3322 // operations for this style instance. Note that callers may want to also
3323 // check hasTransform(), as it is possible for two styles to have matching
3324 // transform operations but differ in other transform-impacting style
3325 // respects.
3326 bool transformDataEquivalent(const ComputedStyle& otherStyle) const { 3321 bool transformDataEquivalent(const ComputedStyle& otherStyle) const {
3327 return m_rareNonInheritedData->m_transform == 3322 return m_rareNonInheritedData->m_transform ==
3328 otherStyle.m_rareNonInheritedData->m_transform; 3323 otherStyle.m_rareNonInheritedData->m_transform;
3329 } 3324 }
3330 bool preserves3D() const { 3325 bool preserves3D() const {
3331 return usedTransformStyle3D() != TransformStyle3DFlat; 3326 return usedTransformStyle3D() != TransformStyle3DFlat;
3332 } 3327 }
3333 enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin }; 3328 enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin };
3334 enum ApplyMotionPath { IncludeMotionPath, ExcludeMotionPath }; 3329 enum ApplyMotionPath { IncludeMotionPath, ExcludeMotionPath };
3335 enum ApplyIndependentTransformProperties { 3330 enum ApplyIndependentTransformProperties {
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
3726 const StyleImage*, 3721 const StyleImage*,
3727 const ComputedStyle& other) const; 3722 const ComputedStyle& other) const;
3728 bool diffNeedsPaintInvalidationSelection(const ComputedStyle& other) const; 3723 bool diffNeedsPaintInvalidationSelection(const ComputedStyle& other) const;
3729 void updatePropertySpecificDifferences(const ComputedStyle& other, 3724 void updatePropertySpecificDifferences(const ComputedStyle& other,
3730 StyleDifference&) const; 3725 StyleDifference&) const;
3731 3726
3732 static bool shadowListHasCurrentColor(const ShadowList*); 3727 static bool shadowListHasCurrentColor(const ShadowList*);
3733 3728
3734 StyleInheritedVariables& mutableInheritedVariables(); 3729 StyleInheritedVariables& mutableInheritedVariables();
3735 StyleNonInheritedVariables& mutableNonInheritedVariables(); 3730 StyleNonInheritedVariables& mutableNonInheritedVariables();
3736
3737 FRIEND_TEST_ALL_PREFIXES(
3738 ComputedStyleTest,
3739 UpdatePropertySpecificDifferencesRespectsTransformAnimation);
3740 }; 3731 };
3741 3732
3742 // FIXME: Reduce/remove the dependency on zoom adjusted int values. 3733 // FIXME: Reduce/remove the dependency on zoom adjusted int values.
3743 // The float or LayoutUnit versions of layout values should be used. 3734 // The float or LayoutUnit versions of layout values should be used.
3744 int adjustForAbsoluteZoom(int value, float zoomFactor); 3735 int adjustForAbsoluteZoom(int value, float zoomFactor);
3745 3736
3746 inline int adjustForAbsoluteZoom(int value, const ComputedStyle* style) { 3737 inline int adjustForAbsoluteZoom(int value, const ComputedStyle* style) {
3747 float zoomFactor = style->effectiveZoom(); 3738 float zoomFactor = style->effectiveZoom();
3748 if (zoomFactor == 1) 3739 if (zoomFactor == 1)
3749 return value; 3740 return value;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
3824 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); 3815 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1);
3825 } 3816 }
3826 3817
3827 inline bool ComputedStyle::hasPseudoElementStyle() const { 3818 inline bool ComputedStyle::hasPseudoElementStyle() const {
3828 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 3819 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
3829 } 3820 }
3830 3821
3831 } // namespace blink 3822 } // namespace blink
3832 3823
3833 #endif // ComputedStyle_h 3824 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerTest.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698