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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1010 // It's possible for the old and new style transform data to be equivalent | 1010 // It's possible for the old and new style transform data to be equivalent |
1011 // while hasTransform() differs, as it checks a number of conditions aside | 1011 // while hasTransform() differs, as it checks a number of conditions aside |
1012 // from just the matrix, including but not limited to animation state. | 1012 // from just the matrix, including but not limited to animation state. |
1013 if (HasTransform() != other.HasTransform() || | 1013 if (HasTransform() != other.HasTransform() || |
1014 !TransformDataEquivalent(other) || | 1014 !TransformDataEquivalent(other) || |
1015 rare_non_inherited_data_->perspective_ != | 1015 rare_non_inherited_data_->perspective_ != |
1016 other.rare_non_inherited_data_->perspective_ || | 1016 other.rare_non_inherited_data_->perspective_ || |
1017 rare_non_inherited_data_->perspective_origin_ != | 1017 rare_non_inherited_data_->perspective_origin_ != |
1018 other.rare_non_inherited_data_->perspective_origin_) | 1018 other.rare_non_inherited_data_->perspective_origin_) |
1019 diff.SetTransformChanged(); | 1019 diff.SetTransformChanged(); |
1020 } | |
1020 | 1021 |
1022 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) { | |
1021 if (rare_non_inherited_data_->opacity != | 1023 if (rare_non_inherited_data_->opacity != |
1022 other.rare_non_inherited_data_->opacity) | 1024 other.rare_non_inherited_data_->opacity) |
1023 diff.SetOpacityChanged(); | 1025 diff.SetOpacityChanged(); |
1026 } | |
1024 | 1027 |
1028 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) { | |
1025 if (rare_non_inherited_data_->filter_ != | 1029 if (rare_non_inherited_data_->filter_ != |
1026 other.rare_non_inherited_data_->filter_) | 1030 other.rare_non_inherited_data_->filter_) |
1027 diff.SetFilterChanged(); | 1031 diff.SetFilterChanged(); |
1032 } | |
1028 | 1033 |
1034 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) { | |
1029 if (!rare_non_inherited_data_->ShadowDataEquivalent( | 1035 if (!rare_non_inherited_data_->ShadowDataEquivalent( |
1030 *other.rare_non_inherited_data_.Get())) | 1036 *other.rare_non_inherited_data_.Get())) |
1031 diff.SetNeedsRecomputeOverflow(); | 1037 diff.SetNeedsRecomputeOverflow(); |
1038 } | |
1032 | 1039 |
1040 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) { | |
1033 if (rare_non_inherited_data_->backdrop_filter_ != | 1041 if (rare_non_inherited_data_->backdrop_filter_ != |
1034 other.rare_non_inherited_data_->backdrop_filter_) | 1042 other.rare_non_inherited_data_->backdrop_filter_) |
1035 diff.SetBackdropFilterChanged(); | 1043 diff.SetBackdropFilterChanged(); |
1044 } | |
1036 | 1045 |
1046 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) { | |
1037 if (!rare_non_inherited_data_->ReflectionDataEquivalent( | 1047 if (!rare_non_inherited_data_->ReflectionDataEquivalent( |
1038 *other.rare_non_inherited_data_.Get())) | 1048 *other.rare_non_inherited_data_.Get())) |
1039 diff.SetFilterChanged(); | 1049 diff.SetFilterChanged(); |
1050 } | |
1040 | 1051 |
1052 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) { | |
1041 if (!rare_non_inherited_data_->outline_.VisuallyEqual( | 1053 if (!rare_non_inherited_data_->outline_.VisuallyEqual( |
1042 other.rare_non_inherited_data_->outline_)) | 1054 other.rare_non_inherited_data_->outline_)) |
1043 diff.SetNeedsRecomputeOverflow(); | 1055 diff.SetNeedsRecomputeOverflow(); |
1044 } | 1056 } |
1045 | 1057 |
1046 if (!Border().VisualOverflowEqual(other.Border())) | 1058 if (!Border().VisualOverflowEqual(other.Border())) |
1047 diff.SetNeedsRecomputeOverflow(); | 1059 diff.SetNeedsRecomputeOverflow(); |
1048 | 1060 |
1049 if (!diff.NeedsFullPaintInvalidation()) { | 1061 if (!diff.NeedsFullPaintInvalidation()) { |
1050 if (inherited_data_->color_ != other.inherited_data_->color_ || | 1062 if (inherited_data_->color_ != other.inherited_data_->color_ || |
1051 inherited_data_->visited_link_color_ != | 1063 inherited_data_->visited_link_color_ != |
1052 other.inherited_data_->visited_link_color_ || | 1064 other.inherited_data_->visited_link_color_ || |
1053 HasSimpleUnderlineInternal() != other.HasSimpleUnderlineInternal() || | 1065 HasSimpleUnderlineInternal() != other.HasSimpleUnderlineInternal() || |
1054 visual_data_->text_decoration != other.visual_data_->text_decoration) { | 1066 visual_data_->text_decoration != other.visual_data_->text_decoration) { |
1055 diff.SetTextDecorationOrColorChanged(); | 1067 diff.SetTextDecorationOrColorChanged(); |
1056 } else if (rare_non_inherited_data_.Get() != | 1068 } else { |
1057 other.rare_non_inherited_data_.Get() && | 1069 if (rare_non_inherited_data_.Get() != |
1058 (rare_non_inherited_data_->text_decoration_style_ != | 1070 other.rare_non_inherited_data_.Get() && |
1059 other.rare_non_inherited_data_->text_decoration_style_ || | 1071 (rare_non_inherited_data_->text_decoration_style_ != |
1060 rare_non_inherited_data_->text_decoration_color_ != | 1072 other.rare_non_inherited_data_->text_decoration_style_ || |
1061 other.rare_non_inherited_data_->text_decoration_color_ || | 1073 rare_non_inherited_data_->text_decoration_color_ != |
1062 rare_non_inherited_data_->visited_link_text_decoration_color_ != | 1074 other.rare_non_inherited_data_->text_decoration_color_ || |
1063 other.rare_non_inherited_data_ | 1075 rare_non_inherited_data_->visited_link_text_decoration_color_ != |
1064 ->visited_link_text_decoration_color_)) { | 1076 other.rare_non_inherited_data_ |
1065 diff.SetTextDecorationOrColorChanged(); | 1077 ->visited_link_text_decoration_color_)) { |
1066 } else if (rare_inherited_data_.Get() != other.rare_inherited_data_.Get() && | 1078 diff.SetTextDecorationOrColorChanged(); |
1067 (rare_inherited_data_->TextFillColor() != | 1079 } |
1068 other.rare_inherited_data_->TextFillColor() || | 1080 if (rare_inherited_data_.Get() != other.rare_inherited_data_.Get() && |
shend
2017/05/04 01:04:04
Not exactly the same behaviour as the original cod
nainar
2017/05/04 01:08:56
Yup. You're right. Wonder why this passes tests th
| |
1069 rare_inherited_data_->TextStrokeColor() != | 1081 (rare_inherited_data_->TextFillColor() != |
1070 other.rare_inherited_data_->TextStrokeColor() || | 1082 other.rare_inherited_data_->TextFillColor() || |
1071 rare_inherited_data_->TextEmphasisColor() != | 1083 rare_inherited_data_->TextStrokeColor() != |
1072 other.rare_inherited_data_->TextEmphasisColor() || | 1084 other.rare_inherited_data_->TextStrokeColor() || |
1073 rare_inherited_data_->VisitedLinkTextFillColor() != | 1085 rare_inherited_data_->TextEmphasisColor() != |
1074 other.rare_inherited_data_->VisitedLinkTextFillColor() || | 1086 other.rare_inherited_data_->TextEmphasisColor() || |
1075 rare_inherited_data_->VisitedLinkTextStrokeColor() != | 1087 rare_inherited_data_->VisitedLinkTextFillColor() != |
1076 other.rare_inherited_data_->VisitedLinkTextStrokeColor() || | 1088 other.rare_inherited_data_->VisitedLinkTextFillColor() || |
1077 rare_inherited_data_->VisitedLinkTextEmphasisColor() != | 1089 rare_inherited_data_->VisitedLinkTextStrokeColor() != |
1078 other.rare_inherited_data_ | 1090 other.rare_inherited_data_->VisitedLinkTextStrokeColor() || |
1079 ->VisitedLinkTextEmphasisColor() || | 1091 rare_inherited_data_->VisitedLinkTextEmphasisColor() != |
1080 rare_inherited_data_->text_emphasis_fill != | 1092 other.rare_inherited_data_->VisitedLinkTextEmphasisColor() || |
1081 other.rare_inherited_data_->text_emphasis_fill || | 1093 rare_inherited_data_->text_emphasis_fill != |
1082 rare_inherited_data_->text_underline_position_ != | 1094 other.rare_inherited_data_->text_emphasis_fill || |
1083 other.rare_inherited_data_->text_underline_position_ || | 1095 rare_inherited_data_->text_underline_position_ != |
1084 rare_inherited_data_->text_decoration_skip_ != | 1096 other.rare_inherited_data_->text_underline_position_ || |
1085 other.rare_inherited_data_->text_decoration_skip_ || | 1097 rare_inherited_data_->text_decoration_skip_ != |
1086 rare_inherited_data_->applied_text_decorations != | 1098 other.rare_inherited_data_->text_decoration_skip_ || |
1087 other.rare_inherited_data_->applied_text_decorations || | 1099 rare_inherited_data_->applied_text_decorations != |
1088 rare_inherited_data_->CaretColor() != | 1100 other.rare_inherited_data_->applied_text_decorations || |
1089 other.rare_inherited_data_->CaretColor() || | 1101 rare_inherited_data_->CaretColor() != |
1090 rare_inherited_data_->VisitedLinkCaretColor() != | 1102 other.rare_inherited_data_->CaretColor() || |
1091 other.rare_inherited_data_->VisitedLinkCaretColor())) { | 1103 rare_inherited_data_->VisitedLinkCaretColor() != |
1092 diff.SetTextDecorationOrColorChanged(); | 1104 other.rare_inherited_data_->VisitedLinkCaretColor())) { |
1105 diff.SetTextDecorationOrColorChanged(); | |
1106 } | |
1093 } | 1107 } |
1094 } | 1108 } |
1095 | 1109 |
1096 bool has_clip = HasOutOfFlowPosition() && !visual_data_->has_auto_clip; | 1110 bool has_clip = HasOutOfFlowPosition() && !visual_data_->has_auto_clip; |
1097 bool other_has_clip = | 1111 bool other_has_clip = |
1098 other.HasOutOfFlowPosition() && !other.visual_data_->has_auto_clip; | 1112 other.HasOutOfFlowPosition() && !other.visual_data_->has_auto_clip; |
1099 if (has_clip != other_has_clip || | 1113 if (has_clip != other_has_clip || |
1100 (has_clip && visual_data_->clip != other.visual_data_->clip)) | 1114 (has_clip && visual_data_->clip != other.visual_data_->clip)) |
1101 diff.SetCSSClipChanged(); | 1115 diff.SetCSSClipChanged(); |
1102 } | 1116 } |
(...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2497 if (value < 0) | 2511 if (value < 0) |
2498 fvalue -= 0.5f; | 2512 fvalue -= 0.5f; |
2499 else | 2513 else |
2500 fvalue += 0.5f; | 2514 fvalue += 0.5f; |
2501 } | 2515 } |
2502 | 2516 |
2503 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); | 2517 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); |
2504 } | 2518 } |
2505 | 2519 |
2506 } // namespace blink | 2520 } // namespace blink |
OLD | NEW |