| 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
reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
| 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 || rareInheritedData->visitedLinkTextFillColor() != other.rareIn
heritedData->visitedLinkTextFillColor() | 806 || rareInheritedData->visitedLinkTextFillColor() != other.rareIn
heritedData->visitedLinkTextFillColor() |
| 807 || rareInheritedData->visitedLinkTextStrokeColor() != other.rare
InheritedData->visitedLinkTextStrokeColor() | 807 || rareInheritedData->visitedLinkTextStrokeColor() != other.rare
InheritedData->visitedLinkTextStrokeColor() |
| 808 || rareInheritedData->visitedLinkTextEmphasisColor() != other.ra
reInheritedData->visitedLinkTextEmphasisColor() | 808 || rareInheritedData->visitedLinkTextEmphasisColor() != other.ra
reInheritedData->visitedLinkTextEmphasisColor() |
| 809 || rareInheritedData->textEmphasisFill != other.rareInheritedDat
a->textEmphasisFill | 809 || rareInheritedData->textEmphasisFill != other.rareInheritedDat
a->textEmphasisFill |
| 810 || rareInheritedData->appliedTextDecorations != other.rareInheri
tedData->appliedTextDecorations)) { | 810 || rareInheritedData->appliedTextDecorations != other.rareInheri
tedData->appliedTextDecorations)) { |
| 811 diff.setTextDecorationOrColorChanged(); | 811 diff.setTextDecorationOrColorChanged(); |
| 812 } | 812 } |
| 813 } | 813 } |
| 814 } | 814 } |
| 815 | 815 |
| 816 void ComputedStyle::addCursor(PassRefPtrWillBeRawPtr<StyleImage> image, bool hot
SpotSpecified, const IntPoint& hotSpot) | 816 void ComputedStyle::addCursor(RawPtr<StyleImage> image, bool hotSpotSpecified, c
onst IntPoint& hotSpot) |
| 817 { | 817 { |
| 818 if (!rareInheritedData.access()->cursorData) { | 818 if (!rareInheritedData.access()->cursorData) { |
| 819 #if ENABLE(OILPAN) | 819 #if ENABLE(OILPAN) |
| 820 rareInheritedData.access()->cursorData = new CursorList; | 820 rareInheritedData.access()->cursorData = new CursorList; |
| 821 #else | 821 #else |
| 822 rareInheritedData.access()->cursorData = CursorList::create(); | 822 rareInheritedData.access()->cursorData = CursorList::create(); |
| 823 #endif | 823 #endif |
| 824 } | 824 } |
| 825 rareInheritedData.access()->cursorData->append(CursorData(image, hotSpotSpec
ified, hotSpot)); | 825 rareInheritedData.access()->cursorData->append(CursorData(image, hotSpotSpec
ified, hotSpot)); |
| 826 } | 826 } |
| 827 | 827 |
| 828 void ComputedStyle::setCursorList(PassRefPtrWillBeRawPtr<CursorList> other) | 828 void ComputedStyle::setCursorList(RawPtr<CursorList> other) |
| 829 { | 829 { |
| 830 rareInheritedData.access()->cursorData = other; | 830 rareInheritedData.access()->cursorData = other; |
| 831 } | 831 } |
| 832 | 832 |
| 833 void ComputedStyle::setQuotes(PassRefPtr<QuotesData> q) | 833 void ComputedStyle::setQuotes(PassRefPtr<QuotesData> q) |
| 834 { | 834 { |
| 835 rareInheritedData.access()->quotes = q; | 835 rareInheritedData.access()->quotes = q; |
| 836 } | 836 } |
| 837 | 837 |
| 838 void ComputedStyle::clearCursorList() | 838 void ComputedStyle::clearCursorList() |
| 839 { | 839 { |
| 840 if (rareInheritedData->cursorData) | 840 if (rareInheritedData->cursorData) |
| 841 rareInheritedData.access()->cursorData = nullptr; | 841 rareInheritedData.access()->cursorData = nullptr; |
| 842 } | 842 } |
| 843 | 843 |
| 844 void ComputedStyle::addCallbackSelector(const String& selector) | 844 void ComputedStyle::addCallbackSelector(const String& selector) |
| 845 { | 845 { |
| 846 if (!rareNonInheritedData->m_callbackSelectors.contains(selector)) | 846 if (!rareNonInheritedData->m_callbackSelectors.contains(selector)) |
| 847 rareNonInheritedData.access()->m_callbackSelectors.append(selector); | 847 rareNonInheritedData.access()->m_callbackSelectors.append(selector); |
| 848 } | 848 } |
| 849 | 849 |
| 850 void ComputedStyle::clearContent() | 850 void ComputedStyle::clearContent() |
| 851 { | 851 { |
| 852 if (rareNonInheritedData->m_content) | 852 if (rareNonInheritedData->m_content) |
| 853 rareNonInheritedData.access()->m_content = nullptr; | 853 rareNonInheritedData.access()->m_content = nullptr; |
| 854 } | 854 } |
| 855 | 855 |
| 856 void ComputedStyle::appendContent(PassOwnPtrWillBeRawPtr<ContentData> contentDat
a) | 856 void ComputedStyle::appendContent(RawPtr<ContentData> contentData) |
| 857 { | 857 { |
| 858 OwnPtrWillBePersistent<ContentData>& content = rareNonInheritedData.access()
->m_content; | 858 Persistent<ContentData>& content = rareNonInheritedData.access()->m_content; |
| 859 ContentData* lastContent = content.get(); | 859 ContentData* lastContent = content.get(); |
| 860 while (lastContent && lastContent->next()) | 860 while (lastContent && lastContent->next()) |
| 861 lastContent = lastContent->next(); | 861 lastContent = lastContent->next(); |
| 862 | 862 |
| 863 if (lastContent) | 863 if (lastContent) |
| 864 lastContent->setNext(contentData); | 864 lastContent->setNext(contentData); |
| 865 else | 865 else |
| 866 content = contentData; | 866 content = contentData; |
| 867 } | 867 } |
| 868 | 868 |
| 869 void ComputedStyle::setContent(PassRefPtrWillBeRawPtr<StyleImage> image, bool ad
d) | 869 void ComputedStyle::setContent(RawPtr<StyleImage> image, bool add) |
| 870 { | 870 { |
| 871 if (!image) | 871 if (!image) |
| 872 return; | 872 return; |
| 873 | 873 |
| 874 if (add) { | 874 if (add) { |
| 875 appendContent(ContentData::create(image)); | 875 appendContent(ContentData::create(image)); |
| 876 return; | 876 return; |
| 877 } | 877 } |
| 878 | 878 |
| 879 rareNonInheritedData.access()->m_content = ContentData::create(image); | 879 rareNonInheritedData.access()->m_content = ContentData::create(image); |
| 880 } | 880 } |
| 881 | 881 |
| 882 void ComputedStyle::setContent(const String& string, bool add) | 882 void ComputedStyle::setContent(const String& string, bool add) |
| 883 { | 883 { |
| 884 OwnPtrWillBePersistent<ContentData>& content = rareNonInheritedData.access()
->m_content; | 884 Persistent<ContentData>& content = rareNonInheritedData.access()->m_content; |
| 885 if (add) { | 885 if (add) { |
| 886 ContentData* lastContent = content.get(); | 886 ContentData* lastContent = content.get(); |
| 887 while (lastContent && lastContent->next()) | 887 while (lastContent && lastContent->next()) |
| 888 lastContent = lastContent->next(); | 888 lastContent = lastContent->next(); |
| 889 | 889 |
| 890 if (lastContent) { | 890 if (lastContent) { |
| 891 // We attempt to merge with the last ContentData if possible. | 891 // We attempt to merge with the last ContentData if possible. |
| 892 if (lastContent->isText()) { | 892 if (lastContent->isText()) { |
| 893 TextContentData* textContent = toTextContentData(lastContent); | 893 TextContentData* textContent = toTextContentData(lastContent); |
| 894 textContent->setText(textContent->text() + string); | 894 textContent->setText(textContent->text() + string); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 floatValueForLength(border.topLeft().height(), size.height().toFloat
())), | 1079 floatValueForLength(border.topLeft().height(), size.height().toFloat
())), |
| 1080 FloatSize(floatValueForLength(border.topRight().width(), size.width().to
Float()), | 1080 FloatSize(floatValueForLength(border.topRight().width(), size.width().to
Float()), |
| 1081 floatValueForLength(border.topRight().height(), size.height().toFloa
t())), | 1081 floatValueForLength(border.topRight().height(), size.height().toFloa
t())), |
| 1082 FloatSize(floatValueForLength(border.bottomLeft().width(), size.width().
toFloat()), | 1082 FloatSize(floatValueForLength(border.bottomLeft().width(), size.width().
toFloat()), |
| 1083 floatValueForLength(border.bottomLeft().height(), size.height().toFl
oat())), | 1083 floatValueForLength(border.bottomLeft().height(), size.height().toFl
oat())), |
| 1084 FloatSize(floatValueForLength(border.bottomRight().width(), size.width()
.toFloat()), | 1084 FloatSize(floatValueForLength(border.bottomRight().width(), size.width()
.toFloat()), |
| 1085 floatValueForLength(border.bottomRight().height(), size.height().toF
loat()))); | 1085 floatValueForLength(border.bottomRight().height(), size.height().toF
loat()))); |
| 1086 } | 1086 } |
| 1087 | 1087 |
| 1088 StyleImage* ComputedStyle::listStyleImage() const { return rareInheritedData->li
stStyleImage.get(); } | 1088 StyleImage* ComputedStyle::listStyleImage() const { return rareInheritedData->li
stStyleImage.get(); } |
| 1089 void ComputedStyle::setListStyleImage(PassRefPtrWillBeRawPtr<StyleImage> v) | 1089 void ComputedStyle::setListStyleImage(RawPtr<StyleImage> v) |
| 1090 { | 1090 { |
| 1091 if (rareInheritedData->listStyleImage != v) | 1091 if (rareInheritedData->listStyleImage != v) |
| 1092 rareInheritedData.access()->listStyleImage = v; | 1092 rareInheritedData.access()->listStyleImage = v; |
| 1093 } | 1093 } |
| 1094 | 1094 |
| 1095 Color ComputedStyle::color() const { return inherited->color; } | 1095 Color ComputedStyle::color() const { return inherited->color; } |
| 1096 Color ComputedStyle::visitedLinkColor() const { return inherited->visitedLinkCol
or; } | 1096 Color ComputedStyle::visitedLinkColor() const { return inherited->visitedLinkCol
or; } |
| 1097 void ComputedStyle::setColor(const Color& v) { SET_VAR(inherited, color, v); } | 1097 void ComputedStyle::setColor(const Color& v) { SET_VAR(inherited, color, v); } |
| 1098 void ComputedStyle::setVisitedLinkColor(const Color& v) { SET_VAR(inherited, vis
itedLinkColor, v); } | 1098 void ComputedStyle::setVisitedLinkColor(const Color& v) { SET_VAR(inherited, vis
itedLinkColor, v); } |
| 1099 | 1099 |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1781 | 1781 |
| 1782 LayoutRectOutsets ComputedStyle::imageOutsets(const NinePieceImage& image) const | 1782 LayoutRectOutsets ComputedStyle::imageOutsets(const NinePieceImage& image) const |
| 1783 { | 1783 { |
| 1784 return LayoutRectOutsets( | 1784 return LayoutRectOutsets( |
| 1785 NinePieceImage::computeOutset(image.outset().top(), borderTopWidth()), | 1785 NinePieceImage::computeOutset(image.outset().top(), borderTopWidth()), |
| 1786 NinePieceImage::computeOutset(image.outset().right(), borderRightWidth()
), | 1786 NinePieceImage::computeOutset(image.outset().right(), borderRightWidth()
), |
| 1787 NinePieceImage::computeOutset(image.outset().bottom(), borderBottomWidth
()), | 1787 NinePieceImage::computeOutset(image.outset().bottom(), borderBottomWidth
()), |
| 1788 NinePieceImage::computeOutset(image.outset().left(), borderLeftWidth()))
; | 1788 NinePieceImage::computeOutset(image.outset().left(), borderLeftWidth()))
; |
| 1789 } | 1789 } |
| 1790 | 1790 |
| 1791 void ComputedStyle::setBorderImageSource(PassRefPtrWillBeRawPtr<StyleImage> imag
e) | 1791 void ComputedStyle::setBorderImageSource(RawPtr<StyleImage> image) |
| 1792 { | 1792 { |
| 1793 if (surround->border.m_image.image() == image.get()) | 1793 if (surround->border.m_image.image() == image.get()) |
| 1794 return; | 1794 return; |
| 1795 surround.access()->border.m_image.setImage(image); | 1795 surround.access()->border.m_image.setImage(image); |
| 1796 } | 1796 } |
| 1797 | 1797 |
| 1798 void ComputedStyle::setBorderImageSlices(const LengthBox& slices) | 1798 void ComputedStyle::setBorderImageSlices(const LengthBox& slices) |
| 1799 { | 1799 { |
| 1800 if (surround->border.m_image.imageSlices() == slices) | 1800 if (surround->border.m_image.imageSlices() == slices) |
| 1801 return; | 1801 return; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1881 if (!shadowList) | 1881 if (!shadowList) |
| 1882 return false; | 1882 return false; |
| 1883 for (size_t i = shadowList->shadows().size(); i--; ) { | 1883 for (size_t i = shadowList->shadows().size(); i--; ) { |
| 1884 if (shadowList->shadows()[i].color().isCurrentColor()) | 1884 if (shadowList->shadows()[i].color().isCurrentColor()) |
| 1885 return true; | 1885 return true; |
| 1886 } | 1886 } |
| 1887 return false; | 1887 return false; |
| 1888 } | 1888 } |
| 1889 | 1889 |
| 1890 } // namespace blink | 1890 } // namespace blink |
| OLD | NEW |