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

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

Issue 2905793002: Replace pointers in ComputedStyle::*DataEquivalent functions with refs. (Closed)
Patch Set: Rebase Created 3 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2258 matching lines...) Expand 10 before | Expand all | Expand 10 after
2269 // Flex utility functions. 2269 // Flex utility functions.
2270 bool IsColumnFlexDirection() const { 2270 bool IsColumnFlexDirection() const {
2271 return FlexDirection() == kFlowColumn || 2271 return FlexDirection() == kFlowColumn ||
2272 FlexDirection() == kFlowColumnReverse; 2272 FlexDirection() == kFlowColumnReverse;
2273 } 2273 }
2274 bool IsReverseFlexDirection() const { 2274 bool IsReverseFlexDirection() const {
2275 return FlexDirection() == kFlowRowReverse || 2275 return FlexDirection() == kFlowRowReverse ||
2276 FlexDirection() == kFlowColumnReverse; 2276 FlexDirection() == kFlowColumnReverse;
2277 } 2277 }
2278 bool HasBoxReflect() const { return BoxReflect(); } 2278 bool HasBoxReflect() const { return BoxReflect(); }
2279 bool ReflectionDataEquivalent(const ComputedStyle* other_style) const { 2279 bool ReflectionDataEquivalent(const ComputedStyle& other) const {
2280 return rare_non_inherited_data_->ReflectionDataEquivalent( 2280 return rare_non_inherited_data_->ReflectionDataEquivalent(
2281 *other_style->rare_non_inherited_data_); 2281 *other.rare_non_inherited_data_);
2282 } 2282 }
2283 2283
2284 // Mask utility functions. 2284 // Mask utility functions.
2285 bool HasMask() const { 2285 bool HasMask() const {
2286 return rare_non_inherited_data_->mask_.HasImage() || 2286 return rare_non_inherited_data_->mask_.HasImage() ||
2287 rare_non_inherited_data_->mask_box_image_.HasImage(); 2287 rare_non_inherited_data_->mask_box_image_.HasImage();
2288 } 2288 }
2289 StyleImage* MaskImage() const { 2289 StyleImage* MaskImage() const {
2290 return rare_non_inherited_data_->mask_.GetImage(); 2290 return rare_non_inherited_data_->mask_.GetImage();
2291 } 2291 }
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
3050 return Top().IsAuto() && Bottom().IsAuto(); 3050 return Top().IsAuto() && Bottom().IsAuto();
3051 } 3051 }
3052 bool HasStaticInlinePosition(bool horizontal) const { 3052 bool HasStaticInlinePosition(bool horizontal) const {
3053 return horizontal ? HasAutoLeftAndRight() : HasAutoTopAndBottom(); 3053 return horizontal ? HasAutoLeftAndRight() : HasAutoTopAndBottom();
3054 } 3054 }
3055 bool HasStaticBlockPosition(bool horizontal) const { 3055 bool HasStaticBlockPosition(bool horizontal) const {
3056 return horizontal ? HasAutoTopAndBottom() : HasAutoLeftAndRight(); 3056 return horizontal ? HasAutoTopAndBottom() : HasAutoLeftAndRight();
3057 } 3057 }
3058 3058
3059 // Content utility functions. 3059 // Content utility functions.
3060 bool ContentDataEquivalent(const ComputedStyle* other_style) const { 3060 bool ContentDataEquivalent(const ComputedStyle& other) const {
3061 return const_cast<ComputedStyle*>(this) 3061 return rare_non_inherited_data_->ContentDataEquivalent(
3062 ->rare_non_inherited_data_->ContentDataEquivalent( 3062 *other.rare_non_inherited_data_);
3063 *const_cast<ComputedStyle*>(other_style)->rare_non_inherited_data_);
3064 } 3063 }
3065 3064
3066 // Contain utility functions. 3065 // Contain utility functions.
3067 bool ContainsPaint() const { 3066 bool ContainsPaint() const {
3068 return rare_non_inherited_data_->contain_ & kContainsPaint; 3067 return rare_non_inherited_data_->contain_ & kContainsPaint;
3069 } 3068 }
3070 bool ContainsStyle() const { 3069 bool ContainsStyle() const {
3071 return rare_non_inherited_data_->contain_ & kContainsStyle; 3070 return rare_non_inherited_data_->contain_ & kContainsStyle;
3072 } 3071 }
3073 bool ContainsLayout() const { 3072 bool ContainsLayout() const {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
3176 .IsEmpty(); 3175 .IsEmpty();
3177 } 3176 }
3178 ETransformStyle3D UsedTransformStyle3D() const { 3177 ETransformStyle3D UsedTransformStyle3D() const {
3179 return HasGroupingProperty() ? kTransformStyle3DFlat : TransformStyle3D(); 3178 return HasGroupingProperty() ? kTransformStyle3DFlat : TransformStyle3D();
3180 } 3179 }
3181 // Returns whether the transform operations for |otherStyle| differ from the 3180 // Returns whether the transform operations for |otherStyle| differ from the
3182 // operations for this style instance. Note that callers may want to also 3181 // operations for this style instance. Note that callers may want to also
3183 // check hasTransform(), as it is possible for two styles to have matching 3182 // check hasTransform(), as it is possible for two styles to have matching
3184 // transform operations but differ in other transform-impacting style 3183 // transform operations but differ in other transform-impacting style
3185 // respects. 3184 // respects.
3186 bool TransformDataEquivalent(const ComputedStyle& other_style) const { 3185 bool TransformDataEquivalent(const ComputedStyle& other) const {
3187 return rare_non_inherited_data_->transform_ == 3186 return rare_non_inherited_data_->transform_ ==
3188 other_style.rare_non_inherited_data_->transform_; 3187 other.rare_non_inherited_data_->transform_;
3189 } 3188 }
3190 bool Preserves3D() const { 3189 bool Preserves3D() const {
3191 return UsedTransformStyle3D() != kTransformStyle3DFlat; 3190 return UsedTransformStyle3D() != kTransformStyle3DFlat;
3192 } 3191 }
3193 enum ApplyTransformOrigin { 3192 enum ApplyTransformOrigin {
3194 kIncludeTransformOrigin, 3193 kIncludeTransformOrigin,
3195 kExcludeTransformOrigin 3194 kExcludeTransformOrigin
3196 }; 3195 };
3197 enum ApplyMotionPath { kIncludeMotionPath, kExcludeMotionPath }; 3196 enum ApplyMotionPath { kIncludeMotionPath, kExcludeMotionPath };
3198 enum ApplyIndependentTransformProperties { 3197 enum ApplyIndependentTransformProperties {
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
3745 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3744 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3746 } 3745 }
3747 3746
3748 inline bool ComputedStyle::HasPseudoElementStyle() const { 3747 inline bool ComputedStyle::HasPseudoElementStyle() const {
3749 return PseudoBitsInternal() & kElementPseudoIdMask; 3748 return PseudoBitsInternal() & kElementPseudoIdMask;
3750 } 3749 }
3751 3750
3752 } // namespace blink 3751 } // namespace blink
3753 3752
3754 #endif // ComputedStyle_h 3753 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698