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

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

Issue 2933303002: Generate diffs for all fields on StyleRareNonInheritedData (Closed)
Patch Set: shend@ suggestions 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
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 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1137 } 1137 }
1138 1138
1139 // opacity (aka -webkit-opacity) 1139 // opacity (aka -webkit-opacity)
1140 static float InitialOpacity() { return 1.0f; } 1140 static float InitialOpacity() { return 1.0f; }
1141 float Opacity() const { return rare_non_inherited_data_->opacity_; } 1141 float Opacity() const { return rare_non_inherited_data_->opacity_; }
1142 void SetOpacity(float f) { 1142 void SetOpacity(float f) {
1143 float v = clampTo<float>(f, 0, 1); 1143 float v = clampTo<float>(f, 0, 1);
1144 SET_VAR(rare_non_inherited_data_, opacity_, v); 1144 SET_VAR(rare_non_inherited_data_, opacity_, v);
1145 } 1145 }
1146 1146
1147 bool OpacityChangedStackingContext(const ComputedStyle& other) const {
1148 // We only need do layout for opacity changes if adding or losing opacity
1149 // could trigger a change
1150 // in us being a stacking context.
1151 if (IsStackingContext() != other.IsStackingContext() &&
1152 HasOpacity() != other.HasOpacity()) {
1153 // FIXME: We would like to use SimplifiedLayout here, but we can't quite
1154 // do that yet. We need to make sure SimplifiedLayout can operate
1155 // correctly on LayoutInlines (we will need to add a
1156 // selfNeedsSimplifiedLayout bit in order to not get confused and taint
1157 // every line). In addition we need to solve the floating object issue
1158 // when layers come and go. Right now a full layout is necessary to keep
1159 // floating object lists sane.
1160 return true;
1161 }
1162 return false;
1163 }
1164
1147 // order (aka -webkit-order) 1165 // order (aka -webkit-order)
1148 static int InitialOrder() { return 0; } 1166 static int InitialOrder() { return 0; }
1149 int Order() const { return rare_non_inherited_data_->order_; } 1167 int Order() const { return rare_non_inherited_data_->order_; }
1150 // We restrict the smallest value to int min + 2 because we use int min and 1168 // We restrict the smallest value to int min + 2 because we use int min and
1151 // int min + 1 as special values in a hash set. 1169 // int min + 1 as special values in a hash set.
1152 void SetOrder(int o) { 1170 void SetOrder(int o) {
1153 SET_VAR(rare_non_inherited_data_, order_, 1171 SET_VAR(rare_non_inherited_data_, order_,
1154 max(std::numeric_limits<int>::min() + 2, o)); 1172 max(std::numeric_limits<int>::min() + 2, o));
1155 } 1173 }
1156 1174
1157 // Outline properties. 1175 // Outline properties.
1176
1177 bool OutlineVisuallyEqual(const ComputedStyle& other) const {
1178 return rare_non_inherited_data_->outline_.VisuallyEqual(
1179 other.rare_non_inherited_data_->outline_);
1180 }
1181
1158 // outline-color 1182 // outline-color
1159 void SetOutlineColor(const StyleColor& v) { 1183 void SetOutlineColor(const StyleColor& v) {
1160 SET_BORDERVALUE_COLOR(rare_non_inherited_data_, outline_, v); 1184 SET_BORDERVALUE_COLOR(rare_non_inherited_data_, outline_, v);
1161 } 1185 }
1162 1186
1163 // outline-style 1187 // outline-style
1164 EBorderStyle OutlineStyle() const { 1188 EBorderStyle OutlineStyle() const {
1165 return rare_non_inherited_data_->outline_.Style(); 1189 return rare_non_inherited_data_->outline_.Style();
1166 } 1190 }
1167 void SetOutlineStyle(EBorderStyle v) { 1191 void SetOutlineStyle(EBorderStyle v) {
(...skipping 2243 matching lines...) Expand 10 before | Expand all | Expand 10 after
3411 if (VisitedLinkCaretColorIsAutoInternal()) 3435 if (VisitedLinkCaretColorIsAutoInternal())
3412 return StyleAutoColor::AutoColor(); 3436 return StyleAutoColor::AutoColor();
3413 return StyleAutoColor(VisitedLinkCaretColorInternal()); 3437 return StyleAutoColor(VisitedLinkCaretColorInternal());
3414 } 3438 }
3415 StyleColor VisitedLinkBackgroundColor() const { 3439 StyleColor VisitedLinkBackgroundColor() const {
3416 return rare_non_inherited_data_->visited_link_background_color_; 3440 return rare_non_inherited_data_->visited_link_background_color_;
3417 } 3441 }
3418 StyleColor VisitedLinkBorderLeftColor() const { 3442 StyleColor VisitedLinkBorderLeftColor() const {
3419 return rare_non_inherited_data_->visited_link_border_left_color_; 3443 return rare_non_inherited_data_->visited_link_border_left_color_;
3420 } 3444 }
3445 bool VisitedLinkBorderLeftColorHasChanged(const ComputedStyle& other) const {
3446 return (VisitedLinkBorderLeftColor() !=
3447 other.VisitedLinkBorderLeftColor() &&
3448 BorderLeftWidth());
3449 }
3421 StyleColor VisitedLinkBorderRightColor() const { 3450 StyleColor VisitedLinkBorderRightColor() const {
3422 return rare_non_inherited_data_->visited_link_border_right_color_; 3451 return rare_non_inherited_data_->visited_link_border_right_color_;
3423 } 3452 }
3453 bool VisitedLinkBorderRightColorHasChanged(const ComputedStyle& other) const {
3454 return (VisitedLinkBorderRightColor() !=
3455 other.VisitedLinkBorderRightColor() &&
3456 BorderRightWidth());
3457 }
3424 StyleColor VisitedLinkBorderBottomColor() const { 3458 StyleColor VisitedLinkBorderBottomColor() const {
3425 return rare_non_inherited_data_->visited_link_border_bottom_color_; 3459 return rare_non_inherited_data_->visited_link_border_bottom_color_;
3426 } 3460 }
3461 bool VisitedLinkBorderBottomColorHasChanged(
3462 const ComputedStyle& other) const {
3463 return (VisitedLinkBorderBottomColor() !=
3464 other.VisitedLinkBorderBottomColor() &&
3465 BorderBottomWidth());
3466 }
3427 StyleColor VisitedLinkBorderTopColor() const { 3467 StyleColor VisitedLinkBorderTopColor() const {
3428 return rare_non_inherited_data_->visited_link_border_top_color_; 3468 return rare_non_inherited_data_->visited_link_border_top_color_;
3429 } 3469 }
3470 bool VisitedLinkBorderTopColorHasChanged(const ComputedStyle& other) const {
3471 return (VisitedLinkBorderTopColor() != other.VisitedLinkBorderTopColor() &&
3472 BorderTopWidth());
3473 }
3430 StyleColor VisitedLinkOutlineColor() const { 3474 StyleColor VisitedLinkOutlineColor() const {
3431 return rare_non_inherited_data_->visited_link_outline_color_; 3475 return rare_non_inherited_data_->visited_link_outline_color_;
3432 } 3476 }
3477 bool VisitedLinkOutlineColorHasChanged(const ComputedStyle& other) const {
3478 return (VisitedLinkOutlineColor() != other.VisitedLinkOutlineColor() &&
3479 OutlineWidth());
3480 }
3433 StyleColor VisitedLinkColumnRuleColor() const { 3481 StyleColor VisitedLinkColumnRuleColor() const {
3434 return rare_non_inherited_data_->multi_col_data_ 3482 return rare_non_inherited_data_->multi_col_data_
3435 ->visited_link_column_rule_color_; 3483 ->visited_link_column_rule_color_;
3436 } 3484 }
3437 StyleColor TextDecorationColor() const { 3485 StyleColor TextDecorationColor() const {
3438 return rare_non_inherited_data_->text_decoration_color_; 3486 return rare_non_inherited_data_->text_decoration_color_;
3439 } 3487 }
3440 StyleColor VisitedLinkTextDecorationColor() const { 3488 StyleColor VisitedLinkTextDecorationColor() const {
3441 return rare_non_inherited_data_->visited_link_text_decoration_color_; 3489 return rare_non_inherited_data_->visited_link_text_decoration_color_;
3442 } 3490 }
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
3574 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3622 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3575 } 3623 }
3576 3624
3577 inline bool ComputedStyle::HasPseudoElementStyle() const { 3625 inline bool ComputedStyle::HasPseudoElementStyle() const {
3578 return PseudoBitsInternal() & kElementPseudoIdMask; 3626 return PseudoBitsInternal() & kElementPseudoIdMask;
3579 } 3627 }
3580 3628
3581 } // namespace blink 3629 } // namespace blink
3582 3630
3583 #endif // ComputedStyle_h 3631 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698