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 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 rare_inherited_data_->text_size_adjust_ != | 717 rare_inherited_data_->text_size_adjust_ != |
718 other.rare_inherited_data_->text_size_adjust_ || | 718 other.rare_inherited_data_->text_size_adjust_ || |
719 rare_inherited_data_->list_style_image_ != | 719 rare_inherited_data_->list_style_image_ != |
720 other.rare_inherited_data_->list_style_image_ || | 720 other.rare_inherited_data_->list_style_image_ || |
721 rare_inherited_data_->line_height_step_ != | 721 rare_inherited_data_->line_height_step_ != |
722 other.rare_inherited_data_->line_height_step_ || | 722 other.rare_inherited_data_->line_height_step_ || |
723 rare_inherited_data_->text_stroke_width_ != | 723 rare_inherited_data_->text_stroke_width_ != |
724 other.rare_inherited_data_->text_stroke_width_) | 724 other.rare_inherited_data_->text_stroke_width_) |
725 return true; | 725 return true; |
726 | 726 |
727 if (!rare_inherited_data_->ShadowDataEquivalent( | 727 if (!TextShadowDataEquivalent(other)) |
728 *other.rare_inherited_data_.Get())) | |
729 return true; | 728 return true; |
730 | 729 |
731 if (!rare_inherited_data_->QuotesDataEquivalent( | 730 if (!QuotesDataEquivalent(other)) |
732 *other.rare_inherited_data_.Get())) | |
733 return true; | 731 return true; |
734 } | 732 } |
735 | 733 |
736 if (inherited_data_->text_autosizing_multiplier_ != | 734 if (inherited_data_->text_autosizing_multiplier_ != |
737 other.inherited_data_->text_autosizing_multiplier_) | 735 other.inherited_data_->text_autosizing_multiplier_) |
738 return true; | 736 return true; |
739 | 737 |
740 if (inherited_data_->font_.LoadingCustomFonts() != | 738 if (inherited_data_->font_.LoadingCustomFonts() != |
741 other.inherited_data_->font_.LoadingCustomFonts()) | 739 other.inherited_data_->font_.LoadingCustomFonts()) |
742 return true; | 740 return true; |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 } | 1104 } |
1107 | 1105 |
1108 void ComputedStyle::SetCursorList(CursorList* other) { | 1106 void ComputedStyle::SetCursorList(CursorList* other) { |
1109 rare_inherited_data_.Access()->cursor_data_ = other; | 1107 rare_inherited_data_.Access()->cursor_data_ = other; |
1110 } | 1108 } |
1111 | 1109 |
1112 void ComputedStyle::SetQuotes(PassRefPtr<QuotesData> q) { | 1110 void ComputedStyle::SetQuotes(PassRefPtr<QuotesData> q) { |
1113 rare_inherited_data_.Access()->quotes_ = std::move(q); | 1111 rare_inherited_data_.Access()->quotes_ = std::move(q); |
1114 } | 1112 } |
1115 | 1113 |
| 1114 bool ComputedStyle::QuotesDataEquivalent(const ComputedStyle& other) const { |
| 1115 return DataEquivalent(Quotes(), other.Quotes()); |
| 1116 } |
| 1117 |
1116 void ComputedStyle::ClearCursorList() { | 1118 void ComputedStyle::ClearCursorList() { |
1117 if (rare_inherited_data_->cursor_data_) | 1119 if (rare_inherited_data_->cursor_data_) |
1118 rare_inherited_data_.Access()->cursor_data_ = nullptr; | 1120 rare_inherited_data_.Access()->cursor_data_ = nullptr; |
1119 } | 1121 } |
1120 | 1122 |
1121 static bool HasPropertyThatCreatesStackingContext( | 1123 static bool HasPropertyThatCreatesStackingContext( |
1122 const Vector<CSSPropertyID>& properties) { | 1124 const Vector<CSSPropertyID>& properties) { |
1123 for (CSSPropertyID property : properties) { | 1125 for (CSSPropertyID property : properties) { |
1124 switch (property) { | 1126 switch (property) { |
1125 case CSSPropertyOpacity: | 1127 case CSSPropertyOpacity: |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1371 | 1373 |
1372 if (position.X() != Length(kAuto) || anchor.X() != Length(kAuto)) | 1374 if (position.X() != Length(kAuto) || anchor.X() != Length(kAuto)) |
1373 // Shift the origin back to transform-origin. | 1375 // Shift the origin back to transform-origin. |
1374 transform.Translate(-origin_shift_x, -origin_shift_y); | 1376 transform.Translate(-origin_shift_x, -origin_shift_y); |
1375 } | 1377 } |
1376 | 1378 |
1377 void ComputedStyle::SetTextShadow(PassRefPtr<ShadowList> s) { | 1379 void ComputedStyle::SetTextShadow(PassRefPtr<ShadowList> s) { |
1378 rare_inherited_data_.Access()->text_shadow_ = std::move(s); | 1380 rare_inherited_data_.Access()->text_shadow_ = std::move(s); |
1379 } | 1381 } |
1380 | 1382 |
| 1383 bool ComputedStyle::TextShadowDataEquivalent(const ComputedStyle& other) const { |
| 1384 return DataEquivalent(TextShadow(), other.TextShadow()); |
| 1385 } |
| 1386 |
1381 void ComputedStyle::SetBoxShadow(PassRefPtr<ShadowList> s) { | 1387 void ComputedStyle::SetBoxShadow(PassRefPtr<ShadowList> s) { |
1382 rare_non_inherited_data_.Access()->box_shadow_ = std::move(s); | 1388 rare_non_inherited_data_.Access()->box_shadow_ = std::move(s); |
1383 } | 1389 } |
1384 | 1390 |
1385 static FloatRoundedRect::Radii CalcRadiiFor(const BorderData& border, | 1391 static FloatRoundedRect::Radii CalcRadiiFor(const BorderData& border, |
1386 const LengthSize& top_left, | 1392 const LengthSize& top_left, |
1387 const LengthSize& top_right, | 1393 const LengthSize& top_right, |
1388 const LengthSize& bottom_left, | 1394 const LengthSize& bottom_left, |
1389 const LengthSize& bottom_right, | 1395 const LengthSize& bottom_right, |
1390 LayoutSize size) { | 1396 LayoutSize size) { |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2506 if (value < 0) | 2512 if (value < 0) |
2507 fvalue -= 0.5f; | 2513 fvalue -= 0.5f; |
2508 else | 2514 else |
2509 fvalue += 0.5f; | 2515 fvalue += 0.5f; |
2510 } | 2516 } |
2511 | 2517 |
2512 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); | 2518 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); |
2513 } | 2519 } |
2514 | 2520 |
2515 } // namespace blink | 2521 } // namespace blink |
OLD | NEW |