OLD | NEW |
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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 // Animations don't need to be checked either. We always set the new style on | 554 // Animations don't need to be checked either. We always set the new style on |
555 // the layoutObject, so we will get a chance to fire off the resulting | 555 // the layoutObject, so we will get a chance to fire off the resulting |
556 // transition properly. | 556 // transition properly. |
557 | 557 |
558 return diff; | 558 return diff; |
559 } | 559 } |
560 | 560 |
561 bool ComputedStyle::ScrollAnchorDisablingPropertyChanged( | 561 bool ComputedStyle::ScrollAnchorDisablingPropertyChanged( |
562 const ComputedStyle& other, | 562 const ComputedStyle& other, |
563 const StyleDifference& diff) const { | 563 const StyleDifference& diff) const { |
564 if (GetPosition() != other.GetPosition()) | |
565 return true; | |
566 | |
567 if (ComputedStyleBase::ScrollAnchorDisablingPropertyChanged(other)) | 564 if (ComputedStyleBase::ScrollAnchorDisablingPropertyChanged(other)) |
568 return true; | 565 return true; |
569 | 566 |
570 if (diff.TransformChanged()) | 567 if (diff.TransformChanged()) |
571 return true; | 568 return true; |
572 | 569 |
573 return false; | 570 return false; |
574 } | 571 } |
575 | 572 |
576 bool ComputedStyle::DiffNeedsFullLayoutAndPaintInvalidation( | 573 bool ComputedStyle::DiffNeedsFullLayoutAndPaintInvalidation( |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 other.rare_inherited_data_->text_stroke_width_) | 712 other.rare_inherited_data_->text_stroke_width_) |
716 return true; | 713 return true; |
717 | 714 |
718 if (!TextShadowDataEquivalent(other)) | 715 if (!TextShadowDataEquivalent(other)) |
719 return true; | 716 return true; |
720 | 717 |
721 if (!QuotesDataEquivalent(other)) | 718 if (!QuotesDataEquivalent(other)) |
722 return true; | 719 return true; |
723 } | 720 } |
724 | 721 |
725 if (inherited_data_->text_autosizing_multiplier_ != | |
726 other.inherited_data_->text_autosizing_multiplier_) | |
727 return true; | |
728 | |
729 if (inherited_data_->font_.LoadingCustomFonts() != | |
730 other.inherited_data_->font_.LoadingCustomFonts()) | |
731 return true; | |
732 | |
733 if (BoxDirection() != other.BoxDirection() || | |
734 RtlOrdering() != other.RtlOrdering() || | |
735 GetTextAlign() != other.GetTextAlign() || | |
736 TextTransform() != other.TextTransform() || | |
737 Direction() != other.Direction() || WhiteSpace() != other.WhiteSpace() || | |
738 GetWritingMode() != other.GetWritingMode()) | |
739 return true; | |
740 | |
741 if (OverflowX() != other.OverflowX() || OverflowY() != other.OverflowY() || | |
742 Clear() != other.Clear() || GetUnicodeBidi() != other.GetUnicodeBidi() || | |
743 Floating() != other.Floating() || | |
744 OriginalDisplay() != other.OriginalDisplay()) | |
745 return true; | |
746 | |
747 if (IsDisplayTableType(Display())) { | 722 if (IsDisplayTableType(Display())) { |
748 if (BorderCollapse() != other.BorderCollapse() || | 723 if (BorderCollapse() != other.BorderCollapse() || |
749 EmptyCells() != other.EmptyCells() || | 724 EmptyCells() != other.EmptyCells() || |
750 CaptionSide() != other.CaptionSide() || | 725 CaptionSide() != other.CaptionSide() || |
751 TableLayout() != other.TableLayout()) | 726 TableLayout() != other.TableLayout()) |
752 return true; | 727 return true; |
753 | 728 |
754 // In the collapsing border model, 'hidden' suppresses other borders, while | 729 // In the collapsing border model, 'hidden' suppresses other borders, while |
755 // 'none' does not, so these style differences can be width differences. | 730 // 'none' does not, so these style differences can be width differences. |
756 if ((BorderCollapse() == EBorderCollapse::kCollapse) && | 731 if ((BorderCollapse() == EBorderCollapse::kCollapse) && |
(...skipping 17 matching lines...) Expand all Loading... |
774 } else if (Display() == EDisplay::kListItem) { | 749 } else if (Display() == EDisplay::kListItem) { |
775 if (ListStyleType() != other.ListStyleType() || | 750 if (ListStyleType() != other.ListStyleType() || |
776 ListStylePosition() != other.ListStylePosition()) | 751 ListStylePosition() != other.ListStylePosition()) |
777 return true; | 752 return true; |
778 } | 753 } |
779 | 754 |
780 if ((Visibility() == EVisibility::kCollapse) != | 755 if ((Visibility() == EVisibility::kCollapse) != |
781 (other.Visibility() == EVisibility::kCollapse)) | 756 (other.Visibility() == EVisibility::kCollapse)) |
782 return true; | 757 return true; |
783 | 758 |
784 if (HasPseudoStyle(kPseudoIdScrollbar) != | |
785 other.HasPseudoStyle(kPseudoIdScrollbar)) | |
786 return true; | |
787 | |
788 // Movement of non-static-positioned object is special cased in | 759 // Movement of non-static-positioned object is special cased in |
789 // ComputedStyle::VisualInvalidationDiff(). | 760 // ComputedStyle::VisualInvalidationDiff(). |
790 | 761 |
791 return false; | 762 return false; |
792 } | 763 } |
793 | 764 |
794 bool ComputedStyle::DiffNeedsFullLayout(const ComputedStyle& other) const { | 765 bool ComputedStyle::DiffNeedsFullLayout(const ComputedStyle& other) const { |
795 if (ComputedStyleBase::DiffNeedsFullLayout(other)) | 766 if (ComputedStyleBase::DiffNeedsFullLayout(other)) |
796 return true; | 767 return true; |
797 | 768 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 rare_non_inherited_data_->mask_box_image_ != | 811 rare_non_inherited_data_->mask_box_image_ != |
841 other.rare_non_inherited_data_->mask_box_image_) | 812 other.rare_non_inherited_data_->mask_box_image_) |
842 return true; | 813 return true; |
843 } | 814 } |
844 | 815 |
845 return false; | 816 return false; |
846 } | 817 } |
847 | 818 |
848 bool ComputedStyle::DiffNeedsPaintInvalidationObject( | 819 bool ComputedStyle::DiffNeedsPaintInvalidationObject( |
849 const ComputedStyle& other) const { | 820 const ComputedStyle& other) const { |
850 if (Visibility() != other.Visibility() || | 821 if (ComputedStyleBase::DiffNeedsPaintInvalidationObject(other)) |
851 PrintColorAdjust() != other.PrintColorAdjust() || | 822 return true; |
852 InsideLink() != other.InsideLink() || !BorderVisuallyEqual(other) || | 823 |
853 !RadiiEqual(other) || *background_data_ != *other.background_data_) | 824 if (!BorderVisuallyEqual(other) || !RadiiEqual(other) || |
| 825 *background_data_ != *other.background_data_) |
854 return true; | 826 return true; |
855 | 827 |
856 if (rare_inherited_data_.Get() != other.rare_inherited_data_.Get()) { | 828 if (rare_inherited_data_.Get() != other.rare_inherited_data_.Get()) { |
857 if (rare_inherited_data_->user_modify_ != | 829 if (rare_inherited_data_->user_modify_ != |
858 other.rare_inherited_data_->user_modify_ || | 830 other.rare_inherited_data_->user_modify_ || |
859 rare_inherited_data_->user_select_ != | 831 rare_inherited_data_->user_select_ != |
860 other.rare_inherited_data_->user_select_ || | 832 other.rare_inherited_data_->user_select_ || |
861 rare_inherited_data_->image_rendering_ != | 833 rare_inherited_data_->image_rendering_ != |
862 other.rare_inherited_data_->image_rendering_) | 834 other.rare_inherited_data_->image_rendering_) |
863 return true; | 835 return true; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 } | 908 } |
937 | 909 |
938 return false; | 910 return false; |
939 } | 911 } |
940 | 912 |
941 // This doesn't include conditions needing layout or overflow recomputation | 913 // This doesn't include conditions needing layout or overflow recomputation |
942 // which implies visual rect update. | 914 // which implies visual rect update. |
943 bool ComputedStyle::DiffNeedsVisualRectUpdate( | 915 bool ComputedStyle::DiffNeedsVisualRectUpdate( |
944 const ComputedStyle& other) const { | 916 const ComputedStyle& other) const { |
945 // Visual rect is empty if visibility is hidden. | 917 // Visual rect is empty if visibility is hidden. |
946 if (Visibility() != other.Visibility()) | 918 if (ComputedStyleBase::DiffNeedsVisualRectUpdate(other)) |
947 return true; | 919 return true; |
948 | 920 |
949 // Need to update visual rect of the resizer. | 921 // Need to update visual rect of the resizer. |
950 if (Resize() != other.Resize()) | 922 if (Resize() != other.Resize()) |
951 return true; | 923 return true; |
952 | 924 |
953 return false; | 925 return false; |
954 } | 926 } |
955 | 927 |
956 void ComputedStyle::UpdatePropertySpecificDifferences( | 928 void ComputedStyle::UpdatePropertySpecificDifferences( |
(...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2480 if (value < 0) | 2452 if (value < 0) |
2481 fvalue -= 0.5f; | 2453 fvalue -= 0.5f; |
2482 else | 2454 else |
2483 fvalue += 0.5f; | 2455 fvalue += 0.5f; |
2484 } | 2456 } |
2485 | 2457 |
2486 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); | 2458 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); |
2487 } | 2459 } |
2488 | 2460 |
2489 } // namespace blink | 2461 } // namespace blink |
OLD | NEW |