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

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

Issue 2911403002: Rename StyleRareNonInheritedData members. (Closed)
Patch Set: 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 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 void SetIsolation(EIsolation v) { 1027 void SetIsolation(EIsolation v) {
1028 rare_non_inherited_data_.Access()->isolation_ = v; 1028 rare_non_inherited_data_.Access()->isolation_ = v;
1029 } 1029 }
1030 1030
1031 // -webkit-margin-before-collapse (aka -webkit-margin-top-collapse) 1031 // -webkit-margin-before-collapse (aka -webkit-margin-top-collapse)
1032 static EMarginCollapse InitialMarginBeforeCollapse() { 1032 static EMarginCollapse InitialMarginBeforeCollapse() {
1033 return kMarginCollapseCollapse; 1033 return kMarginCollapseCollapse;
1034 } 1034 }
1035 EMarginCollapse MarginAfterCollapse() const { 1035 EMarginCollapse MarginAfterCollapse() const {
1036 return static_cast<EMarginCollapse>( 1036 return static_cast<EMarginCollapse>(
1037 rare_non_inherited_data_->margin_after_collapse); 1037 rare_non_inherited_data_->margin_after_collapse_);
1038 } 1038 }
1039 void SetMarginBeforeCollapse(EMarginCollapse c) { 1039 void SetMarginBeforeCollapse(EMarginCollapse c) {
1040 SET_VAR(rare_non_inherited_data_, margin_before_collapse, c); 1040 SET_VAR(rare_non_inherited_data_, margin_before_collapse_, c);
1041 } 1041 }
1042 1042
1043 // -webkit-margin-after-collapse (aka -webkit-margin-bottom-collapse) 1043 // -webkit-margin-after-collapse (aka -webkit-margin-bottom-collapse)
1044 static EMarginCollapse InitialMarginAfterCollapse() { 1044 static EMarginCollapse InitialMarginAfterCollapse() {
1045 return kMarginCollapseCollapse; 1045 return kMarginCollapseCollapse;
1046 } 1046 }
1047 EMarginCollapse MarginBeforeCollapse() const { 1047 EMarginCollapse MarginBeforeCollapse() const {
1048 return static_cast<EMarginCollapse>( 1048 return static_cast<EMarginCollapse>(
1049 rare_non_inherited_data_->margin_before_collapse); 1049 rare_non_inherited_data_->margin_before_collapse_);
1050 } 1050 }
1051 void SetMarginAfterCollapse(EMarginCollapse c) { 1051 void SetMarginAfterCollapse(EMarginCollapse c) {
1052 SET_VAR(rare_non_inherited_data_, margin_after_collapse, c); 1052 SET_VAR(rare_non_inherited_data_, margin_after_collapse_, c);
1053 } 1053 }
1054 1054
1055 // mix-blend-mode 1055 // mix-blend-mode
1056 static WebBlendMode InitialBlendMode() { return kWebBlendModeNormal; } 1056 static WebBlendMode InitialBlendMode() { return kWebBlendModeNormal; }
1057 WebBlendMode BlendMode() const { 1057 WebBlendMode BlendMode() const {
1058 return static_cast<WebBlendMode>( 1058 return static_cast<WebBlendMode>(
1059 rare_non_inherited_data_->effective_blend_mode_); 1059 rare_non_inherited_data_->effective_blend_mode_);
1060 } 1060 }
1061 void SetBlendMode(WebBlendMode v) { 1061 void SetBlendMode(WebBlendMode v) {
1062 rare_non_inherited_data_.Access()->effective_blend_mode_ = v; 1062 rare_non_inherited_data_.Access()->effective_blend_mode_ = v;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 const StyleOffsetRotation& OffsetRotate() const { 1130 const StyleOffsetRotation& OffsetRotate() const {
1131 return rare_non_inherited_data_->transform_->motion_.rotation_; 1131 return rare_non_inherited_data_->transform_->motion_.rotation_;
1132 } 1132 }
1133 void SetOffsetRotate(const StyleOffsetRotation& offset_rotate) { 1133 void SetOffsetRotate(const StyleOffsetRotation& offset_rotate) {
1134 SET_NESTED_VAR(rare_non_inherited_data_, transform_, motion_.rotation_, 1134 SET_NESTED_VAR(rare_non_inherited_data_, transform_, motion_.rotation_,
1135 offset_rotate); 1135 offset_rotate);
1136 } 1136 }
1137 1137
1138 // opacity (aka -webkit-opacity) 1138 // opacity (aka -webkit-opacity)
1139 static float InitialOpacity() { return 1.0f; } 1139 static float InitialOpacity() { return 1.0f; }
1140 float Opacity() const { return rare_non_inherited_data_->opacity; } 1140 float Opacity() const { return rare_non_inherited_data_->opacity_; }
1141 void SetOpacity(float f) { 1141 void SetOpacity(float f) {
1142 float v = clampTo<float>(f, 0, 1); 1142 float v = clampTo<float>(f, 0, 1);
1143 SET_VAR(rare_non_inherited_data_, opacity, v); 1143 SET_VAR(rare_non_inherited_data_, opacity_, v);
1144 } 1144 }
1145 1145
1146 // order (aka -webkit-order) 1146 // order (aka -webkit-order)
1147 static int InitialOrder() { return 0; } 1147 static int InitialOrder() { return 0; }
1148 int Order() const { return rare_non_inherited_data_->order_; } 1148 int Order() const { return rare_non_inherited_data_->order_; }
1149 // We restrict the smallest value to int min + 2 because we use int min and 1149 // We restrict the smallest value to int min + 2 because we use int min and
1150 // int min + 1 as special values in a hash set. 1150 // int min + 1 as special values in a hash set.
1151 void SetOrder(int o) { 1151 void SetOrder(int o) {
1152 SET_VAR(rare_non_inherited_data_, order_, 1152 SET_VAR(rare_non_inherited_data_, order_,
1153 max(std::numeric_limits<int>::min() + 2, o)); 1153 max(std::numeric_limits<int>::min() + 2, o));
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 void SetTransformOrigin(const TransformOrigin& o) { 1259 void SetTransformOrigin(const TransformOrigin& o) {
1260 SET_NESTED_VAR(rare_non_inherited_data_, transform_, origin_, o); 1260 SET_NESTED_VAR(rare_non_inherited_data_, transform_, origin_, o);
1261 } 1261 }
1262 1262
1263 // transform-style (aka -webkit-transform-style) 1263 // transform-style (aka -webkit-transform-style)
1264 static ETransformStyle3D InitialTransformStyle3D() { 1264 static ETransformStyle3D InitialTransformStyle3D() {
1265 return kTransformStyle3DFlat; 1265 return kTransformStyle3DFlat;
1266 } 1266 }
1267 ETransformStyle3D TransformStyle3D() const { 1267 ETransformStyle3D TransformStyle3D() const {
1268 return static_cast<ETransformStyle3D>( 1268 return static_cast<ETransformStyle3D>(
1269 rare_non_inherited_data_->transform_style3d_); 1269 rare_non_inherited_data_->transform_style_3d_);
1270 } 1270 }
1271 void SetTransformStyle3D(ETransformStyle3D b) { 1271 void SetTransformStyle3D(ETransformStyle3D b) {
1272 SET_VAR(rare_non_inherited_data_, transform_style3d_, b); 1272 SET_VAR(rare_non_inherited_data_, transform_style_3d_, b);
1273 } 1273 }
1274 1274
1275 // -webkit-transform-origin-x 1275 // -webkit-transform-origin-x
1276 static Length InitialTransformOriginX() { return Length(50.0, kPercent); } 1276 static Length InitialTransformOriginX() { return Length(50.0, kPercent); }
1277 const Length& TransformOriginX() const { return GetTransformOrigin().X(); } 1277 const Length& TransformOriginX() const { return GetTransformOrigin().X(); }
1278 void SetTransformOriginX(const Length& v) { 1278 void SetTransformOriginX(const Length& v) {
1279 SetTransformOrigin( 1279 SetTransformOrigin(
1280 TransformOrigin(v, TransformOriginY(), TransformOriginZ())); 1280 TransformOrigin(v, TransformOriginY(), TransformOriginZ()));
1281 } 1281 }
1282 1282
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 rare_inherited_data_->text_decoration_skip_); 1494 rare_inherited_data_->text_decoration_skip_);
1495 } 1495 }
1496 void SetTextDecorationSkip(TextDecorationSkip v) { 1496 void SetTextDecorationSkip(TextDecorationSkip v) {
1497 SET_VAR(rare_inherited_data_, text_decoration_skip_, 1497 SET_VAR(rare_inherited_data_, text_decoration_skip_,
1498 static_cast<unsigned>(v)); 1498 static_cast<unsigned>(v));
1499 } 1499 }
1500 1500
1501 // text-overflow 1501 // text-overflow
1502 static TextOverflow InitialTextOverflow() { return kTextOverflowClip; } 1502 static TextOverflow InitialTextOverflow() { return kTextOverflowClip; }
1503 TextOverflow GetTextOverflow() const { 1503 TextOverflow GetTextOverflow() const {
1504 return static_cast<TextOverflow>(rare_non_inherited_data_->text_overflow); 1504 return static_cast<TextOverflow>(rare_non_inherited_data_->text_overflow_);
1505 } 1505 }
1506 void SetTextOverflow(TextOverflow overflow) { 1506 void SetTextOverflow(TextOverflow overflow) {
1507 SET_VAR(rare_non_inherited_data_, text_overflow, overflow); 1507 SET_VAR(rare_non_inherited_data_, text_overflow_, overflow);
1508 } 1508 }
1509 1509
1510 // touch-action 1510 // touch-action
1511 static TouchAction InitialTouchAction() { 1511 static TouchAction InitialTouchAction() {
1512 return TouchAction::kTouchActionAuto; 1512 return TouchAction::kTouchActionAuto;
1513 } 1513 }
1514 TouchAction GetTouchAction() const { 1514 TouchAction GetTouchAction() const {
1515 return static_cast<TouchAction>(rare_non_inherited_data_->touch_action_); 1515 return static_cast<TouchAction>(rare_non_inherited_data_->touch_action_);
1516 } 1516 }
1517 void SetTouchAction(TouchAction t) { 1517 void SetTouchAction(TouchAction t) {
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1761 rare_inherited_data_->text_emphasis_position_); 1761 rare_inherited_data_->text_emphasis_position_);
1762 } 1762 }
1763 void SetTextEmphasisPosition(TextEmphasisPosition position) { 1763 void SetTextEmphasisPosition(TextEmphasisPosition position) {
1764 SET_VAR(rare_inherited_data_, text_emphasis_position_, 1764 SET_VAR(rare_inherited_data_, text_emphasis_position_,
1765 static_cast<unsigned>(position)); 1765 static_cast<unsigned>(position));
1766 } 1766 }
1767 1767
1768 // -webkit-line-clamp 1768 // -webkit-line-clamp
1769 static LineClampValue InitialLineClamp() { return LineClampValue(); } 1769 static LineClampValue InitialLineClamp() { return LineClampValue(); }
1770 const LineClampValue& LineClamp() const { 1770 const LineClampValue& LineClamp() const {
1771 return rare_non_inherited_data_->line_clamp; 1771 return rare_non_inherited_data_->line_clamp_;
1772 } 1772 }
1773 void SetLineClamp(LineClampValue c) { 1773 void SetLineClamp(LineClampValue c) {
1774 SET_VAR(rare_non_inherited_data_, line_clamp, c); 1774 SET_VAR(rare_non_inherited_data_, line_clamp_, c);
1775 } 1775 }
1776 1776
1777 // -webkit-ruby-position 1777 // -webkit-ruby-position
1778 static RubyPosition InitialRubyPosition() { return RubyPosition::kBefore; } 1778 static RubyPosition InitialRubyPosition() { return RubyPosition::kBefore; }
1779 RubyPosition GetRubyPosition() const { 1779 RubyPosition GetRubyPosition() const {
1780 return static_cast<RubyPosition>(rare_inherited_data_->ruby_position_); 1780 return static_cast<RubyPosition>(rare_inherited_data_->ruby_position_);
1781 } 1781 }
1782 void SetRubyPosition(RubyPosition position) { 1782 void SetRubyPosition(RubyPosition position) {
1783 SET_VAR(rare_inherited_data_, ruby_position_, 1783 SET_VAR(rare_inherited_data_, ruby_position_,
1784 static_cast<unsigned>(position)); 1784 static_cast<unsigned>(position));
1785 } 1785 }
1786 1786
1787 // -webkit-text-fill-color 1787 // -webkit-text-fill-color
1788 void SetTextFillColor(const StyleColor& color) { 1788 void SetTextFillColor(const StyleColor& color) {
1789 SET_VAR(rare_inherited_data_, text_fill_color_, color.Resolve(Color())); 1789 SET_VAR(rare_inherited_data_, text_fill_color_, color.Resolve(Color()));
1790 SET_VAR(rare_inherited_data_, text_fill_color_is_current_color_, 1790 SET_VAR(rare_inherited_data_, text_fill_color_is_current_color_,
1791 color.IsCurrentColor()); 1791 color.IsCurrentColor());
1792 } 1792 }
1793 1793
1794 // -webkit-text-stroke-color 1794 // -webkit-text-stroke-color
1795 void SetTextStrokeColor(const StyleColor& color) { 1795 void SetTextStrokeColor(const StyleColor& color) {
1796 SET_VAR(rare_inherited_data_, text_stroke_color_, color.Resolve(Color())); 1796 SET_VAR(rare_inherited_data_, text_stroke_color_, color.Resolve(Color()));
1797 SET_VAR(rare_inherited_data_, text_stroke_color_is_current_color_, 1797 SET_VAR(rare_inherited_data_, text_stroke_color_is_current_color_,
1798 color.IsCurrentColor()); 1798 color.IsCurrentColor());
1799 } 1799 }
1800 1800
1801 // -webkit-user-drag 1801 // -webkit-user-drag
1802 static EUserDrag InitialUserDrag() { return DRAG_AUTO; } 1802 static EUserDrag InitialUserDrag() { return DRAG_AUTO; }
1803 EUserDrag UserDrag() const { 1803 EUserDrag UserDrag() const {
1804 return static_cast<EUserDrag>(rare_non_inherited_data_->user_drag); 1804 return static_cast<EUserDrag>(rare_non_inherited_data_->user_drag_);
1805 } 1805 }
1806 void SetUserDrag(EUserDrag d) { 1806 void SetUserDrag(EUserDrag d) {
1807 SET_VAR(rare_non_inherited_data_, user_drag, d); 1807 SET_VAR(rare_non_inherited_data_, user_drag_, d);
1808 } 1808 }
1809 1809
1810 // -webkit-user-modify 1810 // -webkit-user-modify
1811 static EUserModify InitialUserModify() { return EUserModify::kReadOnly; } 1811 static EUserModify InitialUserModify() { return EUserModify::kReadOnly; }
1812 EUserModify UserModify() const { 1812 EUserModify UserModify() const {
1813 return static_cast<EUserModify>(rare_inherited_data_->user_modify_); 1813 return static_cast<EUserModify>(rare_inherited_data_->user_modify_);
1814 } 1814 }
1815 void SetUserModify(EUserModify u) { 1815 void SetUserModify(EUserModify u) {
1816 SET_VAR(rare_inherited_data_, user_modify_, static_cast<unsigned>(u)); 1816 SET_VAR(rare_inherited_data_, user_modify_, static_cast<unsigned>(u));
1817 } 1817 }
(...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after
3683 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3683 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3684 } 3684 }
3685 3685
3686 inline bool ComputedStyle::HasPseudoElementStyle() const { 3686 inline bool ComputedStyle::HasPseudoElementStyle() const {
3687 return PseudoBitsInternal() & kElementPseudoIdMask; 3687 return PseudoBitsInternal() & kElementPseudoIdMask;
3688 } 3688 }
3689 3689
3690 } // namespace blink 3690 } // namespace blink
3691 3691
3692 #endif // ComputedStyle_h 3692 #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