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

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

Issue 2834543007: Give consistent names to subgroups of ComputedStyle. (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 | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | 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) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 new_style->SetDisplay(display); 107 new_style->SetDisplay(display);
108 return new_style; 108 return new_style;
109 } 109 }
110 110
111 PassRefPtr<ComputedStyle> ComputedStyle::Clone(const ComputedStyle& other) { 111 PassRefPtr<ComputedStyle> ComputedStyle::Clone(const ComputedStyle& other) {
112 return AdoptRef(new ComputedStyle(other)); 112 return AdoptRef(new ComputedStyle(other));
113 } 113 }
114 114
115 ALWAYS_INLINE ComputedStyle::ComputedStyle() 115 ALWAYS_INLINE ComputedStyle::ComputedStyle()
116 : ComputedStyleBase(), RefCounted<ComputedStyle>() { 116 : ComputedStyleBase(), RefCounted<ComputedStyle>() {
117 box_.Init(); 117 box_data_.Init();
118 visual_.Init(); 118 visual_data_.Init();
119 background_.Init(); 119 background_data_.Init();
120 surround_.Init(); 120 surround_data_.Init();
121 rare_non_inherited_data_.Init(); 121 rare_non_inherited_data_.Init();
122 rare_non_inherited_data_.Access()->deprecated_flexible_box_.Init(); 122 rare_non_inherited_data_.Access()->deprecated_flexible_box_.Init();
123 rare_non_inherited_data_.Access()->flexible_box_.Init(); 123 rare_non_inherited_data_.Access()->flexible_box_.Init();
124 rare_non_inherited_data_.Access()->multi_col_.Init(); 124 rare_non_inherited_data_.Access()->multi_col_.Init();
125 rare_non_inherited_data_.Access()->transform_.Init(); 125 rare_non_inherited_data_.Access()->transform_.Init();
126 rare_non_inherited_data_.Access()->will_change_.Init(); 126 rare_non_inherited_data_.Access()->will_change_.Init();
127 rare_non_inherited_data_.Access()->filter_.Init(); 127 rare_non_inherited_data_.Access()->filter_.Init();
128 rare_non_inherited_data_.Access()->backdrop_filter_.Init(); 128 rare_non_inherited_data_.Access()->backdrop_filter_.Init();
129 rare_non_inherited_data_.Access()->grid_.Init(); 129 rare_non_inherited_data_.Access()->grid_.Init();
130 rare_non_inherited_data_.Access()->grid_item_.Init(); 130 rare_non_inherited_data_.Access()->grid_item_.Init();
131 rare_non_inherited_data_.Access()->scroll_snap_.Init(); 131 rare_non_inherited_data_.Access()->scroll_snap_.Init();
132 rare_inherited_data_.Init(); 132 rare_inherited_data_.Init();
133 style_inherited_data_.Init(); 133 style_inherited_data_.Init();
134 svg_style_.Init(); 134 svg_style_.Init();
135 } 135 }
136 136
137 ALWAYS_INLINE ComputedStyle::ComputedStyle(const ComputedStyle& o) 137 ALWAYS_INLINE ComputedStyle::ComputedStyle(const ComputedStyle& o)
138 : ComputedStyleBase(o), 138 : ComputedStyleBase(o),
139 RefCounted<ComputedStyle>(), 139 RefCounted<ComputedStyle>(),
140 box_(o.box_), 140 box_data_(o.box_data_),
141 visual_(o.visual_), 141 visual_data_(o.visual_data_),
142 background_(o.background_), 142 background_data_(o.background_data_),
143 surround_(o.surround_), 143 surround_data_(o.surround_data_),
144 rare_non_inherited_data_(o.rare_non_inherited_data_), 144 rare_non_inherited_data_(o.rare_non_inherited_data_),
145 rare_inherited_data_(o.rare_inherited_data_), 145 rare_inherited_data_(o.rare_inherited_data_),
146 style_inherited_data_(o.style_inherited_data_), 146 style_inherited_data_(o.style_inherited_data_),
147 svg_style_(o.svg_style_) {} 147 svg_style_(o.svg_style_) {}
148 148
149 static StyleRecalcChange DiffPseudoStyles(const ComputedStyle& old_style, 149 static StyleRecalcChange DiffPseudoStyles(const ComputedStyle& old_style,
150 const ComputedStyle& new_style) { 150 const ComputedStyle& new_style) {
151 // If the pseudoStyles have changed, ensure layoutObject triggers setStyle. 151 // If the pseudoStyles have changed, ensure layoutObject triggers setStyle.
152 if (!old_style.HasAnyPublicPseudoStyles() && 152 if (!old_style.HasAnyPublicPseudoStyles() &&
153 !new_style.HasAnyPublicPseudoStyles()) 153 !new_style.HasAnyPublicPseudoStyles())
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 } else { 326 } else {
327 rare_inherited_data_ = inherit_parent.rare_inherited_data_; 327 rare_inherited_data_ = inherit_parent.rare_inherited_data_;
328 } 328 }
329 style_inherited_data_ = inherit_parent.style_inherited_data_; 329 style_inherited_data_ = inherit_parent.style_inherited_data_;
330 if (svg_style_ != inherit_parent.svg_style_) 330 if (svg_style_ != inherit_parent.svg_style_)
331 svg_style_.Access()->InheritFrom(inherit_parent.svg_style_.Get()); 331 svg_style_.Access()->InheritFrom(inherit_parent.svg_style_.Get());
332 } 332 }
333 333
334 void ComputedStyle::CopyNonInheritedFromCached(const ComputedStyle& other) { 334 void ComputedStyle::CopyNonInheritedFromCached(const ComputedStyle& other) {
335 ComputedStyleBase::CopyNonInheritedFromCached(other); 335 ComputedStyleBase::CopyNonInheritedFromCached(other);
336 box_ = other.box_; 336 box_data_ = other.box_data_;
337 visual_ = other.visual_; 337 visual_data_ = other.visual_data_;
338 background_ = other.background_; 338 background_data_ = other.background_data_;
339 surround_ = other.surround_; 339 surround_data_ = other.surround_data_;
340 rare_non_inherited_data_ = other.rare_non_inherited_data_; 340 rare_non_inherited_data_ = other.rare_non_inherited_data_;
341 341
342 // The flags are copied one-by-one because they contain 342 // The flags are copied one-by-one because they contain
343 // bunch of stuff other than real style data. 343 // bunch of stuff other than real style data.
344 // See comments for each skipped flag below. 344 // See comments for each skipped flag below.
345 345
346 // These are not generated in ComputedStyleBase 346 // These are not generated in ComputedStyleBase
347 SetOriginalDisplay(other.OriginalDisplay()); 347 SetOriginalDisplay(other.OriginalDisplay());
348 SetVerticalAlign(other.VerticalAlign()); 348 SetVerticalAlign(other.VerticalAlign());
349 SetHasViewportUnits(other.HasViewportUnits()); 349 SetHasViewportUnits(other.HasViewportUnits());
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 return GetFont().LoadingCustomFonts() == other.GetFont().LoadingCustomFonts(); 475 return GetFont().LoadingCustomFonts() == other.GetFont().LoadingCustomFonts();
476 } 476 }
477 477
478 bool ComputedStyle::NonInheritedEqual(const ComputedStyle& other) const { 478 bool ComputedStyle::NonInheritedEqual(const ComputedStyle& other) const {
479 // compare everything except the pseudoStyle pointer 479 // compare everything except the pseudoStyle pointer
480 return ComputedStyleBase::NonInheritedEqual(other) && 480 return ComputedStyleBase::NonInheritedEqual(other) &&
481 OriginalDisplay() == 481 OriginalDisplay() ==
482 other.OriginalDisplay() && // Not generated in ComputedStyleBase 482 other.OriginalDisplay() && // Not generated in ComputedStyleBase
483 VerticalAlign() == other.VerticalAlign() && // Not generated in 483 VerticalAlign() == other.VerticalAlign() && // Not generated in
484 // ComputedStyleBase 484 // ComputedStyleBase
485 box_ == other.box_ && 485 box_data_ == other.box_data_ &&
486 visual_ == other.visual_ && background_ == other.background_ && 486 visual_data_ == other.visual_data_ &&
487 surround_ == other.surround_ && 487 background_data_ == other.background_data_ &&
488 surround_data_ == other.surround_data_ &&
488 rare_non_inherited_data_ == other.rare_non_inherited_data_ && 489 rare_non_inherited_data_ == other.rare_non_inherited_data_ &&
489 svg_style_->NonInheritedEqual(*other.svg_style_); 490 svg_style_->NonInheritedEqual(*other.svg_style_);
490 } 491 }
491 492
492 bool ComputedStyle::InheritedDataShared(const ComputedStyle& other) const { 493 bool ComputedStyle::InheritedDataShared(const ComputedStyle& other) const {
493 // This is a fast check that only looks if the data structures are shared. 494 // This is a fast check that only looks if the data structures are shared.
494 // TODO(sashab): Should ComputedStyleBase have an inheritedDataShared method? 495 // TODO(sashab): Should ComputedStyleBase have an inheritedDataShared method?
495 return ComputedStyleBase::InheritedEqual(other) && 496 return ComputedStyleBase::InheritedEqual(other) &&
496 style_inherited_data_.Get() == other.style_inherited_data_.Get() && 497 style_inherited_data_.Get() == other.style_inherited_data_.Get() &&
497 svg_style_.Get() == other.svg_style_.Get() && 498 svg_style_.Get() == other.svg_style_.Get() &&
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 572
572 return diff; 573 return diff;
573 } 574 }
574 575
575 bool ComputedStyle::ScrollAnchorDisablingPropertyChanged( 576 bool ComputedStyle::ScrollAnchorDisablingPropertyChanged(
576 const ComputedStyle& other, 577 const ComputedStyle& other,
577 const StyleDifference& diff) const { 578 const StyleDifference& diff) const {
578 if (GetPosition() != other.GetPosition()) 579 if (GetPosition() != other.GetPosition())
579 return true; 580 return true;
580 581
581 if (box_.Get() != other.box_.Get()) { 582 if (box_data_.Get() != other.box_data_.Get()) {
582 if (box_->Width() != other.box_->Width() || 583 if (box_data_->Width() != other.box_data_->Width() ||
583 box_->MinWidth() != other.box_->MinWidth() || 584 box_data_->MinWidth() != other.box_data_->MinWidth() ||
584 box_->MaxWidth() != other.box_->MaxWidth() || 585 box_data_->MaxWidth() != other.box_data_->MaxWidth() ||
585 box_->Height() != other.box_->Height() || 586 box_data_->Height() != other.box_data_->Height() ||
586 box_->MinHeight() != other.box_->MinHeight() || 587 box_data_->MinHeight() != other.box_data_->MinHeight() ||
587 box_->MaxHeight() != other.box_->MaxHeight()) 588 box_data_->MaxHeight() != other.box_data_->MaxHeight())
588 return true; 589 return true;
589 } 590 }
590 591
591 if (surround_.Get() != other.surround_.Get()) { 592 if (surround_data_.Get() != other.surround_data_.Get()) {
592 if (!MarginEqual(other) || !OffsetEqual(other) || !PaddingEqual(other)) 593 if (!MarginEqual(other) || !OffsetEqual(other) || !PaddingEqual(other))
593 return true; 594 return true;
594 } 595 }
595 596
596 if (diff.TransformChanged()) 597 if (diff.TransformChanged())
597 return true; 598 return true;
598 599
599 return false; 600 return false;
600 } 601 }
601 602
602 bool ComputedStyle::DiffNeedsFullLayoutAndPaintInvalidation( 603 bool ComputedStyle::DiffNeedsFullLayoutAndPaintInvalidation(
603 const ComputedStyle& other) const { 604 const ComputedStyle& other) const {
604 // FIXME: Not all cases in this method need both full layout and paint 605 // FIXME: Not all cases in this method need both full layout and paint
605 // invalidation. 606 // invalidation.
606 // Should move cases into DiffNeedsFullLayout() if 607 // Should move cases into DiffNeedsFullLayout() if
607 // - don't need paint invalidation at all; 608 // - don't need paint invalidation at all;
608 // - or the layoutObject knows how to exactly invalidate paints caused by the 609 // - or the layoutObject knows how to exactly invalidate paints caused by the
609 // layout change instead of forced full paint invalidation. 610 // layout change instead of forced full paint invalidation.
610 611
611 if (surround_.Get() != other.surround_.Get()) { 612 if (surround_data_.Get() != other.surround_data_.Get()) {
612 // If our border widths change, then we need to layout. Other changes to 613 // If our border widths change, then we need to layout. Other changes to
613 // borders only necessitate a paint invalidation. 614 // borders only necessitate a paint invalidation.
614 if (BorderLeftWidth() != other.BorderLeftWidth() || 615 if (BorderLeftWidth() != other.BorderLeftWidth() ||
615 BorderTopWidth() != other.BorderTopWidth() || 616 BorderTopWidth() != other.BorderTopWidth() ||
616 BorderBottomWidth() != other.BorderBottomWidth() || 617 BorderBottomWidth() != other.BorderBottomWidth() ||
617 BorderRightWidth() != other.BorderRightWidth()) 618 BorderRightWidth() != other.BorderRightWidth())
618 return true; 619 return true;
619 620
620 if (!PaddingEqual(other)) 621 if (!PaddingEqual(other))
621 return true; 622 return true;
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 other.HasPseudoStyle(kPseudoIdScrollbar)) 833 other.HasPseudoStyle(kPseudoIdScrollbar))
833 return true; 834 return true;
834 835
835 // Movement of non-static-positioned object is special cased in 836 // Movement of non-static-positioned object is special cased in
836 // ComputedStyle::VisualInvalidationDiff(). 837 // ComputedStyle::VisualInvalidationDiff().
837 838
838 return false; 839 return false;
839 } 840 }
840 841
841 bool ComputedStyle::DiffNeedsFullLayout(const ComputedStyle& other) const { 842 bool ComputedStyle::DiffNeedsFullLayout(const ComputedStyle& other) const {
842 if (box_.Get() != other.box_.Get()) { 843 if (box_data_.Get() != other.box_data_.Get()) {
843 if (box_->Width() != other.box_->Width() || 844 if (box_data_->Width() != other.box_data_->Width() ||
844 box_->MinWidth() != other.box_->MinWidth() || 845 box_data_->MinWidth() != other.box_data_->MinWidth() ||
845 box_->MaxWidth() != other.box_->MaxWidth() || 846 box_data_->MaxWidth() != other.box_data_->MaxWidth() ||
846 box_->Height() != other.box_->Height() || 847 box_data_->Height() != other.box_data_->Height() ||
847 box_->MinHeight() != other.box_->MinHeight() || 848 box_data_->MinHeight() != other.box_data_->MinHeight() ||
848 box_->MaxHeight() != other.box_->MaxHeight()) 849 box_data_->MaxHeight() != other.box_data_->MaxHeight())
849 return true; 850 return true;
850 851
851 if (box_->VerticalAlign() != other.box_->VerticalAlign()) 852 if (box_data_->VerticalAlign() != other.box_data_->VerticalAlign())
852 return true; 853 return true;
853 854
854 if (box_->BoxSizing() != other.box_->BoxSizing()) 855 if (box_data_->BoxSizing() != other.box_data_->BoxSizing())
855 return true; 856 return true;
856 } 857 }
857 858
858 if (VerticalAlign() != other.VerticalAlign() || 859 if (VerticalAlign() != other.VerticalAlign() ||
859 GetPosition() != other.GetPosition()) 860 GetPosition() != other.GetPosition())
860 return true; 861 return true;
861 862
862 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) { 863 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) {
863 if (rare_non_inherited_data_->align_content_ != 864 if (rare_non_inherited_data_->align_content_ !=
864 other.rare_non_inherited_data_->align_content_ || 865 other.rare_non_inherited_data_->align_content_ ||
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 899
899 return false; 900 return false;
900 } 901 }
901 902
902 bool ComputedStyle::DiffNeedsPaintInvalidationObject( 903 bool ComputedStyle::DiffNeedsPaintInvalidationObject(
903 const ComputedStyle& other) const { 904 const ComputedStyle& other) const {
904 if (Visibility() != other.Visibility() || 905 if (Visibility() != other.Visibility() ||
905 PrintColorAdjust() != other.PrintColorAdjust() || 906 PrintColorAdjust() != other.PrintColorAdjust() ||
906 InsideLink() != other.InsideLink() || 907 InsideLink() != other.InsideLink() ||
907 !Border().VisuallyEqual(other.Border()) || 908 !Border().VisuallyEqual(other.Border()) ||
908 *background_ != *other.background_) 909 *background_data_ != *other.background_data_)
909 return true; 910 return true;
910 911
911 if (rare_inherited_data_.Get() != other.rare_inherited_data_.Get()) { 912 if (rare_inherited_data_.Get() != other.rare_inherited_data_.Get()) {
912 if (rare_inherited_data_->user_modify != 913 if (rare_inherited_data_->user_modify !=
913 other.rare_inherited_data_->user_modify || 914 other.rare_inherited_data_->user_modify ||
914 rare_inherited_data_->user_select != 915 rare_inherited_data_->user_select !=
915 other.rare_inherited_data_->user_select || 916 other.rare_inherited_data_->user_select ||
916 rare_inherited_data_->image_rendering_ != 917 rare_inherited_data_->image_rendering_ !=
917 other.rare_inherited_data_->image_rendering_) 918 other.rare_inherited_data_->image_rendering_)
918 return true; 919 return true;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 // Need to update visual rect of the resizer. 1005 // Need to update visual rect of the resizer.
1005 if (Resize() != other.Resize()) 1006 if (Resize() != other.Resize())
1006 return true; 1007 return true;
1007 1008
1008 return false; 1009 return false;
1009 } 1010 }
1010 1011
1011 void ComputedStyle::UpdatePropertySpecificDifferences( 1012 void ComputedStyle::UpdatePropertySpecificDifferences(
1012 const ComputedStyle& other, 1013 const ComputedStyle& other,
1013 StyleDifference& diff) const { 1014 StyleDifference& diff) const {
1014 if (box_->ZIndex() != other.box_->ZIndex() || 1015 if (box_data_->ZIndex() != other.box_data_->ZIndex() ||
1015 IsStackingContext() != other.IsStackingContext()) 1016 IsStackingContext() != other.IsStackingContext())
1016 diff.SetZIndexChanged(); 1017 diff.SetZIndexChanged();
1017 1018
1018 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) { 1019 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) {
1019 // It's possible for the old and new style transform data to be equivalent 1020 // It's possible for the old and new style transform data to be equivalent
1020 // while hasTransform() differs, as it checks a number of conditions aside 1021 // while hasTransform() differs, as it checks a number of conditions aside
1021 // from just the matrix, including but not limited to animation state. 1022 // from just the matrix, including but not limited to animation state.
1022 if (HasTransform() != other.HasTransform() || 1023 if (HasTransform() != other.HasTransform() ||
1023 !TransformDataEquivalent(other) || 1024 !TransformDataEquivalent(other) ||
1024 rare_non_inherited_data_->perspective_ != 1025 rare_non_inherited_data_->perspective_ !=
(...skipping 28 matching lines...) Expand all
1053 } 1054 }
1054 1055
1055 if (!Border().VisualOverflowEqual(other.Border())) 1056 if (!Border().VisualOverflowEqual(other.Border()))
1056 diff.SetNeedsRecomputeOverflow(); 1057 diff.SetNeedsRecomputeOverflow();
1057 1058
1058 if (!diff.NeedsFullPaintInvalidation()) { 1059 if (!diff.NeedsFullPaintInvalidation()) {
1059 if (style_inherited_data_->color != other.style_inherited_data_->color || 1060 if (style_inherited_data_->color != other.style_inherited_data_->color ||
1060 style_inherited_data_->visited_link_color != 1061 style_inherited_data_->visited_link_color !=
1061 other.style_inherited_data_->visited_link_color || 1062 other.style_inherited_data_->visited_link_color ||
1062 HasSimpleUnderlineInternal() != other.HasSimpleUnderlineInternal() || 1063 HasSimpleUnderlineInternal() != other.HasSimpleUnderlineInternal() ||
1063 visual_->text_decoration != other.visual_->text_decoration) { 1064 visual_data_->text_decoration != other.visual_data_->text_decoration) {
1064 diff.SetTextDecorationOrColorChanged(); 1065 diff.SetTextDecorationOrColorChanged();
1065 } else if (rare_non_inherited_data_.Get() != 1066 } else if (rare_non_inherited_data_.Get() !=
1066 other.rare_non_inherited_data_.Get() && 1067 other.rare_non_inherited_data_.Get() &&
1067 (rare_non_inherited_data_->text_decoration_style_ != 1068 (rare_non_inherited_data_->text_decoration_style_ !=
1068 other.rare_non_inherited_data_->text_decoration_style_ || 1069 other.rare_non_inherited_data_->text_decoration_style_ ||
1069 rare_non_inherited_data_->text_decoration_color_ != 1070 rare_non_inherited_data_->text_decoration_color_ !=
1070 other.rare_non_inherited_data_->text_decoration_color_ || 1071 other.rare_non_inherited_data_->text_decoration_color_ ||
1071 rare_non_inherited_data_->visited_link_text_decoration_color_ != 1072 rare_non_inherited_data_->visited_link_text_decoration_color_ !=
1072 other.rare_non_inherited_data_ 1073 other.rare_non_inherited_data_
1073 ->visited_link_text_decoration_color_)) { 1074 ->visited_link_text_decoration_color_)) {
(...skipping 21 matching lines...) Expand all
1095 rare_inherited_data_->applied_text_decorations != 1096 rare_inherited_data_->applied_text_decorations !=
1096 other.rare_inherited_data_->applied_text_decorations || 1097 other.rare_inherited_data_->applied_text_decorations ||
1097 rare_inherited_data_->CaretColor() != 1098 rare_inherited_data_->CaretColor() !=
1098 other.rare_inherited_data_->CaretColor() || 1099 other.rare_inherited_data_->CaretColor() ||
1099 rare_inherited_data_->VisitedLinkCaretColor() != 1100 rare_inherited_data_->VisitedLinkCaretColor() !=
1100 other.rare_inherited_data_->VisitedLinkCaretColor())) { 1101 other.rare_inherited_data_->VisitedLinkCaretColor())) {
1101 diff.SetTextDecorationOrColorChanged(); 1102 diff.SetTextDecorationOrColorChanged();
1102 } 1103 }
1103 } 1104 }
1104 1105
1105 bool has_clip = HasOutOfFlowPosition() && !visual_->has_auto_clip; 1106 bool has_clip = HasOutOfFlowPosition() && !visual_data_->has_auto_clip;
1106 bool other_has_clip = 1107 bool other_has_clip =
1107 other.HasOutOfFlowPosition() && !other.visual_->has_auto_clip; 1108 other.HasOutOfFlowPosition() && !other.visual_data_->has_auto_clip;
1108 if (has_clip != other_has_clip || 1109 if (has_clip != other_has_clip ||
1109 (has_clip && visual_->clip != other.visual_->clip)) 1110 (has_clip && visual_data_->clip != other.visual_data_->clip))
1110 diff.SetCSSClipChanged(); 1111 diff.SetCSSClipChanged();
1111 } 1112 }
1112 1113
1113 void ComputedStyle::AddPaintImage(StyleImage* image) { 1114 void ComputedStyle::AddPaintImage(StyleImage* image) {
1114 if (!rare_non_inherited_data_.Access()->paint_images_) { 1115 if (!rare_non_inherited_data_.Access()->paint_images_) {
1115 rare_non_inherited_data_.Access()->paint_images_ = 1116 rare_non_inherited_data_.Access()->paint_images_ =
1116 WTF::MakeUnique<Vector<Persistent<StyleImage>>>(); 1117 WTF::MakeUnique<Vector<Persistent<StyleImage>>>();
1117 } 1118 }
1118 rare_non_inherited_data_.Access()->paint_images_->push_back(image); 1119 rare_non_inherited_data_.Access()->paint_images_->push_back(image);
1119 } 1120 }
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after
2385 NinePieceImage::ComputeOutset(image.Outset().Top(), BorderTopWidth()), 2386 NinePieceImage::ComputeOutset(image.Outset().Top(), BorderTopWidth()),
2386 NinePieceImage::ComputeOutset(image.Outset().Right(), BorderRightWidth()), 2387 NinePieceImage::ComputeOutset(image.Outset().Right(), BorderRightWidth()),
2387 NinePieceImage::ComputeOutset(image.Outset().Bottom(), 2388 NinePieceImage::ComputeOutset(image.Outset().Bottom(),
2388 BorderBottomWidth()), 2389 BorderBottomWidth()),
2389 NinePieceImage::ComputeOutset(image.Outset().Left(), BorderLeftWidth())); 2390 NinePieceImage::ComputeOutset(image.Outset().Left(), BorderLeftWidth()));
2390 } 2391 }
2391 2392
2392 void ComputedStyle::SetBorderImageSource(StyleImage* image) { 2393 void ComputedStyle::SetBorderImageSource(StyleImage* image) {
2393 if (Border().image_.GetImage() == image) 2394 if (Border().image_.GetImage() == image)
2394 return; 2395 return;
2395 surround_.Access()->border_.image_.SetImage(image); 2396 surround_data_.Access()->border_.image_.SetImage(image);
2396 } 2397 }
2397 2398
2398 void ComputedStyle::SetBorderImageSlices(const LengthBox& slices) { 2399 void ComputedStyle::SetBorderImageSlices(const LengthBox& slices) {
2399 if (Border().image_.ImageSlices() == slices) 2400 if (Border().image_.ImageSlices() == slices)
2400 return; 2401 return;
2401 surround_.Access()->border_.image_.SetImageSlices(slices); 2402 surround_data_.Access()->border_.image_.SetImageSlices(slices);
2402 } 2403 }
2403 2404
2404 void ComputedStyle::SetBorderImageSlicesFill(bool fill) { 2405 void ComputedStyle::SetBorderImageSlicesFill(bool fill) {
2405 if (Border().image_.Fill() == fill) 2406 if (Border().image_.Fill() == fill)
2406 return; 2407 return;
2407 surround_.Access()->border_.image_.SetFill(fill); 2408 surround_data_.Access()->border_.image_.SetFill(fill);
2408 } 2409 }
2409 2410
2410 void ComputedStyle::SetBorderImageWidth(const BorderImageLengthBox& slices) { 2411 void ComputedStyle::SetBorderImageWidth(const BorderImageLengthBox& slices) {
2411 if (Border().image_.BorderSlices() == slices) 2412 if (Border().image_.BorderSlices() == slices)
2412 return; 2413 return;
2413 surround_.Access()->border_.image_.SetBorderSlices(slices); 2414 surround_data_.Access()->border_.image_.SetBorderSlices(slices);
2414 } 2415 }
2415 2416
2416 void ComputedStyle::SetBorderImageOutset(const BorderImageLengthBox& outset) { 2417 void ComputedStyle::SetBorderImageOutset(const BorderImageLengthBox& outset) {
2417 if (Border().image_.Outset() == outset) 2418 if (Border().image_.Outset() == outset)
2418 return; 2419 return;
2419 surround_.Access()->border_.image_.SetOutset(outset); 2420 surround_data_.Access()->border_.image_.SetOutset(outset);
2420 } 2421 }
2421 2422
2422 bool ComputedStyle::BorderObscuresBackground() const { 2423 bool ComputedStyle::BorderObscuresBackground() const {
2423 if (!HasBorder()) 2424 if (!HasBorder())
2424 return false; 2425 return false;
2425 2426
2426 // Bail if we have any border-image for now. We could look at the image alpha 2427 // Bail if we have any border-image for now. We could look at the image alpha
2427 // to improve this. 2428 // to improve this.
2428 if (BorderImage().GetImage()) 2429 if (BorderImage().GetImage())
2429 return false; 2430 return false;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
2503 if (value < 0) 2504 if (value < 0)
2504 fvalue -= 0.5f; 2505 fvalue -= 0.5f;
2505 else 2506 else
2506 fvalue += 0.5f; 2507 fvalue += 0.5f;
2507 } 2508 }
2508 2509
2509 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); 2510 return RoundForImpreciseConversion<int>(fvalue / zoom_factor);
2510 } 2511 }
2511 2512
2512 } // namespace blink 2513 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698