diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
commit | 32761a6cee1d0dee366b885b7b9c777e67885688 (patch) | |
tree | d6bec92bebfb216f4126356e55518842c2f476a1 /Source/WebCore/rendering/style/StyleRareInheritedData.cpp | |
parent | a4e969f4965059196ca948db781e52f7cfebf19e (diff) | |
download | WebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz |
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/WebCore/rendering/style/StyleRareInheritedData.cpp')
-rw-r--r-- | Source/WebCore/rendering/style/StyleRareInheritedData.cpp | 81 |
1 files changed, 51 insertions, 30 deletions
diff --git a/Source/WebCore/rendering/style/StyleRareInheritedData.cpp b/Source/WebCore/rendering/style/StyleRareInheritedData.cpp index 2098b9179..dcca2021d 100644 --- a/Source/WebCore/rendering/style/StyleRareInheritedData.cpp +++ b/Source/WebCore/rendering/style/StyleRareInheritedData.cpp @@ -23,14 +23,11 @@ #include "StyleRareInheritedData.h" #include "CursorList.h" -#include "DataRef.h" #include "QuotesData.h" #include "RenderStyle.h" #include "RenderStyleConstants.h" #include "ShadowData.h" -#include "StyleCustomPropertyData.h" #include "StyleImage.h" -#include <wtf/PointerComparison.h> namespace WebCore { @@ -63,8 +60,6 @@ struct GreaterThanOrSameSizeAsStyleRareInheritedData : public RefCounted<Greater #if ENABLE(TOUCH_EVENTS) Color tapHighlightColor; #endif - - void* customPropertyDataRefs[1]; }; COMPILE_ASSERT(sizeof(StyleRareInheritedData) <= sizeof(GreaterThanOrSameSizeAsStyleRareInheritedData), StyleRareInheritedData_should_bit_pack); @@ -74,7 +69,6 @@ StyleRareInheritedData::StyleRareInheritedData() , textStrokeWidth(RenderStyle::initialTextStrokeWidth()) , indent(RenderStyle::initialTextIndent()) , m_effectiveZoom(RenderStyle::initialZoom()) - , m_customProperties(StyleCustomPropertyData::create()) , widows(RenderStyle::initialWidows()) , orphans(RenderStyle::initialOrphans()) , m_hasAutoWidows(true) @@ -85,13 +79,15 @@ StyleRareInheritedData::StyleRareInheritedData() , overflowWrap(RenderStyle::initialOverflowWrap()) , nbspMode(NBNORMAL) , lineBreak(LineBreakAuto) + , resize(RenderStyle::initialResize()) , userSelect(RenderStyle::initialUserSelect()) + , colorSpace(ColorSpaceDeviceRGB) , speak(SpeakNormal) , hyphens(HyphensManual) , textEmphasisFill(TextEmphasisFillFilled) , textEmphasisMark(TextEmphasisMarkNone) , textEmphasisPosition(TextEmphasisPositionOver | TextEmphasisPositionRight) - , m_textOrientation(static_cast<unsigned>(TextOrientation::Mixed)) + , m_textOrientation(TextOrientationVerticalRight) #if ENABLE(CSS3_TEXT) , m_textIndentLine(RenderStyle::initialTextIndentLine()) , m_textIndentType(RenderStyle::initialTextIndentType()) @@ -117,19 +113,17 @@ StyleRareInheritedData::StyleRareInheritedData() , m_textDecorationSkip(RenderStyle::initialTextDecorationSkip()) , m_textUnderlinePosition(RenderStyle::initialTextUnderlinePosition()) , m_rubyPosition(RenderStyle::initialRubyPosition()) - , m_textZoom(RenderStyle::initialTextZoom()) #if PLATFORM(IOS) , touchCalloutEnabled(RenderStyle::initialTouchCalloutEnabled()) #endif -#if ENABLE(CSS_TRAILING_WORD) - , trailingWord(static_cast<unsigned>(RenderStyle::initialTrailingWord())) -#endif - , m_hangingPunctuation(RenderStyle::initialHangingPunctuation()) , hyphenationLimitBefore(-1) , hyphenationLimitAfter(-1) , hyphenationLimitLines(-1) , m_lineGrid(RenderStyle::initialLineGrid()) , m_tabSize(RenderStyle::initialTabSize()) +#if PLATFORM(IOS) + , compositionFillColor(RenderStyle::initialCompositionFillColor()) +#endif #if ENABLE(IOS_TEXT_AUTOSIZING) , textSizeAdjust(RenderStyle::initialTextSizeAdjust()) #endif @@ -152,11 +146,11 @@ inline StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedDa , visitedLinkTextStrokeColor(o.visitedLinkTextStrokeColor) , visitedLinkTextFillColor(o.visitedLinkTextFillColor) , visitedLinkTextEmphasisColor(o.visitedLinkTextEmphasisColor) - , textShadow(o.textShadow ? std::make_unique<ShadowData>(*o.textShadow) : nullptr) + , textShadow(o.textShadow ? adoptPtr(new ShadowData(*o.textShadow)) : nullptr) + , highlight(o.highlight) , cursorData(o.cursorData) , indent(o.indent) , m_effectiveZoom(o.m_effectiveZoom) - , m_customProperties(o.m_customProperties) , widows(o.widows) , orphans(o.orphans) , m_hasAutoWidows(o.m_hasAutoWidows) @@ -167,7 +161,9 @@ inline StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedDa , overflowWrap(o.overflowWrap) , nbspMode(o.nbspMode) , lineBreak(o.lineBreak) + , resize(o.resize) , userSelect(o.userSelect) + , colorSpace(o.colorSpace) , speak(o.speak) , hyphens(o.hyphens) , textEmphasisFill(o.textEmphasisFill) @@ -199,21 +195,20 @@ inline StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedDa , m_textDecorationSkip(o.m_textDecorationSkip) , m_textUnderlinePosition(o.m_textUnderlinePosition) , m_rubyPosition(o.m_rubyPosition) - , m_textZoom(o.m_textZoom) #if PLATFORM(IOS) , touchCalloutEnabled(o.touchCalloutEnabled) #endif -#if ENABLE(CSS_TRAILING_WORD) - , trailingWord(o.trailingWord) -#endif - , m_hangingPunctuation(o.m_hangingPunctuation) , hyphenationString(o.hyphenationString) , hyphenationLimitBefore(o.hyphenationLimitBefore) , hyphenationLimitAfter(o.hyphenationLimitAfter) , hyphenationLimitLines(o.hyphenationLimitLines) + , locale(o.locale) , textEmphasisCustomMark(o.textEmphasisCustomMark) , m_lineGrid(o.m_lineGrid) , m_tabSize(o.m_tabSize) +#if PLATFORM(IOS) + , compositionFillColor(o.compositionFillColor) +#endif #if ENABLE(IOS_TEXT_AUTOSIZING) , textSizeAdjust(o.textSizeAdjust) #endif @@ -226,7 +221,7 @@ inline StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedDa { } -Ref<StyleRareInheritedData> StyleRareInheritedData::copy() const +PassRef<StyleRareInheritedData> StyleRareInheritedData::copy() const { return adoptRef(*new StyleRareInheritedData(*this)); } @@ -235,6 +230,24 @@ StyleRareInheritedData::~StyleRareInheritedData() { } +static bool cursorDataEquivalent(const CursorList* c1, const CursorList* c2) +{ + if (c1 == c2) + return true; + if ((!c1 && c2) || (c1 && !c2)) + return false; + return (*c1 == *c2); +} + +static bool quotesDataEquivalent(const QuotesData* q1, const QuotesData* q2) +{ + if (q1 == q2) + return true; + if ((!q1 && q2) || (q1 && !q2)) + return false; + return (*q1 == *q2); +} + bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const { return textStrokeColor == o.textStrokeColor @@ -247,8 +260,9 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const #if ENABLE(TOUCH_EVENTS) && tapHighlightColor == o.tapHighlightColor #endif - && arePointingToEqualData(textShadow, o.textShadow) - && arePointingToEqualData(cursorData, o.cursorData) + && shadowDataEquivalent(o) + && highlight == o.highlight + && cursorDataEquivalent(cursorData.get(), o.cursorData.get()) && indent == o.indent && m_effectiveZoom == o.m_effectiveZoom && widows == o.widows @@ -267,7 +281,9 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const #if ENABLE(IOS_TEXT_AUTOSIZING) && textSizeAdjust == o.textSizeAdjust #endif + && resize == o.resize && userSelect == o.userSelect + && colorSpace == o.colorSpace && speak == o.speak && hyphens == o.hyphens && hyphenationLimitBefore == o.hyphenationLimitBefore @@ -284,10 +300,12 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const && m_lineBoxContain == o.m_lineBoxContain #if PLATFORM(IOS) && touchCalloutEnabled == o.touchCalloutEnabled + && compositionFillColor == o.compositionFillColor #endif && hyphenationString == o.hyphenationString + && locale == o.locale && textEmphasisCustomMark == o.textEmphasisCustomMark - && arePointingToEqualData(quotes, o.quotes) + && quotesDataEquivalent(quotes.get(), o.quotes.get()) && m_tabSize == o.m_tabSize && m_lineGrid == o.m_lineGrid #if ENABLE(CSS_IMAGE_ORIENTATION) @@ -306,15 +324,18 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const && m_textDecorationSkip == o.m_textDecorationSkip && m_textUnderlinePosition == o.m_textUnderlinePosition && m_rubyPosition == o.m_rubyPosition - && m_textZoom == o.m_textZoom && m_lineSnap == o.m_lineSnap && m_lineAlign == o.m_lineAlign -#if ENABLE(CSS_TRAILING_WORD) - && trailingWord == o.trailingWord -#endif - && m_hangingPunctuation == o.m_hangingPunctuation - && m_customProperties == o.m_customProperties - && arePointingToEqualData(listStyleImage, o.listStyleImage); + && StyleImage::imagesEquivalent(listStyleImage.get(), o.listStyleImage.get()); +} + +bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData& o) const +{ + if ((!textShadow && o.textShadow) || (textShadow && !o.textShadow)) + return false; + if (textShadow && o.textShadow && (*textShadow != *o.textShadow)) + return false; + return true; } } // namespace WebCore |