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

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

Issue 2933303002: Generate diffs for all fields on StyleRareNonInheritedData (Closed)
Patch Set: fix failing tests 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 VisitedLinkBorderLeftColorHasNotChanged(
3446 const ComputedStyle& other) const {
3447 return (VisitedLinkBorderLeftColor() ==
3448 other.VisitedLinkBorderLeftColor() ||
3449 !BorderLeftWidth());
3450 }
3421 StyleColor VisitedLinkBorderRightColor() const { 3451 StyleColor VisitedLinkBorderRightColor() const {
3422 return rare_non_inherited_data_->visited_link_border_right_color_; 3452 return rare_non_inherited_data_->visited_link_border_right_color_;
3423 } 3453 }
3454 bool VisitedLinkBorderRightColorHasNotChanged(
3455 const ComputedStyle& other) const {
3456 return (VisitedLinkBorderRightColor() ==
3457 other.VisitedLinkBorderRightColor() ||
3458 !BorderRightWidth());
3459 }
3424 StyleColor VisitedLinkBorderBottomColor() const { 3460 StyleColor VisitedLinkBorderBottomColor() const {
3425 return rare_non_inherited_data_->visited_link_border_bottom_color_; 3461 return rare_non_inherited_data_->visited_link_border_bottom_color_;
3426 } 3462 }
3463 bool VisitedLinkBorderBottomColorHasNotChanged(
3464 const ComputedStyle& other) const {
3465 return (VisitedLinkBorderBottomColor() ==
3466 other.VisitedLinkBorderBottomColor() ||
3467 !BorderBottomWidth());
3468 }
3427 StyleColor VisitedLinkBorderTopColor() const { 3469 StyleColor VisitedLinkBorderTopColor() const {
3428 return rare_non_inherited_data_->visited_link_border_top_color_; 3470 return rare_non_inherited_data_->visited_link_border_top_color_;
3429 } 3471 }
3472 bool VisitedLinkBorderTopColorHasNotChanged(
3473 const ComputedStyle& other) const {
3474 return (VisitedLinkBorderTopColor() == other.VisitedLinkBorderTopColor() ||
3475 !BorderTopWidth());
3476 }
3430 StyleColor VisitedLinkOutlineColor() const { 3477 StyleColor VisitedLinkOutlineColor() const {
3431 return rare_non_inherited_data_->visited_link_outline_color_; 3478 return rare_non_inherited_data_->visited_link_outline_color_;
3432 } 3479 }
3480 bool VisitedLinkOutlineColorHasNotChanged(const ComputedStyle& other) const {
3481 return (VisitedLinkOutlineColor() == other.VisitedLinkOutlineColor() ||
3482 !OutlineWidth());
3483 }
3433 StyleColor VisitedLinkColumnRuleColor() const { 3484 StyleColor VisitedLinkColumnRuleColor() const {
3434 return rare_non_inherited_data_->multi_col_data_ 3485 return rare_non_inherited_data_->multi_col_data_
3435 ->visited_link_column_rule_color_; 3486 ->visited_link_column_rule_color_;
3436 } 3487 }
3437 StyleColor TextDecorationColor() const { 3488 StyleColor TextDecorationColor() const {
3438 return rare_non_inherited_data_->text_decoration_color_; 3489 return rare_non_inherited_data_->text_decoration_color_;
3439 } 3490 }
3440 StyleColor VisitedLinkTextDecorationColor() const { 3491 StyleColor VisitedLinkTextDecorationColor() const {
3441 return rare_non_inherited_data_->visited_link_text_decoration_color_; 3492 return rare_non_inherited_data_->visited_link_text_decoration_color_;
3442 } 3493 }
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
3574 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3625 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3575 } 3626 }
3576 3627
3577 inline bool ComputedStyle::HasPseudoElementStyle() const { 3628 inline bool ComputedStyle::HasPseudoElementStyle() const {
3578 return PseudoBitsInternal() & kElementPseudoIdMask; 3629 return PseudoBitsInternal() & kElementPseudoIdMask;
3579 } 3630 }
3580 3631
3581 } // namespace blink 3632 } // namespace blink
3582 3633
3583 #endif // ComputedStyle_h 3634 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698