| 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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 if (!rare_non_inherited_data_.Access()->paint_images_) { | 904 if (!rare_non_inherited_data_.Access()->paint_images_) { |
| 905 rare_non_inherited_data_.Access()->paint_images_ = | 905 rare_non_inherited_data_.Access()->paint_images_ = |
| 906 WTF::MakeUnique<PaintImages>(); | 906 WTF::MakeUnique<PaintImages>(); |
| 907 } | 907 } |
| 908 rare_non_inherited_data_.Access()->paint_images_->push_back(image); | 908 rare_non_inherited_data_.Access()->paint_images_->push_back(image); |
| 909 } | 909 } |
| 910 | 910 |
| 911 void ComputedStyle::AddCursor(StyleImage* image, | 911 void ComputedStyle::AddCursor(StyleImage* image, |
| 912 bool hot_spot_specified, | 912 bool hot_spot_specified, |
| 913 const IntPoint& hot_spot) { | 913 const IntPoint& hot_spot) { |
| 914 if (!rare_inherited_data_.Access()->cursor_data_) | 914 if (!CursorDataInternal()) |
| 915 rare_inherited_data_.Access()->cursor_data_ = new CursorList; | 915 SetCursorDataInternal(new CursorList); |
| 916 rare_inherited_data_.Access()->cursor_data_->push_back( | 916 MutableCursorDataInternal()->push_back( |
| 917 CursorData(image, hot_spot_specified, hot_spot)); | 917 CursorData(image, hot_spot_specified, hot_spot)); |
| 918 } | 918 } |
| 919 | 919 |
| 920 void ComputedStyle::SetCursorList(CursorList* other) { | 920 void ComputedStyle::SetCursorList(CursorList* other) { |
| 921 rare_inherited_data_.Access()->cursor_data_ = other; | 921 SetCursorDataInternal(other); |
| 922 } | 922 } |
| 923 | 923 |
| 924 void ComputedStyle::SetQuotes(RefPtr<QuotesData> q) { | 924 void ComputedStyle::SetQuotes(RefPtr<QuotesData> q) { |
| 925 rare_inherited_data_.Access()->quotes_ = std::move(q); | 925 SetQuotesInternal(q); |
| 926 } | 926 } |
| 927 | 927 |
| 928 bool ComputedStyle::QuotesDataEquivalent(const ComputedStyle& other) const { | 928 bool ComputedStyle::QuotesDataEquivalent(const ComputedStyle& other) const { |
| 929 return DataEquivalent(Quotes(), other.Quotes()); | 929 return DataEquivalent(Quotes(), other.Quotes()); |
| 930 } | 930 } |
| 931 | 931 |
| 932 void ComputedStyle::ClearCursorList() { | 932 void ComputedStyle::ClearCursorList() { |
| 933 if (rare_inherited_data_->cursor_data_) | 933 if (CursorDataInternal()) |
| 934 rare_inherited_data_.Access()->cursor_data_ = nullptr; | 934 SetCursorDataInternal(nullptr); |
| 935 } | 935 } |
| 936 | 936 |
| 937 static bool HasPropertyThatCreatesStackingContext( | 937 static bool HasPropertyThatCreatesStackingContext( |
| 938 const Vector<CSSPropertyID>& properties) { | 938 const Vector<CSSPropertyID>& properties) { |
| 939 for (CSSPropertyID property : properties) { | 939 for (CSSPropertyID property : properties) { |
| 940 switch (property) { | 940 switch (property) { |
| 941 case CSSPropertyOpacity: | 941 case CSSPropertyOpacity: |
| 942 case CSSPropertyTransform: | 942 case CSSPropertyTransform: |
| 943 case CSSPropertyAliasWebkitTransform: | 943 case CSSPropertyAliasWebkitTransform: |
| 944 case CSSPropertyTransformStyle: | 944 case CSSPropertyTransformStyle: |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 transform.Translate(point.X() - origin_x + origin_shift_x, | 1200 transform.Translate(point.X() - origin_x + origin_shift_x, |
| 1201 point.Y() - origin_y + origin_shift_y); | 1201 point.Y() - origin_y + origin_shift_y); |
| 1202 transform.Rotate(angle + motion_data.rotation_.angle); | 1202 transform.Rotate(angle + motion_data.rotation_.angle); |
| 1203 | 1203 |
| 1204 if (position.X() != Length(kAuto) || anchor.X() != Length(kAuto)) | 1204 if (position.X() != Length(kAuto) || anchor.X() != Length(kAuto)) |
| 1205 // Shift the origin back to transform-origin. | 1205 // Shift the origin back to transform-origin. |
| 1206 transform.Translate(-origin_shift_x, -origin_shift_y); | 1206 transform.Translate(-origin_shift_x, -origin_shift_y); |
| 1207 } | 1207 } |
| 1208 | 1208 |
| 1209 void ComputedStyle::SetTextShadow(RefPtr<ShadowList> s) { | 1209 void ComputedStyle::SetTextShadow(RefPtr<ShadowList> s) { |
| 1210 rare_inherited_data_.Access()->text_shadow_ = std::move(s); | 1210 SetTextShadowInternal(s); |
| 1211 } | 1211 } |
| 1212 | 1212 |
| 1213 bool ComputedStyle::TextShadowDataEquivalent(const ComputedStyle& other) const { | 1213 bool ComputedStyle::TextShadowDataEquivalent(const ComputedStyle& other) const { |
| 1214 return DataEquivalent(TextShadow(), other.TextShadow()); | 1214 return DataEquivalent(TextShadow(), other.TextShadow()); |
| 1215 } | 1215 } |
| 1216 | 1216 |
| 1217 void ComputedStyle::SetBoxShadow(RefPtr<ShadowList> s) { | 1217 void ComputedStyle::SetBoxShadow(RefPtr<ShadowList> s) { |
| 1218 rare_non_inherited_data_.Access()->box_shadow_ = std::move(s); | 1218 rare_non_inherited_data_.Access()->box_shadow_ = std::move(s); |
| 1219 } | 1219 } |
| 1220 | 1220 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1232 FloatValueForLength(top_right.Height(), size.Height().ToFloat())), | 1232 FloatValueForLength(top_right.Height(), size.Height().ToFloat())), |
| 1233 FloatSize( | 1233 FloatSize( |
| 1234 FloatValueForLength(bottom_left.Width(), size.Width().ToFloat()), | 1234 FloatValueForLength(bottom_left.Width(), size.Width().ToFloat()), |
| 1235 FloatValueForLength(bottom_left.Height(), size.Height().ToFloat())), | 1235 FloatValueForLength(bottom_left.Height(), size.Height().ToFloat())), |
| 1236 FloatSize( | 1236 FloatSize( |
| 1237 FloatValueForLength(bottom_right.Width(), size.Width().ToFloat()), | 1237 FloatValueForLength(bottom_right.Width(), size.Width().ToFloat()), |
| 1238 FloatValueForLength(bottom_right.Height(), size.Height().ToFloat()))); | 1238 FloatValueForLength(bottom_right.Height(), size.Height().ToFloat()))); |
| 1239 } | 1239 } |
| 1240 | 1240 |
| 1241 StyleImage* ComputedStyle::ListStyleImage() const { | 1241 StyleImage* ComputedStyle::ListStyleImage() const { |
| 1242 return rare_inherited_data_->list_style_image_.Get(); | 1242 return ListStyleImageInternal(); |
| 1243 } | 1243 } |
| 1244 void ComputedStyle::SetListStyleImage(StyleImage* v) { | 1244 void ComputedStyle::SetListStyleImage(StyleImage* v) { |
| 1245 if (rare_inherited_data_->list_style_image_ != v) | 1245 SetListStyleImageInternal(v); |
| 1246 rare_inherited_data_.Access()->list_style_image_ = v; | |
| 1247 } | 1246 } |
| 1248 | 1247 |
| 1249 Color ComputedStyle::GetColor() const { | 1248 Color ComputedStyle::GetColor() const { |
| 1250 return ColorInternal(); | 1249 return ColorInternal(); |
| 1251 } | 1250 } |
| 1252 void ComputedStyle::SetColor(const Color& v) { | 1251 void ComputedStyle::SetColor(const Color& v) { |
| 1253 SetColorInternal(v); | 1252 SetColorInternal(v); |
| 1254 } | 1253 } |
| 1255 | 1254 |
| 1256 FloatRoundedRect ComputedStyle::GetRoundedBorderFor( | 1255 FloatRoundedRect ComputedStyle::GetRoundedBorderFor( |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1400 return Locale(); | 1399 return Locale(); |
| 1401 } | 1400 } |
| 1402 | 1401 |
| 1403 Hyphenation* ComputedStyle::GetHyphenation() const { | 1402 Hyphenation* ComputedStyle::GetHyphenation() const { |
| 1404 return GetHyphens() == Hyphens::kAuto | 1403 return GetHyphens() == Hyphens::kAuto |
| 1405 ? GetFontDescription().LocaleOrDefault().GetHyphenation() | 1404 ? GetFontDescription().LocaleOrDefault().GetHyphenation() |
| 1406 : nullptr; | 1405 : nullptr; |
| 1407 } | 1406 } |
| 1408 | 1407 |
| 1409 const AtomicString& ComputedStyle::HyphenString() const { | 1408 const AtomicString& ComputedStyle::HyphenString() const { |
| 1410 const AtomicString& hyphenation_string = | 1409 const AtomicString& hyphenation_string = HyphenationString(); |
| 1411 rare_inherited_data_.Get()->hyphenation_string_; | |
| 1412 if (!hyphenation_string.IsNull()) | 1410 if (!hyphenation_string.IsNull()) |
| 1413 return hyphenation_string; | 1411 return hyphenation_string; |
| 1414 | 1412 |
| 1415 // FIXME: This should depend on locale. | 1413 // FIXME: This should depend on locale. |
| 1416 DEFINE_STATIC_LOCAL(AtomicString, hyphen_minus_string, | 1414 DEFINE_STATIC_LOCAL(AtomicString, hyphen_minus_string, |
| 1417 (&kHyphenMinusCharacter, 1)); | 1415 (&kHyphenMinusCharacter, 1)); |
| 1418 DEFINE_STATIC_LOCAL(AtomicString, hyphen_string, (&kHyphenCharacter, 1)); | 1416 DEFINE_STATIC_LOCAL(AtomicString, hyphen_string, (&kHyphenCharacter, 1)); |
| 1419 const SimpleFontData* primary_font = GetFont().PrimaryFont(); | 1417 const SimpleFontData* primary_font = GetFont().PrimaryFont(); |
| 1420 DCHECK(primary_font); | 1418 DCHECK(primary_font); |
| 1421 return primary_font && primary_font->GlyphForCharacter(kHyphenCharacter) | 1419 return primary_font && primary_font->GlyphForCharacter(kHyphenCharacter) |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1523 FontWeight ComputedStyle::GetFontWeight() const { | 1521 FontWeight ComputedStyle::GetFontWeight() const { |
| 1524 return GetFontDescription().Weight(); | 1522 return GetFontDescription().Weight(); |
| 1525 } | 1523 } |
| 1526 FontStretch ComputedStyle::GetFontStretch() const { | 1524 FontStretch ComputedStyle::GetFontStretch() const { |
| 1527 return GetFontDescription().Stretch(); | 1525 return GetFontDescription().Stretch(); |
| 1528 } | 1526 } |
| 1529 | 1527 |
| 1530 TextDecoration ComputedStyle::TextDecorationsInEffect() const { | 1528 TextDecoration ComputedStyle::TextDecorationsInEffect() const { |
| 1531 if (HasSimpleUnderlineInternal()) | 1529 if (HasSimpleUnderlineInternal()) |
| 1532 return TextDecoration::kUnderline; | 1530 return TextDecoration::kUnderline; |
| 1533 if (!rare_inherited_data_->applied_text_decorations_) | 1531 if (!AppliedTextDecorationsInternal()) |
| 1534 return TextDecoration::kNone; | 1532 return TextDecoration::kNone; |
| 1535 | 1533 |
| 1536 TextDecoration decorations = TextDecoration::kNone; | 1534 TextDecoration decorations = TextDecoration::kNone; |
| 1537 | 1535 |
| 1538 const Vector<AppliedTextDecoration>& applied = AppliedTextDecorations(); | 1536 const Vector<AppliedTextDecoration>& applied = AppliedTextDecorations(); |
| 1539 | 1537 |
| 1540 for (size_t i = 0; i < applied.size(); ++i) | 1538 for (size_t i = 0; i < applied.size(); ++i) |
| 1541 decorations |= applied[i].Lines(); | 1539 decorations |= applied[i].Lines(); |
| 1542 | 1540 |
| 1543 return decorations; | 1541 return decorations; |
| 1544 } | 1542 } |
| 1545 | 1543 |
| 1546 const Vector<AppliedTextDecoration>& ComputedStyle::AppliedTextDecorations() | 1544 const Vector<AppliedTextDecoration>& ComputedStyle::AppliedTextDecorations() |
| 1547 const { | 1545 const { |
| 1548 if (HasSimpleUnderlineInternal()) { | 1546 if (HasSimpleUnderlineInternal()) { |
| 1549 DEFINE_STATIC_LOCAL( | 1547 DEFINE_STATIC_LOCAL( |
| 1550 Vector<AppliedTextDecoration>, underline, | 1548 Vector<AppliedTextDecoration>, underline, |
| 1551 (1, AppliedTextDecoration( | 1549 (1, AppliedTextDecoration( |
| 1552 TextDecoration::kUnderline, kTextDecorationStyleSolid, | 1550 TextDecoration::kUnderline, kTextDecorationStyleSolid, |
| 1553 VisitedDependentColor(CSSPropertyTextDecorationColor)))); | 1551 VisitedDependentColor(CSSPropertyTextDecorationColor)))); |
| 1554 // Since we only have one of these in memory, just update the color before | 1552 // Since we only have one of these in memory, just update the color before |
| 1555 // returning. | 1553 // returning. |
| 1556 underline.at(0).SetColor( | 1554 underline.at(0).SetColor( |
| 1557 VisitedDependentColor(CSSPropertyTextDecorationColor)); | 1555 VisitedDependentColor(CSSPropertyTextDecorationColor)); |
| 1558 return underline; | 1556 return underline; |
| 1559 } | 1557 } |
| 1560 if (!rare_inherited_data_->applied_text_decorations_) { | 1558 if (!AppliedTextDecorationsInternal()) { |
| 1561 DEFINE_STATIC_LOCAL(Vector<AppliedTextDecoration>, empty, ()); | 1559 DEFINE_STATIC_LOCAL(Vector<AppliedTextDecoration>, empty, ()); |
| 1562 return empty; | 1560 return empty; |
| 1563 } | 1561 } |
| 1564 | 1562 |
| 1565 return rare_inherited_data_->applied_text_decorations_->GetVector(); | 1563 return AppliedTextDecorationsInternal()->GetVector(); |
| 1566 } | 1564 } |
| 1567 | 1565 |
| 1568 StyleInheritedVariables* ComputedStyle::InheritedVariables() const { | 1566 StyleInheritedVariables* ComputedStyle::InheritedVariables() const { |
| 1569 return rare_inherited_data_->variables_.Get(); | 1567 return VariablesInternal().Get(); |
| 1570 } | 1568 } |
| 1571 | 1569 |
| 1572 StyleNonInheritedVariables* ComputedStyle::NonInheritedVariables() const { | 1570 StyleNonInheritedVariables* ComputedStyle::NonInheritedVariables() const { |
| 1573 return rare_non_inherited_data_->variables_.get(); | 1571 return rare_non_inherited_data_->variables_.get(); |
| 1574 } | 1572 } |
| 1575 | 1573 |
| 1576 StyleInheritedVariables& ComputedStyle::MutableInheritedVariables() { | 1574 StyleInheritedVariables& ComputedStyle::MutableInheritedVariables() { |
| 1577 RefPtr<StyleInheritedVariables>& variables = | 1575 RefPtr<StyleInheritedVariables>& variables = MutableVariablesInternal(); |
| 1578 rare_inherited_data_.Access()->variables_; | |
| 1579 if (!variables) | 1576 if (!variables) |
| 1580 variables = StyleInheritedVariables::Create(); | 1577 variables = StyleInheritedVariables::Create(); |
| 1581 else if (!variables->HasOneRef()) | 1578 else if (!variables->HasOneRef()) |
| 1582 variables = variables->Copy(); | 1579 variables = variables->Copy(); |
| 1583 return *variables; | 1580 return *variables; |
| 1584 } | 1581 } |
| 1585 | 1582 |
| 1586 StyleNonInheritedVariables& ComputedStyle::MutableNonInheritedVariables() { | 1583 StyleNonInheritedVariables& ComputedStyle::MutableNonInheritedVariables() { |
| 1587 std::unique_ptr<StyleNonInheritedVariables>& variables = | 1584 std::unique_ptr<StyleNonInheritedVariables>& variables = |
| 1588 rare_non_inherited_data_.Access()->variables_; | 1585 rare_non_inherited_data_.Access()->variables_; |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1800 TextAutosizer::ComputeAutosizedFontSize(size, multiplier); | 1797 TextAutosizer::ComputeAutosizedFontSize(size, multiplier); |
| 1801 desc.SetComputedSize(std::min(kMaximumAllowedFontSize, autosized_font_size)); | 1798 desc.SetComputedSize(std::min(kMaximumAllowedFontSize, autosized_font_size)); |
| 1802 | 1799 |
| 1803 SetFontDescription(desc); | 1800 SetFontDescription(desc); |
| 1804 GetFont().Update(current_font_selector); | 1801 GetFont().Update(current_font_selector); |
| 1805 } | 1802 } |
| 1806 | 1803 |
| 1807 void ComputedStyle::AddAppliedTextDecoration( | 1804 void ComputedStyle::AddAppliedTextDecoration( |
| 1808 const AppliedTextDecoration& decoration) { | 1805 const AppliedTextDecoration& decoration) { |
| 1809 RefPtr<AppliedTextDecorationList>& list = | 1806 RefPtr<AppliedTextDecorationList>& list = |
| 1810 rare_inherited_data_.Access()->applied_text_decorations_; | 1807 MutableAppliedTextDecorationsInternal(); |
| 1811 | 1808 |
| 1812 if (!list) | 1809 if (!list) |
| 1813 list = AppliedTextDecorationList::Create(); | 1810 list = AppliedTextDecorationList::Create(); |
| 1814 else if (!list->HasOneRef()) | 1811 else if (!list->HasOneRef()) |
| 1815 list = list->Copy(); | 1812 list = list->Copy(); |
| 1816 | 1813 |
| 1817 list->push_back(decoration); | 1814 list->push_back(decoration); |
| 1818 } | 1815 } |
| 1819 | 1816 |
| 1820 void ComputedStyle::OverrideTextDecorationColors(Color override_color) { | 1817 void ComputedStyle::OverrideTextDecorationColors(Color override_color) { |
| 1821 RefPtr<AppliedTextDecorationList>& list = | 1818 RefPtr<AppliedTextDecorationList>& list = |
| 1822 rare_inherited_data_.Access()->applied_text_decorations_; | 1819 MutableAppliedTextDecorationsInternal(); |
| 1823 DCHECK(list); | 1820 DCHECK(list); |
| 1824 if (!list->HasOneRef()) | 1821 if (!list->HasOneRef()) |
| 1825 list = list->Copy(); | 1822 list = list->Copy(); |
| 1826 | 1823 |
| 1827 for (size_t i = 0; i < list->size(); ++i) | 1824 for (size_t i = 0; i < list->size(); ++i) |
| 1828 list->at(i).SetColor(override_color); | 1825 list->at(i).SetColor(override_color); |
| 1829 } | 1826 } |
| 1830 | 1827 |
| 1831 void ComputedStyle::ApplyTextDecorations( | 1828 void ComputedStyle::ApplyTextDecorations( |
| 1832 const Color& parent_text_decoration_color, | 1829 const Color& parent_text_decoration_color, |
| 1833 bool override_existing_colors) { | 1830 bool override_existing_colors) { |
| 1834 if (GetTextDecoration() == TextDecoration::kNone && | 1831 if (GetTextDecoration() == TextDecoration::kNone && |
| 1835 !HasSimpleUnderlineInternal() && | 1832 !HasSimpleUnderlineInternal() && !AppliedTextDecorationsInternal()) |
| 1836 !rare_inherited_data_->applied_text_decorations_) | |
| 1837 return; | 1833 return; |
| 1838 | 1834 |
| 1839 // If there are any color changes or decorations set by this element, stop | 1835 // If there are any color changes or decorations set by this element, stop |
| 1840 // using m_hasSimpleUnderline. | 1836 // using m_hasSimpleUnderline. |
| 1841 Color current_text_decoration_color = | 1837 Color current_text_decoration_color = |
| 1842 VisitedDependentColor(CSSPropertyTextDecorationColor); | 1838 VisitedDependentColor(CSSPropertyTextDecorationColor); |
| 1843 if (HasSimpleUnderlineInternal() && | 1839 if (HasSimpleUnderlineInternal() && |
| 1844 (GetTextDecoration() != TextDecoration::kNone || | 1840 (GetTextDecoration() != TextDecoration::kNone || |
| 1845 current_text_decoration_color != parent_text_decoration_color)) { | 1841 current_text_decoration_color != parent_text_decoration_color)) { |
| 1846 SetHasSimpleUnderlineInternal(false); | 1842 SetHasSimpleUnderlineInternal(false); |
| 1847 AddAppliedTextDecoration(AppliedTextDecoration( | 1843 AddAppliedTextDecoration(AppliedTextDecoration( |
| 1848 TextDecoration::kUnderline, kTextDecorationStyleSolid, | 1844 TextDecoration::kUnderline, kTextDecorationStyleSolid, |
| 1849 parent_text_decoration_color)); | 1845 parent_text_decoration_color)); |
| 1850 } | 1846 } |
| 1851 if (override_existing_colors && | 1847 if (override_existing_colors && AppliedTextDecorationsInternal()) |
| 1852 rare_inherited_data_->applied_text_decorations_) | |
| 1853 OverrideTextDecorationColors(current_text_decoration_color); | 1848 OverrideTextDecorationColors(current_text_decoration_color); |
| 1854 if (GetTextDecoration() == TextDecoration::kNone) | 1849 if (GetTextDecoration() == TextDecoration::kNone) |
| 1855 return; | 1850 return; |
| 1856 DCHECK(!HasSimpleUnderlineInternal()); | 1851 DCHECK(!HasSimpleUnderlineInternal()); |
| 1857 // To save memory, we don't use AppliedTextDecoration objects in the common | 1852 // To save memory, we don't use AppliedTextDecoration objects in the common |
| 1858 // case of a single simple underline of currentColor. | 1853 // case of a single simple underline of currentColor. |
| 1859 TextDecoration decoration_lines = GetTextDecoration(); | 1854 TextDecoration decoration_lines = GetTextDecoration(); |
| 1860 TextDecorationStyle decoration_style = GetTextDecorationStyle(); | 1855 TextDecorationStyle decoration_style = GetTextDecorationStyle(); |
| 1861 bool is_simple_underline = decoration_lines == TextDecoration::kUnderline && | 1856 bool is_simple_underline = decoration_lines == TextDecoration::kUnderline && |
| 1862 decoration_style == kTextDecorationStyleSolid && | 1857 decoration_style == kTextDecorationStyleSolid && |
| 1863 TextDecorationColor().IsCurrentColor(); | 1858 TextDecorationColor().IsCurrentColor(); |
| 1864 if (is_simple_underline && !rare_inherited_data_->applied_text_decorations_) { | 1859 if (is_simple_underline && !AppliedTextDecorationsInternal()) { |
| 1865 SetHasSimpleUnderlineInternal(true); | 1860 SetHasSimpleUnderlineInternal(true); |
| 1866 return; | 1861 return; |
| 1867 } | 1862 } |
| 1868 | 1863 |
| 1869 AddAppliedTextDecoration(AppliedTextDecoration( | 1864 AddAppliedTextDecoration(AppliedTextDecoration( |
| 1870 decoration_lines, decoration_style, current_text_decoration_color)); | 1865 decoration_lines, decoration_style, current_text_decoration_color)); |
| 1871 } | 1866 } |
| 1872 | 1867 |
| 1873 void ComputedStyle::ClearAppliedTextDecorations() { | 1868 void ComputedStyle::ClearAppliedTextDecorations() { |
| 1874 SetHasSimpleUnderlineInternal(false); | 1869 SetHasSimpleUnderlineInternal(false); |
| 1875 | 1870 |
| 1876 if (rare_inherited_data_->applied_text_decorations_) | 1871 if (AppliedTextDecorationsInternal()) |
| 1877 rare_inherited_data_.Access()->applied_text_decorations_ = nullptr; | 1872 SetAppliedTextDecorationsInternal(nullptr); |
| 1878 } | 1873 } |
| 1879 | 1874 |
| 1880 void ComputedStyle::RestoreParentTextDecorations( | 1875 void ComputedStyle::RestoreParentTextDecorations( |
| 1881 const ComputedStyle& parent_style) { | 1876 const ComputedStyle& parent_style) { |
| 1882 SetHasSimpleUnderlineInternal(parent_style.HasSimpleUnderlineInternal()); | 1877 SetHasSimpleUnderlineInternal(parent_style.HasSimpleUnderlineInternal()); |
| 1883 if (rare_inherited_data_->applied_text_decorations_ != | 1878 if (AppliedTextDecorationsInternal() != |
| 1884 parent_style.rare_inherited_data_->applied_text_decorations_) { | 1879 parent_style.AppliedTextDecorationsInternal()) { |
| 1885 rare_inherited_data_.Access()->applied_text_decorations_ = | 1880 SetAppliedTextDecorationsInternal( |
| 1886 parent_style.rare_inherited_data_->applied_text_decorations_; | 1881 parent_style.AppliedTextDecorationsInternal()); |
| 1887 } | 1882 } |
| 1888 } | 1883 } |
| 1889 | 1884 |
| 1890 void ComputedStyle::ClearMultiCol() { | 1885 void ComputedStyle::ClearMultiCol() { |
| 1891 rare_non_inherited_data_.Access()->multi_col_ = nullptr; | 1886 rare_non_inherited_data_.Access()->multi_col_ = nullptr; |
| 1892 rare_non_inherited_data_.Access()->multi_col_.Init(); | 1887 rare_non_inherited_data_.Access()->multi_col_.Init(); |
| 1893 } | 1888 } |
| 1894 | 1889 |
| 1895 StyleColor ComputedStyle::DecorationColorIncludingFallback( | 1890 StyleColor ComputedStyle::DecorationColorIncludingFallback( |
| 1896 bool visited_link) const { | 1891 bool visited_link) const { |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2200 | 2195 |
| 2201 bool ComputedStyle::ColumnRuleEquivalent( | 2196 bool ComputedStyle::ColumnRuleEquivalent( |
| 2202 const ComputedStyle* other_style) const { | 2197 const ComputedStyle* other_style) const { |
| 2203 return ColumnRuleStyle() == other_style->ColumnRuleStyle() && | 2198 return ColumnRuleStyle() == other_style->ColumnRuleStyle() && |
| 2204 ColumnRuleWidth() == other_style->ColumnRuleWidth() && | 2199 ColumnRuleWidth() == other_style->ColumnRuleWidth() && |
| 2205 VisitedDependentColor(CSSPropertyColumnRuleColor) == | 2200 VisitedDependentColor(CSSPropertyColumnRuleColor) == |
| 2206 other_style->VisitedDependentColor(CSSPropertyColumnRuleColor); | 2201 other_style->VisitedDependentColor(CSSPropertyColumnRuleColor); |
| 2207 } | 2202 } |
| 2208 | 2203 |
| 2209 TextEmphasisMark ComputedStyle::GetTextEmphasisMark() const { | 2204 TextEmphasisMark ComputedStyle::GetTextEmphasisMark() const { |
| 2210 TextEmphasisMark mark = | 2205 TextEmphasisMark mark = TextEmphasisMarkInternal(); |
| 2211 static_cast<TextEmphasisMark>(rare_inherited_data_->text_emphasis_mark_); | |
| 2212 if (mark != TextEmphasisMark::kAuto) | 2206 if (mark != TextEmphasisMark::kAuto) |
| 2213 return mark; | 2207 return mark; |
| 2214 | 2208 |
| 2215 if (IsHorizontalWritingMode()) | 2209 if (IsHorizontalWritingMode()) |
| 2216 return TextEmphasisMark::kDot; | 2210 return TextEmphasisMark::kDot; |
| 2217 | 2211 |
| 2218 return TextEmphasisMark::kSesame; | 2212 return TextEmphasisMark::kSesame; |
| 2219 } | 2213 } |
| 2220 | 2214 |
| 2221 const FilterOperations& ComputedStyle::InitialFilter() { | 2215 const FilterOperations& ComputedStyle::InitialFilter() { |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2354 if (value < 0) | 2348 if (value < 0) |
| 2355 fvalue -= 0.5f; | 2349 fvalue -= 0.5f; |
| 2356 else | 2350 else |
| 2357 fvalue += 0.5f; | 2351 fvalue += 0.5f; |
| 2358 } | 2352 } |
| 2359 | 2353 |
| 2360 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); | 2354 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); |
| 2361 } | 2355 } |
| 2362 | 2356 |
| 2363 } // namespace blink | 2357 } // namespace blink |
| OLD | NEW |