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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 return true; | 547 return true; |
548 | 548 |
549 // If the counter directives change, trigger a relayout to re-calculate
counter values and rebuild the counter node tree. | 549 // If the counter directives change, trigger a relayout to re-calculate
counter values and rebuild the counter node tree. |
550 const CounterDirectiveMap* mapA = rareNonInheritedData->m_counterDirecti
ves.get(); | 550 const CounterDirectiveMap* mapA = rareNonInheritedData->m_counterDirecti
ves.get(); |
551 const CounterDirectiveMap* mapB = other.rareNonInheritedData->m_counterD
irectives.get(); | 551 const CounterDirectiveMap* mapB = other.rareNonInheritedData->m_counterD
irectives.get(); |
552 if (!(mapA == mapB || (mapA && mapB && *mapA == *mapB))) | 552 if (!(mapA == mapB || (mapA && mapB && *mapA == *mapB))) |
553 return true; | 553 return true; |
554 | 554 |
555 // We only need do layout for opacity changes if adding or losing opacit
y could trigger a change | 555 // We only need do layout for opacity changes if adding or losing opacit
y could trigger a change |
556 // in us being a stacking context. | 556 // in us being a stacking context. |
557 if (hasAutoZIndex() != other.hasAutoZIndex() && rareNonInheritedData->ha
sOpacity() != other.rareNonInheritedData->hasOpacity()) { | 557 if (isStackingContext() != other.isStackingContext() && rareNonInherited
Data->hasOpacity() != other.rareNonInheritedData->hasOpacity()) { |
558 // FIXME: We would like to use SimplifiedLayout here, but we can't q
uite do that yet. | 558 // FIXME: We would like to use SimplifiedLayout here, but we can't q
uite do that yet. |
559 // We need to make sure SimplifiedLayout can operate correctly on La
youtInlines (we will need | 559 // We need to make sure SimplifiedLayout can operate correctly on La
youtInlines (we will need |
560 // to add a selfNeedsSimplifiedLayout bit in order to not get confus
ed and taint every line). | 560 // to add a selfNeedsSimplifiedLayout bit in order to not get confus
ed and taint every line). |
561 // In addition we need to solve the floating object issue when layer
s come and go. Right now | 561 // In addition we need to solve the floating object issue when layer
s come and go. Right now |
562 // a full layout is necessary to keep floating object lists sane. | 562 // a full layout is necessary to keep floating object lists sane. |
563 return true; | 563 return true; |
564 } | 564 } |
565 } | 565 } |
566 | 566 |
567 if (rareInheritedData.get() != other.rareInheritedData.get()) { | 567 if (rareInheritedData.get() != other.rareInheritedData.get()) { |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 if (!dataEquivalent(thisVar, otherVar)) | 806 if (!dataEquivalent(thisVar, otherVar)) |
807 return true; | 807 return true; |
808 } | 808 } |
809 } | 809 } |
810 | 810 |
811 return false; | 811 return false; |
812 } | 812 } |
813 | 813 |
814 void ComputedStyle::updatePropertySpecificDifferences(const ComputedStyle& other
, StyleDifference& diff) const | 814 void ComputedStyle::updatePropertySpecificDifferences(const ComputedStyle& other
, StyleDifference& diff) const |
815 { | 815 { |
816 // StyleAdjuster has ensured that zIndex is non-auto only if it's applicable
. | 816 if (m_box->zIndex() != other.m_box->zIndex() || isStackingContext() != other
.isStackingContext()) |
817 if (m_box->zIndex() != other.m_box->zIndex() || m_box->hasAutoZIndex() != ot
her.m_box->hasAutoZIndex()) | |
818 diff.setZIndexChanged(); | 817 diff.setZIndexChanged(); |
819 | 818 |
820 if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) { | 819 if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) { |
821 if (!transformDataEquivalent(other)) | 820 if (!transformDataEquivalent(other)) |
822 diff.setTransformChanged(); | 821 diff.setTransformChanged(); |
823 | 822 |
824 if (rareNonInheritedData->opacity != other.rareNonInheritedData->opacity
) | 823 if (rareNonInheritedData->opacity != other.rareNonInheritedData->opacity
) |
825 diff.setOpacityChanged(); | 824 diff.setOpacityChanged(); |
826 | 825 |
827 if (rareNonInheritedData->m_filter != other.rareNonInheritedData->m_filt
er) | 826 if (rareNonInheritedData->m_filter != other.rareNonInheritedData->m_filt
er) |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 { | 887 { |
889 rareInheritedData.access()->quotes = q; | 888 rareInheritedData.access()->quotes = q; |
890 } | 889 } |
891 | 890 |
892 void ComputedStyle::clearCursorList() | 891 void ComputedStyle::clearCursorList() |
893 { | 892 { |
894 if (rareInheritedData->cursorData) | 893 if (rareInheritedData->cursorData) |
895 rareInheritedData.access()->cursorData = nullptr; | 894 rareInheritedData.access()->cursorData = nullptr; |
896 } | 895 } |
897 | 896 |
| 897 static bool hasPropertyThatCreatesStackingContext(const Vector<CSSPropertyID>& p
roperties) |
| 898 { |
| 899 for (CSSPropertyID property : properties) { |
| 900 switch (property) { |
| 901 case CSSPropertyOpacity: |
| 902 case CSSPropertyTransform: |
| 903 case CSSPropertyAliasWebkitTransform: |
| 904 case CSSPropertyTransformStyle: |
| 905 case CSSPropertyAliasWebkitTransformStyle: |
| 906 case CSSPropertyPerspective: |
| 907 case CSSPropertyAliasWebkitPerspective: |
| 908 case CSSPropertyWebkitMask: |
| 909 case CSSPropertyWebkitMaskBoxImage: |
| 910 case CSSPropertyWebkitClipPath: |
| 911 case CSSPropertyWebkitBoxReflect: |
| 912 case CSSPropertyFilter: |
| 913 case CSSPropertyAliasWebkitFilter: |
| 914 case CSSPropertyBackdropFilter: |
| 915 case CSSPropertyZIndex: |
| 916 case CSSPropertyPosition: |
| 917 case CSSPropertyMixBlendMode: |
| 918 case CSSPropertyIsolation: |
| 919 return true; |
| 920 default: |
| 921 break; |
| 922 } |
| 923 } |
| 924 return false; |
| 925 } |
| 926 |
| 927 void ComputedStyle::updateIsStackingContext(bool isDocumentElement, bool isInTop
Layer) |
| 928 { |
| 929 if (isStackingContext()) |
| 930 return; |
| 931 |
| 932 if (isDocumentElement |
| 933 || isInTopLayer |
| 934 || styleType() == PseudoIdBackdrop |
| 935 || hasOpacity() |
| 936 || hasTransformRelatedProperty() |
| 937 || hasMask() |
| 938 || clipPath() |
| 939 || boxReflect() |
| 940 || hasFilterInducingProperty() |
| 941 || hasBlendMode() |
| 942 || hasIsolation() |
| 943 || hasViewportConstrainedPosition() |
| 944 || hasPropertyThatCreatesStackingContext(willChangeProperties()) |
| 945 || containsPaint()) { |
| 946 setIsStackingContext(true); |
| 947 } |
| 948 } |
| 949 |
898 void ComputedStyle::addCallbackSelector(const String& selector) | 950 void ComputedStyle::addCallbackSelector(const String& selector) |
899 { | 951 { |
900 if (!rareNonInheritedData->m_callbackSelectors.contains(selector)) | 952 if (!rareNonInheritedData->m_callbackSelectors.contains(selector)) |
901 rareNonInheritedData.access()->m_callbackSelectors.append(selector); | 953 rareNonInheritedData.access()->m_callbackSelectors.append(selector); |
902 } | 954 } |
903 | 955 |
904 void ComputedStyle::setContent(ContentData* contentData) | 956 void ComputedStyle::setContent(ContentData* contentData) |
905 { | 957 { |
906 SET_VAR(rareNonInheritedData, m_content, contentData); | 958 SET_VAR(rareNonInheritedData, m_content, contentData); |
907 } | 959 } |
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1874 if (value < 0) | 1926 if (value < 0) |
1875 fvalue -= 0.5f; | 1927 fvalue -= 0.5f; |
1876 else | 1928 else |
1877 fvalue += 0.5f; | 1929 fvalue += 0.5f; |
1878 } | 1930 } |
1879 | 1931 |
1880 return roundForImpreciseConversion<int>(fvalue / zoomFactor); | 1932 return roundForImpreciseConversion<int>(fvalue / zoomFactor); |
1881 } | 1933 } |
1882 | 1934 |
1883 } // namespace blink | 1935 } // namespace blink |
OLD | NEW |