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

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

Issue 2897193005: Generate diffs for all fields on StyleRareInheritedData (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
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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 // do that yet. We need to make sure SimplifiedLayout can operate 643 // do that yet. We need to make sure SimplifiedLayout can operate
644 // correctly on LayoutInlines (we will need to add a 644 // correctly on LayoutInlines (we will need to add a
645 // selfNeedsSimplifiedLayout bit in order to not get confused and taint 645 // selfNeedsSimplifiedLayout bit in order to not get confused and taint
646 // every line). In addition we need to solve the floating object issue 646 // every line). In addition we need to solve the floating object issue
647 // when layers come and go. Right now a full layout is necessary to keep 647 // when layers come and go. Right now a full layout is necessary to keep
648 // floating object lists sane. 648 // floating object lists sane.
649 return true; 649 return true;
650 } 650 }
651 } 651 }
652 652
653 if (rare_inherited_data_.Get() != other.rare_inherited_data_.Get()) {
654 if (rare_inherited_data_->highlight_ !=
655 other.rare_inherited_data_->highlight_ ||
656 rare_inherited_data_->text_indent_ !=
657 other.rare_inherited_data_->text_indent_ ||
658 rare_inherited_data_->text_align_last_ !=
659 other.rare_inherited_data_->text_align_last_ ||
660 rare_inherited_data_->text_indent_line_ !=
661 other.rare_inherited_data_->text_indent_line_ ||
662 rare_inherited_data_->effective_zoom_ !=
663 other.rare_inherited_data_->effective_zoom_ ||
664 rare_inherited_data_->word_break_ !=
665 other.rare_inherited_data_->word_break_ ||
666 rare_inherited_data_->overflow_wrap_ !=
667 other.rare_inherited_data_->overflow_wrap_ ||
668 rare_inherited_data_->line_break_ !=
669 other.rare_inherited_data_->line_break_ ||
670 rare_inherited_data_->text_security_ !=
671 other.rare_inherited_data_->text_security_ ||
672 rare_inherited_data_->hyphens_ !=
673 other.rare_inherited_data_->hyphens_ ||
674 rare_inherited_data_->hyphenation_limit_before_ !=
675 other.rare_inherited_data_->hyphenation_limit_before_ ||
676 rare_inherited_data_->hyphenation_limit_after_ !=
677 other.rare_inherited_data_->hyphenation_limit_after_ ||
678 rare_inherited_data_->hyphenation_string_ !=
679 other.rare_inherited_data_->hyphenation_string_ ||
680 rare_inherited_data_->respect_image_orientation_ !=
681 other.rare_inherited_data_->respect_image_orientation_ ||
682 rare_inherited_data_->ruby_position_ !=
683 other.rare_inherited_data_->ruby_position_ ||
684 rare_inherited_data_->text_emphasis_mark_ !=
685 other.rare_inherited_data_->text_emphasis_mark_ ||
686 rare_inherited_data_->text_emphasis_position_ !=
687 other.rare_inherited_data_->text_emphasis_position_ ||
688 rare_inherited_data_->text_emphasis_custom_mark_ !=
689 other.rare_inherited_data_->text_emphasis_custom_mark_ ||
690 rare_inherited_data_->text_justify_ !=
691 other.rare_inherited_data_->text_justify_ ||
692 rare_inherited_data_->text_orientation_ !=
693 other.rare_inherited_data_->text_orientation_ ||
694 rare_inherited_data_->text_combine_ !=
695 other.rare_inherited_data_->text_combine_ ||
696 rare_inherited_data_->tab_size_ !=
697 other.rare_inherited_data_->tab_size_ ||
698 rare_inherited_data_->text_size_adjust_ !=
699 other.rare_inherited_data_->text_size_adjust_ ||
700 rare_inherited_data_->list_style_image_ !=
701 other.rare_inherited_data_->list_style_image_ ||
702 rare_inherited_data_->line_height_step_ !=
703 other.rare_inherited_data_->line_height_step_ ||
704 rare_inherited_data_->text_stroke_width_ !=
705 other.rare_inherited_data_->text_stroke_width_)
706 return true;
707 }
708
709 if (IsDisplayTableType(Display())) { 653 if (IsDisplayTableType(Display())) {
710 if (BorderCollapse() != other.BorderCollapse() || 654 if (ComputedStyleBase::
711 EmptyCells() != other.EmptyCells() || 655 DiffNeedsFullLayoutAndPaintInvalidationDisplayTableType(other))
712 CaptionSide() != other.CaptionSide() ||
713 TableLayout() != other.TableLayout())
714 return true; 656 return true;
715 657
716 // In the collapsing border model, 'hidden' suppresses other borders, while 658 // In the collapsing border model, 'hidden' suppresses other borders, while
717 // 'none' does not, so these style differences can be width differences. 659 // 'none' does not, so these style differences can be width differences.
718 if ((BorderCollapse() == EBorderCollapse::kCollapse) && 660 if ((BorderCollapse() == EBorderCollapse::kCollapse) &&
719 ((BorderTopStyle() == EBorderStyle::kHidden && 661 ((BorderTopStyle() == EBorderStyle::kHidden &&
720 other.BorderTopStyle() == EBorderStyle::kNone) || 662 other.BorderTopStyle() == EBorderStyle::kNone) ||
721 (BorderTopStyle() == EBorderStyle::kNone && 663 (BorderTopStyle() == EBorderStyle::kNone &&
722 other.BorderTopStyle() == EBorderStyle::kHidden) || 664 other.BorderTopStyle() == EBorderStyle::kHidden) ||
723 (BorderBottomStyle() == EBorderStyle::kHidden && 665 (BorderBottomStyle() == EBorderStyle::kHidden &&
724 other.BorderBottomStyle() == EBorderStyle::kNone) || 666 other.BorderBottomStyle() == EBorderStyle::kNone) ||
725 (BorderBottomStyle() == EBorderStyle::kNone && 667 (BorderBottomStyle() == EBorderStyle::kNone &&
726 other.BorderBottomStyle() == EBorderStyle::kHidden) || 668 other.BorderBottomStyle() == EBorderStyle::kHidden) ||
727 (BorderLeftStyle() == EBorderStyle::kHidden && 669 (BorderLeftStyle() == EBorderStyle::kHidden &&
728 other.BorderLeftStyle() == EBorderStyle::kNone) || 670 other.BorderLeftStyle() == EBorderStyle::kNone) ||
729 (BorderLeftStyle() == EBorderStyle::kNone && 671 (BorderLeftStyle() == EBorderStyle::kNone &&
730 other.BorderLeftStyle() == EBorderStyle::kHidden) || 672 other.BorderLeftStyle() == EBorderStyle::kHidden) ||
731 (BorderRightStyle() == EBorderStyle::kHidden && 673 (BorderRightStyle() == EBorderStyle::kHidden &&
732 other.BorderRightStyle() == EBorderStyle::kNone) || 674 other.BorderRightStyle() == EBorderStyle::kNone) ||
733 (BorderRightStyle() == EBorderStyle::kNone && 675 (BorderRightStyle() == EBorderStyle::kNone &&
734 other.BorderRightStyle() == EBorderStyle::kHidden))) 676 other.BorderRightStyle() == EBorderStyle::kHidden)))
735 return true; 677 return true;
736 } else if (Display() == EDisplay::kListItem) { 678 } else if (Display() == EDisplay::kListItem) {
737 if (ListStyleType() != other.ListStyleType() || 679 if (ComputedStyleBase::
738 ListStylePosition() != other.ListStylePosition()) 680 DiffNeedsFullLayoutAndPaintInvalidationDisplayListItem(other))
739 return true; 681 return true;
740 } 682 }
741 683
742 if ((Visibility() == EVisibility::kCollapse) != 684 if ((Visibility() == EVisibility::kCollapse) !=
743 (other.Visibility() == EVisibility::kCollapse)) 685 (other.Visibility() == EVisibility::kCollapse))
744 return true; 686 return true;
745 687
746 // Movement of non-static-positioned object is special cased in 688 // Movement of non-static-positioned object is special cased in
747 // ComputedStyle::VisualInvalidationDiff(). 689 // ComputedStyle::VisualInvalidationDiff().
748 690
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 747
806 bool ComputedStyle::DiffNeedsPaintInvalidationObject( 748 bool ComputedStyle::DiffNeedsPaintInvalidationObject(
807 const ComputedStyle& other) const { 749 const ComputedStyle& other) const {
808 if (ComputedStyleBase::DiffNeedsPaintInvalidationObject(other)) 750 if (ComputedStyleBase::DiffNeedsPaintInvalidationObject(other))
809 return true; 751 return true;
810 752
811 if (!BorderVisuallyEqual(other) || !RadiiEqual(other) || 753 if (!BorderVisuallyEqual(other) || !RadiiEqual(other) ||
812 *background_data_ != *other.background_data_) 754 *background_data_ != *other.background_data_)
813 return true; 755 return true;
814 756
815 if (rare_inherited_data_.Get() != other.rare_inherited_data_.Get()) {
816 if (rare_inherited_data_->user_modify_ !=
817 other.rare_inherited_data_->user_modify_ ||
818 rare_inherited_data_->user_select_ !=
819 other.rare_inherited_data_->user_select_ ||
820 rare_inherited_data_->image_rendering_ !=
821 other.rare_inherited_data_->image_rendering_)
822 return true;
823 }
824
825 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) { 757 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) {
826 if (rare_non_inherited_data_->user_drag != 758 if (rare_non_inherited_data_->user_drag !=
827 other.rare_non_inherited_data_->user_drag || 759 other.rare_non_inherited_data_->user_drag ||
828 rare_non_inherited_data_->object_fit_ != 760 rare_non_inherited_data_->object_fit_ !=
829 other.rare_non_inherited_data_->object_fit_ || 761 other.rare_non_inherited_data_->object_fit_ ||
830 rare_non_inherited_data_->object_position_ != 762 rare_non_inherited_data_->object_position_ !=
831 other.rare_non_inherited_data_->object_position_ || 763 other.rare_non_inherited_data_->object_position_ ||
832 !rare_non_inherited_data_->ShadowDataEquivalent( 764 !rare_non_inherited_data_->ShadowDataEquivalent(
833 *other.rare_non_inherited_data_.Get()) || 765 *other.rare_non_inherited_data_.Get()) ||
834 !rare_non_inherited_data_->ShapeOutsideDataEquivalent( 766 !rare_non_inherited_data_->ShapeOutsideDataEquivalent(
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 other.rare_inherited_data_->text_emphasis_fill_ || 924 other.rare_inherited_data_->text_emphasis_fill_ ||
993 rare_inherited_data_->text_underline_position_ != 925 rare_inherited_data_->text_underline_position_ !=
994 other.rare_inherited_data_->text_underline_position_ || 926 other.rare_inherited_data_->text_underline_position_ ||
995 rare_inherited_data_->text_decoration_skip_ != 927 rare_inherited_data_->text_decoration_skip_ !=
996 other.rare_inherited_data_->text_decoration_skip_ || 928 other.rare_inherited_data_->text_decoration_skip_ ||
997 rare_inherited_data_->applied_text_decorations_ != 929 rare_inherited_data_->applied_text_decorations_ !=
998 other.rare_inherited_data_->applied_text_decorations_ || 930 other.rare_inherited_data_->applied_text_decorations_ ||
999 CaretColor() != CaretColor() || 931 CaretColor() != CaretColor() ||
1000 VisitedLinkCaretColor() != other.VisitedLinkCaretColor()))) { 932 VisitedLinkCaretColor() != other.VisitedLinkCaretColor()))) {
1001 diff.SetTextDecorationOrColorChanged(); 933 diff.SetTextDecorationOrColorChanged();
934 } else {
shend 2017/05/25 08:20:19 Where did this come from?
nainar 2017/05/25 08:38:50 Aaaah landed two patches and the diff changed. Upl
935 if (rare_non_inherited_data_.Get() !=
936 other.rare_non_inherited_data_.Get() &&
937 (rare_non_inherited_data_->text_decoration_style_ !=
938 other.rare_non_inherited_data_->text_decoration_style_ ||
939 rare_non_inherited_data_->text_decoration_color_ !=
940 other.rare_non_inherited_data_->text_decoration_color_ ||
941 rare_non_inherited_data_->visited_link_text_decoration_color_ !=
942 other.rare_non_inherited_data_
943 ->visited_link_text_decoration_color_)) {
944 diff.SetTextDecorationOrColorChanged();
945 } else {
946 if (ComputedStyleBase::
947 UpdatePropertySpecificDifferencesTextDecorationOrColor(other)) {
948 diff.SetTextDecorationOrColorChanged();
949 }
950 }
1002 } 951 }
1003 } 952 }
1004 953
1005 bool has_clip = HasOutOfFlowPosition() && !visual_data_->has_auto_clip_; 954 bool has_clip = HasOutOfFlowPosition() && !visual_data_->has_auto_clip_;
1006 bool other_has_clip = 955 bool other_has_clip =
1007 other.HasOutOfFlowPosition() && !other.visual_data_->has_auto_clip_; 956 other.HasOutOfFlowPosition() && !other.visual_data_->has_auto_clip_;
1008 if (has_clip != other_has_clip || 957 if (has_clip != other_has_clip ||
1009 (has_clip && visual_data_->clip_ != other.visual_data_->clip_)) 958 (has_clip && visual_data_->clip_ != other.visual_data_->clip_))
1010 diff.SetCSSClipChanged(); 959 diff.SetCSSClipChanged();
1011 } 960 }
(...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after
2430 if (value < 0) 2379 if (value < 0)
2431 fvalue -= 0.5f; 2380 fvalue -= 0.5f;
2432 else 2381 else
2433 fvalue += 0.5f; 2382 fvalue += 0.5f;
2434 } 2383 }
2435 2384
2436 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); 2385 return RoundForImpreciseConversion<int>(fvalue / zoom_factor);
2437 } 2386 }
2438 2387
2439 } // namespace blink 2388 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698