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

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

Issue 2785343002: Use getters for StyleSurroundData members in ComputedStyle.cpp (Closed)
Patch Set: Rebase Created 3 years, 8 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 2811 matching lines...) Expand 10 before | Expand all | Expand 10 after
2822 return IsHorizontalWritingMode() ? MaxHeight() : MaxWidth(); 2822 return IsHorizontalWritingMode() ? MaxHeight() : MaxWidth();
2823 } 2823 }
2824 const Length& LogicalMinWidth() const { 2824 const Length& LogicalMinWidth() const {
2825 return IsHorizontalWritingMode() ? MinWidth() : MinHeight(); 2825 return IsHorizontalWritingMode() ? MinWidth() : MinHeight();
2826 } 2826 }
2827 const Length& LogicalMinHeight() const { 2827 const Length& LogicalMinHeight() const {
2828 return IsHorizontalWritingMode() ? MinHeight() : MinWidth(); 2828 return IsHorizontalWritingMode() ? MinHeight() : MinWidth();
2829 } 2829 }
2830 2830
2831 // Margin utility functions. 2831 // Margin utility functions.
2832 bool HasMargin() const { return surround_->margin_.NonZero(); } 2832 bool HasMargin() const { return Margin().NonZero(); }
2833 bool HasMarginBeforeQuirk() const { return MarginBefore().Quirk(); } 2833 bool HasMarginBeforeQuirk() const { return MarginBefore().Quirk(); }
2834 bool HasMarginAfterQuirk() const { return MarginAfter().Quirk(); } 2834 bool HasMarginAfterQuirk() const { return MarginAfter().Quirk(); }
2835 const LengthBox& Margin() const { return surround_->margin_; } 2835 const LengthBox& Margin() const { return surround_->margin_; }
2836 const Length& MarginBefore() const { 2836 const Length& MarginBefore() const {
2837 return surround_->margin_.Before(GetWritingMode()); 2837 return Margin().Before(GetWritingMode());
2838 } 2838 }
2839 const Length& MarginAfter() const { 2839 const Length& MarginAfter() const { return Margin().After(GetWritingMode()); }
2840 return surround_->margin_.After(GetWritingMode());
2841 }
2842 const Length& MarginStart() const { 2840 const Length& MarginStart() const {
2843 return surround_->margin_.Start(GetWritingMode(), Direction()); 2841 return Margin().Start(GetWritingMode(), Direction());
2844 } 2842 }
2845 const Length& MarginEnd() const { 2843 const Length& MarginEnd() const {
2846 return surround_->margin_.end(GetWritingMode(), Direction()); 2844 return Margin().end(GetWritingMode(), Direction());
2847 } 2845 }
2848 const Length& MarginOver() const { 2846 const Length& MarginOver() const { return Margin().Over(GetWritingMode()); }
2849 return surround_->margin_.Over(GetWritingMode()); 2847 const Length& MarginUnder() const { return Margin().Under(GetWritingMode()); }
2850 }
2851 const Length& MarginUnder() const {
2852 return surround_->margin_.Under(GetWritingMode());
2853 }
2854 const Length& MarginStartUsing(const ComputedStyle* other_style) const { 2848 const Length& MarginStartUsing(const ComputedStyle* other_style) const {
2855 return surround_->margin_.Start(other_style->GetWritingMode(), 2849 return Margin().Start(other_style->GetWritingMode(),
2856 other_style->Direction()); 2850 other_style->Direction());
2857 } 2851 }
2858 const Length& MarginEndUsing(const ComputedStyle* other_style) const { 2852 const Length& MarginEndUsing(const ComputedStyle* other_style) const {
2859 return surround_->margin_.end(other_style->GetWritingMode(), 2853 return Margin().end(other_style->GetWritingMode(),
2860 other_style->Direction()); 2854 other_style->Direction());
2861 } 2855 }
2862 const Length& MarginBeforeUsing(const ComputedStyle* other_style) const { 2856 const Length& MarginBeforeUsing(const ComputedStyle* other_style) const {
2863 return surround_->margin_.Before(other_style->GetWritingMode()); 2857 return Margin().Before(other_style->GetWritingMode());
2864 } 2858 }
2865 const Length& MarginAfterUsing(const ComputedStyle* other_style) const { 2859 const Length& MarginAfterUsing(const ComputedStyle* other_style) const {
2866 return surround_->margin_.After(other_style->GetWritingMode()); 2860 return Margin().After(other_style->GetWritingMode());
2867 } 2861 }
2868 void SetMarginStart(const Length&); 2862 void SetMarginStart(const Length&);
2869 void SetMarginEnd(const Length&); 2863 void SetMarginEnd(const Length&);
2870 2864
2871 // Padding utility functions. 2865 // Padding utility functions.
2872 const LengthBox& Padding() const { return surround_->padding_; } 2866 const LengthBox& Padding() const { return surround_->padding_; }
2873 const Length& PaddingBefore() const { 2867 const Length& PaddingBefore() const {
2874 return surround_->padding_.Before(GetWritingMode()); 2868 return Padding().Before(GetWritingMode());
2875 } 2869 }
2876 const Length& PaddingAfter() const { 2870 const Length& PaddingAfter() const {
2877 return surround_->padding_.After(GetWritingMode()); 2871 return Padding().After(GetWritingMode());
2878 } 2872 }
2879 const Length& PaddingStart() const { 2873 const Length& PaddingStart() const {
2880 return surround_->padding_.Start(GetWritingMode(), Direction()); 2874 return Padding().Start(GetWritingMode(), Direction());
2881 } 2875 }
2882 const Length& PaddingEnd() const { 2876 const Length& PaddingEnd() const {
2883 return surround_->padding_.end(GetWritingMode(), Direction()); 2877 return Padding().end(GetWritingMode(), Direction());
2884 } 2878 }
2885 const Length& PaddingOver() const { 2879 const Length& PaddingOver() const { return Padding().Over(GetWritingMode()); }
2886 return surround_->padding_.Over(GetWritingMode()); 2880 const Length& PaddingUnder() const {
2881 return Padding().Under(GetWritingMode());
2887 } 2882 }
2888 const Length& PaddingUnder() const { 2883 bool HasPadding() const { return Padding().NonZero(); }
2889 return surround_->padding_.Under(GetWritingMode());
2890 }
2891 bool HasPadding() const { return surround_->padding_.NonZero(); }
2892 void ResetPadding() { SET_VAR(surround_, padding_, LengthBox(kFixed)); } 2884 void ResetPadding() { SET_VAR(surround_, padding_, LengthBox(kFixed)); }
2893 void SetPadding(const LengthBox& b) { SET_VAR(surround_, padding_, b); } 2885 void SetPadding(const LengthBox& b) { SET_VAR(surround_, padding_, b); }
2894 2886
2895 // Border utility functions 2887 // Border utility functions
2896 LayoutRectOutsets ImageOutsets(const NinePieceImage&) const; 2888 LayoutRectOutsets ImageOutsets(const NinePieceImage&) const;
2897 bool HasBorderImageOutsets() const { 2889 bool HasBorderImageOutsets() const {
2898 return BorderImage().HasImage() && BorderImage().Outset().NonZero(); 2890 return BorderImage().HasImage() && BorderImage().Outset().NonZero();
2899 } 2891 }
2900 LayoutRectOutsets BorderImageOutsets() const { 2892 LayoutRectOutsets BorderImageOutsets() const {
2901 return ImageOutsets(BorderImage()); 2893 return ImageOutsets(BorderImage());
2902 } 2894 }
2903 bool BorderImageSlicesFill() const { 2895 bool BorderImageSlicesFill() const { return Border().GetImage().Fill(); }
2904 return surround_->border_.GetImage().Fill();
2905 }
2906 2896
2907 void SetBorderImageSlicesFill(bool); 2897 void SetBorderImageSlicesFill(bool);
2908 const BorderData& Border() const { return surround_->border_; } 2898 const BorderData& Border() const { return surround_->border_; }
2909 const BorderValue& BorderLeft() const { return surround_->border_.Left(); } 2899 const BorderValue& BorderLeft() const { return surround_->border_.Left(); }
2910 const BorderValue& BorderRight() const { return surround_->border_.Right(); } 2900 const BorderValue& BorderRight() const { return surround_->border_.Right(); }
2911 const BorderValue& BorderTop() const { return surround_->border_.Top(); } 2901 const BorderValue& BorderTop() const { return surround_->border_.Top(); }
2912 const BorderValue& BorderBottom() const { 2902 const BorderValue& BorderBottom() const {
2913 return surround_->border_.Bottom(); 2903 return surround_->border_.Bottom();
2914 } 2904 }
2915 const BorderValue& BorderBefore() const; 2905 const BorderValue& BorderBefore() const;
2916 const BorderValue& BorderAfter() const; 2906 const BorderValue& BorderAfter() const;
2917 const BorderValue& BorderStart() const; 2907 const BorderValue& BorderStart() const;
2918 const BorderValue& BorderEnd() const; 2908 const BorderValue& BorderEnd() const;
2919 float BorderAfterWidth() const; 2909 float BorderAfterWidth() const;
2920 float BorderBeforeWidth() const; 2910 float BorderBeforeWidth() const;
2921 float BorderEndWidth() const; 2911 float BorderEndWidth() const;
2922 float BorderStartWidth() const; 2912 float BorderStartWidth() const;
2923 float BorderOverWidth() const; 2913 float BorderOverWidth() const;
2924 float BorderUnderWidth() const; 2914 float BorderUnderWidth() const;
2925 2915
2926 bool HasBorderFill() const { return surround_->border_.HasBorderFill(); } 2916 bool HasBorderFill() const { return Border().HasBorderFill(); }
2927 bool HasBorder() const { return surround_->border_.HasBorder(); } 2917 bool HasBorder() const { return Border().HasBorder(); }
2928 bool HasBorderDecoration() const { return HasBorder() || HasBorderFill(); } 2918 bool HasBorderDecoration() const { return HasBorder() || HasBorderFill(); }
2929 bool HasBorderRadius() const { return surround_->border_.HasBorderRadius(); } 2919 bool HasBorderRadius() const { return Border().HasBorderRadius(); }
2930 2920
2931 void ResetBorder() { 2921 void ResetBorder() {
2932 ResetBorderImage(); 2922 ResetBorderImage();
2933 ResetBorderTop(); 2923 ResetBorderTop();
2934 ResetBorderRight(); 2924 ResetBorderRight();
2935 ResetBorderBottom(); 2925 ResetBorderBottom();
2936 ResetBorderLeft(); 2926 ResetBorderLeft();
2937 ResetBorderTopLeftRadius(); 2927 ResetBorderTopLeftRadius();
2938 ResetBorderTopRightRadius(); 2928 ResetBorderTopRightRadius();
2939 ResetBorderBottomLeftRadius(); 2929 ResetBorderBottomLeftRadius();
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
3713 pseudo_bits_ |= 1 << (pseudo - kFirstPublicPseudoId); 3703 pseudo_bits_ |= 1 << (pseudo - kFirstPublicPseudoId);
3714 } 3704 }
3715 3705
3716 inline bool ComputedStyle::HasPseudoElementStyle() const { 3706 inline bool ComputedStyle::HasPseudoElementStyle() const {
3717 return pseudo_bits_ & kElementPseudoIdMask; 3707 return pseudo_bits_ & kElementPseudoIdMask;
3718 } 3708 }
3719 3709
3720 } // namespace blink 3710 } // namespace blink
3721 3711
3722 #endif // ComputedStyle_h 3712 #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