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 | 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 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1289 return rare_non_inherited_data_->outline_.Offset(); | 1289 return rare_non_inherited_data_->outline_.Offset(); |
1290 } | 1290 } |
1291 void SetOutlineOffset(int v) { | 1291 void SetOutlineOffset(int v) { |
1292 SET_VAR(rare_non_inherited_data_, outline_.offset_, v); | 1292 SET_VAR(rare_non_inherited_data_, outline_.offset_, v); |
1293 } | 1293 } |
1294 | 1294 |
1295 // Padding properties. | 1295 // Padding properties. |
1296 | 1296 |
1297 // padding-bottom | 1297 // padding-bottom |
1298 static Length InitialPaddingBottom() { return Length(kFixed); } | 1298 static Length InitialPaddingBottom() { return Length(kFixed); } |
1299 const Length& PaddingBottom() const { return surround_->padding_.Bottom(); } | 1299 const Length& PaddingBottom() const { return surround_->padding_bottom_; } |
1300 void SetPaddingBottom(const Length& v) { | 1300 void SetPaddingBottom(const Length& v) { |
1301 SET_VAR(surround_, padding_.bottom_, v); | 1301 SET_VAR(surround_, padding_bottom_, v); |
1302 } | 1302 } |
1303 | 1303 |
1304 // padding-left | 1304 // padding-left |
1305 static Length InitialPaddingLeft() { return Length(kFixed); } | 1305 static Length InitialPaddingLeft() { return Length(kFixed); } |
1306 const Length& PaddingLeft() const { return surround_->padding_.Left(); } | 1306 const Length& PaddingLeft() const { return surround_->padding_left_; } |
1307 void SetPaddingLeft(const Length& v) { | 1307 void SetPaddingLeft(const Length& v) { SET_VAR(surround_, padding_left_, v); } |
1308 SET_VAR(surround_, padding_.left_, v); | |
1309 } | |
1310 | 1308 |
1311 // padding-right | 1309 // padding-right |
1312 static Length InitialPaddingRight() { return Length(kFixed); } | 1310 static Length InitialPaddingRight() { return Length(kFixed); } |
1313 const Length& PaddingRight() const { return surround_->padding_.Right(); } | 1311 const Length& PaddingRight() const { return surround_->padding_right_; } |
1314 void SetPaddingRight(const Length& v) { | 1312 void SetPaddingRight(const Length& v) { |
1315 SET_VAR(surround_, padding_.right_, v); | 1313 SET_VAR(surround_, padding_right_, v); |
1316 } | 1314 } |
1317 | 1315 |
1318 // padding-top | 1316 // padding-top |
1319 static Length InitialPaddingTop() { return Length(kFixed); } | 1317 static Length InitialPaddingTop() { return Length(kFixed); } |
1320 const Length& PaddingTop() const { return surround_->padding_.Top(); } | 1318 const Length& PaddingTop() const { return surround_->padding_top_; } |
1321 void SetPaddingTop(const Length& v) { SET_VAR(surround_, padding_.top_, v); } | 1319 void SetPaddingTop(const Length& v) { SET_VAR(surround_, padding_top_, v); } |
1322 | 1320 |
1323 // perspective (aka -webkit-perspective) | 1321 // perspective (aka -webkit-perspective) |
1324 static float InitialPerspective() { return 0; } | 1322 static float InitialPerspective() { return 0; } |
1325 float Perspective() const { return rare_non_inherited_data_->perspective_; } | 1323 float Perspective() const { return rare_non_inherited_data_->perspective_; } |
1326 void SetPerspective(float p) { | 1324 void SetPerspective(float p) { |
1327 SET_VAR(rare_non_inherited_data_, perspective_, p); | 1325 SET_VAR(rare_non_inherited_data_, perspective_, p); |
1328 } | 1326 } |
1329 | 1327 |
1330 // perspective-origin (aka -webkit-perspective-origin) | 1328 // perspective-origin (aka -webkit-perspective-origin) |
1331 static LengthPoint InitialPerspectiveOrigin() { | 1329 static LengthPoint InitialPerspectiveOrigin() { |
(...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2870 void SetMarginStart(const Length&); | 2868 void SetMarginStart(const Length&); |
2871 void SetMarginEnd(const Length&); | 2869 void SetMarginEnd(const Length&); |
2872 bool MarginEqual(const ComputedStyle& other) const { | 2870 bool MarginEqual(const ComputedStyle& other) const { |
2873 return MarginTop() == other.MarginTop() && | 2871 return MarginTop() == other.MarginTop() && |
2874 MarginLeft() == other.MarginLeft() && | 2872 MarginLeft() == other.MarginLeft() && |
2875 MarginRight() == other.MarginRight() && | 2873 MarginRight() == other.MarginRight() && |
2876 MarginBottom() == other.MarginBottom(); | 2874 MarginBottom() == other.MarginBottom(); |
2877 } | 2875 } |
2878 | 2876 |
2879 // Padding utility functions. | 2877 // Padding utility functions. |
2880 const LengthBox& Padding() const { return surround_->padding_; } | |
2881 const Length& PaddingBefore() const { | 2878 const Length& PaddingBefore() const { |
2882 return Padding().Before(GetWritingMode()); | 2879 return LengthBox::Before(GetWritingMode(), PaddingTop(), PaddingLeft(), |
2880 PaddingRight()); | |
2883 } | 2881 } |
2884 const Length& PaddingAfter() const { | 2882 const Length& PaddingAfter() const { |
2885 return Padding().After(GetWritingMode()); | 2883 return LengthBox::After(GetWritingMode(), PaddingBottom(), PaddingLeft(), |
2884 PaddingRight()); | |
2886 } | 2885 } |
2887 const Length& PaddingStart() const { | 2886 const Length& PaddingStart() const { |
2888 return Padding().Start(GetWritingMode(), Direction()); | 2887 return LengthBox::Start(GetWritingMode(), Direction(), PaddingTop(), |
2888 PaddingLeft(), PaddingRight(), PaddingBottom()); | |
2889 } | 2889 } |
2890 const Length& PaddingEnd() const { | 2890 const Length& PaddingEnd() const { |
2891 return Padding().end(GetWritingMode(), Direction()); | 2891 return LengthBox::End(GetWritingMode(), Direction(), PaddingTop(), |
2892 PaddingLeft(), PaddingRight(), PaddingBottom()); | |
2892 } | 2893 } |
2893 const Length& PaddingOver() const { return Padding().Over(GetWritingMode()); } | 2894 const Length& PaddingOver() const { |
2895 return LengthBox::Over(GetWritingMode(), PaddingTop(), PaddingRight()); | |
2896 } | |
2894 const Length& PaddingUnder() const { | 2897 const Length& PaddingUnder() const { |
2895 return Padding().Under(GetWritingMode()); | 2898 return LengthBox::Under(GetWritingMode(), PaddingBottom(), PaddingLeft()); |
2896 } | 2899 } |
2897 bool HasPadding() const { return Padding().NonZero(); } | 2900 bool HasPadding() const { |
2898 void ResetPadding() { SET_VAR(surround_, padding_, LengthBox(kFixed)); } | 2901 return !PaddingLeft().IsZero() || !PaddingRight().IsZero() || |
2899 void SetPadding(const LengthBox& b) { SET_VAR(surround_, padding_, b); } | 2902 !PaddingTop().IsZero() || !PaddingBottom().IsZero(); |
2903 } | |
2904 void ResetPadding() { | |
2905 SET_VAR(surround_, padding_top_, kFixed); | |
2906 SET_VAR(surround_, padding_bottom_, kFixed); | |
2907 SET_VAR(surround_, padding_left_, kFixed); | |
2908 SET_VAR(surround_, padding_right_, kFixed); | |
2909 } | |
2910 void SetPadding(const LengthBox& b) { | |
2911 SET_VAR(surround_, padding_top_, b.top_); | |
2912 SET_VAR(surround_, padding_bottom_, b.bottom_); | |
2913 SET_VAR(surround_, padding_left_, b.left_); | |
2914 SET_VAR(surround_, padding_right_, b.right_); | |
2915 } | |
2916 bool PaddingEqual(const ComputedStyle& other) const { | |
2917 return PaddingTop() == other.PaddingTop() && | |
shend
2017/04/20 07:07:20
nit: could be: PaddingEqual(other.Padding());
nainar
2017/04/20 07:13:09
How about I delete this and pass other.Padding() d
shend
2017/04/20 07:20:56
If you want.
nainar
2017/04/21 00:15:19
Retaining as is because both the option shend@ and
| |
2918 PaddingLeft() == other.PaddingLeft() && | |
2919 PaddingRight() == other.PaddingRight() && | |
2920 PaddingBottom() == other.PaddingBottom(); | |
2921 } | |
2922 bool PaddingEqual(const LengthBox& other) const { | |
2923 return PaddingTop() == other.Top() && PaddingLeft() == other.Left() && | |
2924 PaddingRight() == other.Right() && PaddingBottom() == other.Bottom(); | |
2925 } | |
2900 | 2926 |
2901 // Border utility functions | 2927 // Border utility functions |
2902 LayoutRectOutsets ImageOutsets(const NinePieceImage&) const; | 2928 LayoutRectOutsets ImageOutsets(const NinePieceImage&) const; |
2903 bool HasBorderImageOutsets() const { | 2929 bool HasBorderImageOutsets() const { |
2904 return BorderImage().HasImage() && BorderImage().Outset().NonZero(); | 2930 return BorderImage().HasImage() && BorderImage().Outset().NonZero(); |
2905 } | 2931 } |
2906 LayoutRectOutsets BorderImageOutsets() const { | 2932 LayoutRectOutsets BorderImageOutsets() const { |
2907 return ImageOutsets(BorderImage()); | 2933 return ImageOutsets(BorderImage()); |
2908 } | 2934 } |
2909 bool BorderImageSlicesFill() const { return Border().GetImage().Fill(); } | 2935 bool BorderImageSlicesFill() const { return Border().GetImage().Fill(); } |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3717 pseudo_bits_ |= 1 << (pseudo - kFirstPublicPseudoId); | 3743 pseudo_bits_ |= 1 << (pseudo - kFirstPublicPseudoId); |
3718 } | 3744 } |
3719 | 3745 |
3720 inline bool ComputedStyle::HasPseudoElementStyle() const { | 3746 inline bool ComputedStyle::HasPseudoElementStyle() const { |
3721 return pseudo_bits_ & kElementPseudoIdMask; | 3747 return pseudo_bits_ & kElementPseudoIdMask; |
3722 } | 3748 } |
3723 | 3749 |
3724 } // namespace blink | 3750 } // namespace blink |
3725 | 3751 |
3726 #endif // ComputedStyle_h | 3752 #endif // ComputedStyle_h |
OLD | NEW |