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

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

Issue 2767783003: Incorporate ComputedStyle::hasTransform when diffing transform styles. (Closed)
Patch Set: Sync to head. Created 3 years, 9 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 3265 matching lines...) Expand 10 before | Expand all | Expand 10 after
3276 return hasTransformOperations() || hasOffset() || 3276 return hasTransformOperations() || hasOffset() ||
3277 hasCurrentTransformAnimation() || translate() || rotate() || scale(); 3277 hasCurrentTransformAnimation() || translate() || rotate() || scale();
3278 } 3278 }
3279 bool hasTransformOperations() const { 3279 bool hasTransformOperations() const {
3280 return !m_rareNonInheritedData->m_transform->m_operations.operations() 3280 return !m_rareNonInheritedData->m_transform->m_operations.operations()
3281 .isEmpty(); 3281 .isEmpty();
3282 } 3282 }
3283 ETransformStyle3D usedTransformStyle3D() const { 3283 ETransformStyle3D usedTransformStyle3D() const {
3284 return hasGroupingProperty() ? TransformStyle3DFlat : transformStyle3D(); 3284 return hasGroupingProperty() ? TransformStyle3DFlat : transformStyle3D();
3285 } 3285 }
3286 // Returns whether the transform operations for |otherStyle| differ from the
3287 // operations for this style instance. Note that callers may want to also
3288 // check hasTransform(), as it is possible for two styles to have matching
3289 // transform operations but differ in other transform-impacting style
3290 // respects.
3286 bool transformDataEquivalent(const ComputedStyle& otherStyle) const { 3291 bool transformDataEquivalent(const ComputedStyle& otherStyle) const {
3287 return m_rareNonInheritedData->m_transform == 3292 return m_rareNonInheritedData->m_transform ==
3288 otherStyle.m_rareNonInheritedData->m_transform; 3293 otherStyle.m_rareNonInheritedData->m_transform;
3289 } 3294 }
3290 bool preserves3D() const { 3295 bool preserves3D() const {
3291 return usedTransformStyle3D() != TransformStyle3DFlat; 3296 return usedTransformStyle3D() != TransformStyle3DFlat;
3292 } 3297 }
3293 enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin }; 3298 enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin };
3294 enum ApplyMotionPath { IncludeMotionPath, ExcludeMotionPath }; 3299 enum ApplyMotionPath { IncludeMotionPath, ExcludeMotionPath };
3295 enum ApplyIndependentTransformProperties { 3300 enum ApplyIndependentTransformProperties {
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
3689 const StyleImage*, 3694 const StyleImage*,
3690 const ComputedStyle& other) const; 3695 const ComputedStyle& other) const;
3691 bool diffNeedsVisualRectUpdate(const ComputedStyle& other) const; 3696 bool diffNeedsVisualRectUpdate(const ComputedStyle& other) const;
3692 void updatePropertySpecificDifferences(const ComputedStyle& other, 3697 void updatePropertySpecificDifferences(const ComputedStyle& other,
3693 StyleDifference&) const; 3698 StyleDifference&) const;
3694 3699
3695 static bool shadowListHasCurrentColor(const ShadowList*); 3700 static bool shadowListHasCurrentColor(const ShadowList*);
3696 3701
3697 StyleInheritedVariables& mutableInheritedVariables(); 3702 StyleInheritedVariables& mutableInheritedVariables();
3698 StyleNonInheritedVariables& mutableNonInheritedVariables(); 3703 StyleNonInheritedVariables& mutableNonInheritedVariables();
3704
3705 FRIEND_TEST_ALL_PREFIXES(
3706 ComputedStyleTest,
3707 UpdatePropertySpecificDifferencesRespectsTransformAnimation);
3699 }; 3708 };
3700 3709
3701 // FIXME: Reduce/remove the dependency on zoom adjusted int values. 3710 // FIXME: Reduce/remove the dependency on zoom adjusted int values.
3702 // The float or LayoutUnit versions of layout values should be used. 3711 // The float or LayoutUnit versions of layout values should be used.
3703 int adjustForAbsoluteZoom(int value, float zoomFactor); 3712 int adjustForAbsoluteZoom(int value, float zoomFactor);
3704 3713
3705 inline int adjustForAbsoluteZoom(int value, const ComputedStyle* style) { 3714 inline int adjustForAbsoluteZoom(int value, const ComputedStyle* style) {
3706 float zoomFactor = style->effectiveZoom(); 3715 float zoomFactor = style->effectiveZoom();
3707 if (zoomFactor == 1) 3716 if (zoomFactor == 1)
3708 return value; 3717 return value;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
3784 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId); 3793 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId);
3785 } 3794 }
3786 3795
3787 inline bool ComputedStyle::hasPseudoElementStyle() const { 3796 inline bool ComputedStyle::hasPseudoElementStyle() const {
3788 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 3797 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
3789 } 3798 }
3790 3799
3791 } // namespace blink 3800 } // namespace blink
3792 3801
3793 #endif // ComputedStyle_h 3802 #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