Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 || rareInheritedData->visitedLinkTextFillColor() != other.rareIn heritedData->visitedLinkTextFillColor() 769 || rareInheritedData->visitedLinkTextFillColor() != other.rareIn heritedData->visitedLinkTextFillColor()
770 || rareInheritedData->visitedLinkTextStrokeColor() != other.rare InheritedData->visitedLinkTextStrokeColor() 770 || rareInheritedData->visitedLinkTextStrokeColor() != other.rare InheritedData->visitedLinkTextStrokeColor()
771 || rareInheritedData->visitedLinkTextEmphasisColor() != other.ra reInheritedData->visitedLinkTextEmphasisColor() 771 || rareInheritedData->visitedLinkTextEmphasisColor() != other.ra reInheritedData->visitedLinkTextEmphasisColor()
772 || rareInheritedData->textEmphasisFill != other.rareInheritedDat a->textEmphasisFill 772 || rareInheritedData->textEmphasisFill != other.rareInheritedDat a->textEmphasisFill
773 || rareInheritedData->appliedTextDecorations != other.rareInheri tedData->appliedTextDecorations)) { 773 || rareInheritedData->appliedTextDecorations != other.rareInheri tedData->appliedTextDecorations)) {
774 diff.setTextDecorationOrColorChanged(); 774 diff.setTextDecorationOrColorChanged();
775 } 775 }
776 } 776 }
777 } 777 }
778 778
779 void ComputedStyle::addCursor(PassRefPtrWillBeRawPtr<StyleImage> image, bool hot SpotSpecified, const IntPoint& hotSpot) 779 void ComputedStyle::addCursor(RawPtr<StyleImage> image, bool hotSpotSpecified, c onst IntPoint& hotSpot)
780 { 780 {
781 if (!rareInheritedData.access()->cursorData) { 781 if (!rareInheritedData.access()->cursorData) {
782 #if ENABLE(OILPAN) 782 #if ENABLE(OILPAN)
783 rareInheritedData.access()->cursorData = new CursorList; 783 rareInheritedData.access()->cursorData = new CursorList;
784 #else 784 #else
785 rareInheritedData.access()->cursorData = CursorList::create(); 785 rareInheritedData.access()->cursorData = CursorList::create();
786 #endif 786 #endif
787 } 787 }
788 rareInheritedData.access()->cursorData->append(CursorData(image, hotSpotSpec ified, hotSpot)); 788 rareInheritedData.access()->cursorData->append(CursorData(image, hotSpotSpec ified, hotSpot));
789 } 789 }
790 790
791 void ComputedStyle::setCursorList(PassRefPtrWillBeRawPtr<CursorList> other) 791 void ComputedStyle::setCursorList(RawPtr<CursorList> other)
792 { 792 {
793 rareInheritedData.access()->cursorData = other; 793 rareInheritedData.access()->cursorData = other;
794 } 794 }
795 795
796 void ComputedStyle::setQuotes(PassRefPtr<QuotesData> q) 796 void ComputedStyle::setQuotes(PassRefPtr<QuotesData> q)
797 { 797 {
798 rareInheritedData.access()->quotes = q; 798 rareInheritedData.access()->quotes = q;
799 } 799 }
800 800
801 void ComputedStyle::clearCursorList() 801 void ComputedStyle::clearCursorList()
802 { 802 {
803 if (rareInheritedData->cursorData) 803 if (rareInheritedData->cursorData)
804 rareInheritedData.access()->cursorData = nullptr; 804 rareInheritedData.access()->cursorData = nullptr;
805 } 805 }
806 806
807 void ComputedStyle::addCallbackSelector(const String& selector) 807 void ComputedStyle::addCallbackSelector(const String& selector)
808 { 808 {
809 if (!rareNonInheritedData->m_callbackSelectors.contains(selector)) 809 if (!rareNonInheritedData->m_callbackSelectors.contains(selector))
810 rareNonInheritedData.access()->m_callbackSelectors.append(selector); 810 rareNonInheritedData.access()->m_callbackSelectors.append(selector);
811 } 811 }
812 812
813 void ComputedStyle::clearContent() 813 void ComputedStyle::clearContent()
814 { 814 {
815 if (rareNonInheritedData->m_content) 815 if (rareNonInheritedData->m_content)
816 rareNonInheritedData.access()->m_content = nullptr; 816 rareNonInheritedData.access()->m_content = nullptr;
817 } 817 }
818 818
819 void ComputedStyle::appendContent(PassOwnPtrWillBeRawPtr<ContentData> contentDat a) 819 void ComputedStyle::appendContent(RawPtr<ContentData> contentData)
820 { 820 {
821 OwnPtrWillBePersistent<ContentData>& content = rareNonInheritedData.access() ->m_content; 821 Persistent<ContentData>& content = rareNonInheritedData.access()->m_content;
822 ContentData* lastContent = content.get(); 822 ContentData* lastContent = content.get();
823 while (lastContent && lastContent->next()) 823 while (lastContent && lastContent->next())
824 lastContent = lastContent->next(); 824 lastContent = lastContent->next();
825 825
826 if (lastContent) 826 if (lastContent)
827 lastContent->setNext(contentData); 827 lastContent->setNext(contentData);
828 else 828 else
829 content = contentData; 829 content = contentData;
830 } 830 }
831 831
832 void ComputedStyle::setContent(PassRefPtrWillBeRawPtr<StyleImage> image, bool ad d) 832 void ComputedStyle::setContent(RawPtr<StyleImage> image, bool add)
833 { 833 {
834 if (!image) 834 if (!image)
835 return; 835 return;
836 836
837 if (add) { 837 if (add) {
838 appendContent(ContentData::create(image)); 838 appendContent(ContentData::create(image));
839 return; 839 return;
840 } 840 }
841 841
842 rareNonInheritedData.access()->m_content = ContentData::create(image); 842 rareNonInheritedData.access()->m_content = ContentData::create(image);
843 } 843 }
844 844
845 void ComputedStyle::setContent(const String& string, bool add) 845 void ComputedStyle::setContent(const String& string, bool add)
846 { 846 {
847 OwnPtrWillBePersistent<ContentData>& content = rareNonInheritedData.access() ->m_content; 847 Persistent<ContentData>& content = rareNonInheritedData.access()->m_content;
848 if (add) { 848 if (add) {
849 ContentData* lastContent = content.get(); 849 ContentData* lastContent = content.get();
850 while (lastContent && lastContent->next()) 850 while (lastContent && lastContent->next())
851 lastContent = lastContent->next(); 851 lastContent = lastContent->next();
852 852
853 if (lastContent) { 853 if (lastContent) {
854 // We attempt to merge with the last ContentData if possible. 854 // We attempt to merge with the last ContentData if possible.
855 if (lastContent->isText()) { 855 if (lastContent->isText()) {
856 TextContentData* textContent = toTextContentData(lastContent); 856 TextContentData* textContent = toTextContentData(lastContent);
857 textContent->setText(textContent->text() + string); 857 textContent->setText(textContent->text() + string);
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 floatValueForLength(border.topLeft().height(), size.height().toFloat ())), 1042 floatValueForLength(border.topLeft().height(), size.height().toFloat ())),
1043 FloatSize(floatValueForLength(border.topRight().width(), size.width().to Float()), 1043 FloatSize(floatValueForLength(border.topRight().width(), size.width().to Float()),
1044 floatValueForLength(border.topRight().height(), size.height().toFloa t())), 1044 floatValueForLength(border.topRight().height(), size.height().toFloa t())),
1045 FloatSize(floatValueForLength(border.bottomLeft().width(), size.width(). toFloat()), 1045 FloatSize(floatValueForLength(border.bottomLeft().width(), size.width(). toFloat()),
1046 floatValueForLength(border.bottomLeft().height(), size.height().toFl oat())), 1046 floatValueForLength(border.bottomLeft().height(), size.height().toFl oat())),
1047 FloatSize(floatValueForLength(border.bottomRight().width(), size.width() .toFloat()), 1047 FloatSize(floatValueForLength(border.bottomRight().width(), size.width() .toFloat()),
1048 floatValueForLength(border.bottomRight().height(), size.height().toF loat()))); 1048 floatValueForLength(border.bottomRight().height(), size.height().toF loat())));
1049 } 1049 }
1050 1050
1051 StyleImage* ComputedStyle::listStyleImage() const { return rareInheritedData->li stStyleImage.get(); } 1051 StyleImage* ComputedStyle::listStyleImage() const { return rareInheritedData->li stStyleImage.get(); }
1052 void ComputedStyle::setListStyleImage(PassRefPtrWillBeRawPtr<StyleImage> v) 1052 void ComputedStyle::setListStyleImage(RawPtr<StyleImage> v)
1053 { 1053 {
1054 if (rareInheritedData->listStyleImage != v) 1054 if (rareInheritedData->listStyleImage != v)
1055 rareInheritedData.access()->listStyleImage = v; 1055 rareInheritedData.access()->listStyleImage = v;
1056 } 1056 }
1057 1057
1058 Color ComputedStyle::color() const { return inherited->color; } 1058 Color ComputedStyle::color() const { return inherited->color; }
1059 Color ComputedStyle::visitedLinkColor() const { return inherited->visitedLinkCol or; } 1059 Color ComputedStyle::visitedLinkColor() const { return inherited->visitedLinkCol or; }
1060 void ComputedStyle::setColor(const Color& v) { SET_VAR(inherited, color, v); } 1060 void ComputedStyle::setColor(const Color& v) { SET_VAR(inherited, color, v); }
1061 void ComputedStyle::setVisitedLinkColor(const Color& v) { SET_VAR(inherited, vis itedLinkColor, v); } 1061 void ComputedStyle::setVisitedLinkColor(const Color& v) { SET_VAR(inherited, vis itedLinkColor, v); }
1062 1062
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
1744 1744
1745 LayoutRectOutsets ComputedStyle::imageOutsets(const NinePieceImage& image) const 1745 LayoutRectOutsets ComputedStyle::imageOutsets(const NinePieceImage& image) const
1746 { 1746 {
1747 return LayoutRectOutsets( 1747 return LayoutRectOutsets(
1748 NinePieceImage::computeOutset(image.outset().top(), borderTopWidth()), 1748 NinePieceImage::computeOutset(image.outset().top(), borderTopWidth()),
1749 NinePieceImage::computeOutset(image.outset().right(), borderRightWidth() ), 1749 NinePieceImage::computeOutset(image.outset().right(), borderRightWidth() ),
1750 NinePieceImage::computeOutset(image.outset().bottom(), borderBottomWidth ()), 1750 NinePieceImage::computeOutset(image.outset().bottom(), borderBottomWidth ()),
1751 NinePieceImage::computeOutset(image.outset().left(), borderLeftWidth())) ; 1751 NinePieceImage::computeOutset(image.outset().left(), borderLeftWidth())) ;
1752 } 1752 }
1753 1753
1754 void ComputedStyle::setBorderImageSource(PassRefPtrWillBeRawPtr<StyleImage> imag e) 1754 void ComputedStyle::setBorderImageSource(RawPtr<StyleImage> image)
1755 { 1755 {
1756 if (surround->border.m_image.image() == image.get()) 1756 if (surround->border.m_image.image() == image.get())
1757 return; 1757 return;
1758 surround.access()->border.m_image.setImage(image); 1758 surround.access()->border.m_image.setImage(image);
1759 } 1759 }
1760 1760
1761 void ComputedStyle::setBorderImageSlices(const LengthBox& slices) 1761 void ComputedStyle::setBorderImageSlices(const LengthBox& slices)
1762 { 1762 {
1763 if (surround->border.m_image.imageSlices() == slices) 1763 if (surround->border.m_image.imageSlices() == slices)
1764 return; 1764 return;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1844 if (!shadowList) 1844 if (!shadowList)
1845 return false; 1845 return false;
1846 for (size_t i = shadowList->shadows().size(); i--; ) { 1846 for (size_t i = shadowList->shadows().size(); i--; ) {
1847 if (shadowList->shadows()[i].color().isCurrentColor()) 1847 if (shadowList->shadows()[i].color().isCurrentColor())
1848 return true; 1848 return true;
1849 } 1849 }
1850 return false; 1850 return false;
1851 } 1851 }
1852 1852
1853 } // namespace blink 1853 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698