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 * |
11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
15 * | 15 * |
16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
20 * | 20 * |
21 */ | 21 */ |
22 | 22 |
23 #include "core/style/ComputedStyle.h" | 23 #include "core/style/ComputedStyle.h" |
24 | 24 |
| 25 #include "core/css/CSSPaintValue.h" |
| 26 #include "core/css/CSSPropertyEquality.h" |
25 #include "core/css/resolver/StyleResolver.h" | 27 #include "core/css/resolver/StyleResolver.h" |
26 #include "core/layout/LayoutTheme.h" | 28 #include "core/layout/LayoutTheme.h" |
27 #include "core/layout/TextAutosizer.h" | 29 #include "core/layout/TextAutosizer.h" |
28 #include "core/style/AppliedTextDecoration.h" | 30 #include "core/style/AppliedTextDecoration.h" |
29 #include "core/style/BorderEdge.h" | 31 #include "core/style/BorderEdge.h" |
30 #include "core/style/ContentData.h" | 32 #include "core/style/ContentData.h" |
31 #include "core/style/DataEquivalency.h" | 33 #include "core/style/DataEquivalency.h" |
32 #include "core/style/ComputedStyleConstants.h" | 34 #include "core/style/ComputedStyleConstants.h" |
33 #include "core/style/QuotesData.h" | 35 #include "core/style/QuotesData.h" |
34 #include "core/style/ShadowList.h" | 36 #include "core/style/ShadowList.h" |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 || (visitedLinkBorderBottomColor() != other.visitedLinkBorderBottomC
olor() && borderBottomWidth()) | 754 || (visitedLinkBorderBottomColor() != other.visitedLinkBorderBottomC
olor() && borderBottomWidth()) |
753 || (visitedLinkBorderTopColor() != other.visitedLinkBorderTopColor()
&& borderTopWidth()) | 755 || (visitedLinkBorderTopColor() != other.visitedLinkBorderTopColor()
&& borderTopWidth()) |
754 || (visitedLinkOutlineColor() != other.visitedLinkOutlineColor() &&
outlineWidth()) | 756 || (visitedLinkOutlineColor() != other.visitedLinkOutlineColor() &&
outlineWidth()) |
755 || (visitedLinkBackgroundColor() != other.visitedLinkBackgroundColor
())) | 757 || (visitedLinkBackgroundColor() != other.visitedLinkBackgroundColor
())) |
756 return true; | 758 return true; |
757 } | 759 } |
758 | 760 |
759 if (resize() != other.resize()) | 761 if (resize() != other.resize()) |
760 return true; | 762 return true; |
761 | 763 |
| 764 const StyleImage* image = borderImage().image(); |
| 765 if (image && image->isPaintImage() && diffNeedsPaintInvalidationObjectForPai
ntImage(image, other)) |
| 766 return true; |
| 767 |
| 768 const StyleImage* listImage = listStyleImage(); |
| 769 if (listImage && listImage->isPaintImage() && diffNeedsPaintInvalidationObje
ctForPaintImage(listImage, other)) |
| 770 return true; |
| 771 |
| 772 for (const FillLayer* bgLayer = &m_background->background(); bgLayer; bgLaye
r = bgLayer->next()) { |
| 773 if (bgLayer->image() && bgLayer->image()->isPaintImage() && diffNeedsPai
ntInvalidationObjectForPaintImage(bgLayer->image(), other)) |
| 774 return true; |
| 775 } |
| 776 |
| 777 for (const ContentData* data = contentData(); data; data = data->next()) { |
| 778 if (data->isImage() && toImageContentData(data)->image()->isPaintImage()
&& diffNeedsPaintInvalidationObjectForPaintImage(toImageContentData(data)->imag
e(), other)) |
| 779 return true; |
| 780 } |
| 781 |
762 return false; | 782 return false; |
763 } | 783 } |
764 | 784 |
| 785 bool ComputedStyle::diffNeedsPaintInvalidationObjectForPaintImage(const StyleIma
ge* image, const ComputedStyle& other) const |
| 786 { |
| 787 CSSPaintValue* value = toCSSPaintValue(image->cssValue()); |
| 788 |
| 789 if (!value->nativeInvalidationProperties() || !value->customInvalidationProp
erties()) |
| 790 return true; |
| 791 |
| 792 for (CSSPropertyID propertyID : *value->nativeInvalidationProperties()) { |
| 793 if (!CSSPropertyEquality::propertiesEqual(propertyID, *this, other)) |
| 794 return true; |
| 795 } |
| 796 |
| 797 for (const AtomicString& property : *value->customInvalidationProperties())
{ |
| 798 CSSVariableData* thisVar = variables() ? variables()->getVariable(proper
ty) : nullptr; |
| 799 CSSVariableData* otherVar = other.variables() ? other.variables()->getVa
riable(property) : nullptr; |
| 800 if (thisVar != otherVar) |
| 801 return true; |
| 802 } |
| 803 |
| 804 return false; |
| 805 } |
| 806 |
765 void ComputedStyle::updatePropertySpecificDifferences(const ComputedStyle& other
, StyleDifference& diff) const | 807 void ComputedStyle::updatePropertySpecificDifferences(const ComputedStyle& other
, StyleDifference& diff) const |
766 { | 808 { |
767 // StyleAdjuster has ensured that zIndex is non-auto only if it's applicable
. | 809 // StyleAdjuster has ensured that zIndex is non-auto only if it's applicable
. |
768 if (m_box->zIndex() != other.m_box->zIndex() || m_box->hasAutoZIndex() != ot
her.m_box->hasAutoZIndex()) | 810 if (m_box->zIndex() != other.m_box->zIndex() || m_box->hasAutoZIndex() != ot
her.m_box->hasAutoZIndex()) |
769 diff.setZIndexChanged(); | 811 diff.setZIndexChanged(); |
770 | 812 |
771 if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) { | 813 if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) { |
772 if (!transformDataEquivalent(other)) | 814 if (!transformDataEquivalent(other)) |
773 diff.setTransformChanged(); | 815 diff.setTransformChanged(); |
774 | 816 |
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1803 if (!shadowList) | 1845 if (!shadowList) |
1804 return false; | 1846 return false; |
1805 for (size_t i = shadowList->shadows().size(); i--; ) { | 1847 for (size_t i = shadowList->shadows().size(); i--; ) { |
1806 if (shadowList->shadows()[i].color().isCurrentColor()) | 1848 if (shadowList->shadows()[i].color().isCurrentColor()) |
1807 return true; | 1849 return true; |
1808 } | 1850 } |
1809 return false; | 1851 return false; |
1810 } | 1852 } |
1811 | 1853 |
1812 } // namespace blink | 1854 } // namespace blink |
OLD | NEW |