diff options
author | Ben Murdoch <benm@google.com> | 2010-10-22 13:02:20 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-10-26 15:21:41 +0100 |
commit | a94275402997c11dd2e778633dacf4b7e630a35d (patch) | |
tree | e66f56c67e3b01f22c9c23cd932271ee9ac558ed /WebCore/rendering/style | |
parent | 09e26c78506587b3f5d930d7bc72a23287ffbec0 (diff) | |
download | external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.zip external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.gz external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.bz2 |
Merge WebKit at r70209: Initial merge by Git
Change-Id: Id23a68efa36e9d1126bcce0b137872db00892c8e
Diffstat (limited to 'WebCore/rendering/style')
-rw-r--r-- | WebCore/rendering/style/RenderStyle.cpp | 199 | ||||
-rw-r--r-- | WebCore/rendering/style/RenderStyle.h | 51 | ||||
-rw-r--r-- | WebCore/rendering/style/RenderStyleConstants.h | 6 | ||||
-rw-r--r-- | WebCore/rendering/style/SVGRenderStyle.cpp | 4 | ||||
-rw-r--r-- | WebCore/rendering/style/SVGRenderStyle.h | 9 | ||||
-rw-r--r-- | WebCore/rendering/style/SVGRenderStyleDefs.h | 2 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleAllInOne.cpp | 49 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleRareInheritedData.cpp | 5 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleRareInheritedData.h | 1 |
9 files changed, 209 insertions, 117 deletions
diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp index 623a298..b56bb1e 100644 --- a/WebCore/rendering/style/RenderStyle.cpp +++ b/WebCore/rendering/style/RenderStyle.cpp @@ -297,8 +297,12 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon changedContextSensitiveProperties = ContextSensitivePropertyNone; #if ENABLE(SVG) - if (m_svgStyle != other->m_svgStyle) - return m_svgStyle->diff(other->m_svgStyle.get()); + StyleDifference svgChange = StyleDifferenceEqual; + if (m_svgStyle != other->m_svgStyle) { + svgChange = m_svgStyle->diff(other->m_svgStyle.get()); + if (svgChange == StyleDifferenceLayout) + return svgChange; + } #endif if (m_box->width() != other->m_box->width() || @@ -442,7 +446,7 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon return StyleDifferenceLayout; // Check block flow direction. - if (inherited_flags._blockFlow != other->inherited_flags._blockFlow) + if (inherited_flags.m_writingMode != other->inherited_flags.m_writingMode) return StyleDifferenceLayout; // Overflow returns a layout hint. @@ -475,6 +479,15 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon if ((visibility() == COLLAPSE) != (other->visibility() == COLLAPSE)) return StyleDifferenceLayout; + +#if ENABLE(SVG) + // SVGRenderStyle::diff() might have returned StyleDifferenceRepaint, eg. if fill changes. + // If eg. the font-size changed at the same time, we're not allowed to return StyleDifferenceRepaint, + // but have to return StyleDifferenceLayout, that's why this if branch comes after all branches + // that are relevant for SVG and might return StyleDifferenceLayout. + if (svgChange != StyleDifferenceEqual) + return svgChange; +#endif // Make sure these left/top/right/bottom checks stay below all layout checks and above // all visible checks. @@ -922,52 +935,52 @@ void RenderStyle::setBlendedFontSize(int size) font().update(currentFontSelector); } -void RenderStyle::getBoxShadowExtent(int &top, int &right, int &bottom, int &left) const +void RenderStyle::getShadowExtent(const ShadowData* shadow, int &top, int &right, int &bottom, int &left) const { top = 0; right = 0; bottom = 0; left = 0; - for (const ShadowData* boxShadow = this->boxShadow(); boxShadow; boxShadow = boxShadow->next()) { - if (boxShadow->style() == Inset) + for ( ; shadow; shadow = shadow->next()) { + if (shadow->style() == Inset) continue; - int blurAndSpread = boxShadow->blur() + boxShadow->spread(); + int blurAndSpread = shadow->blur() + shadow->spread(); - top = min(top, boxShadow->y() - blurAndSpread); - right = max(right, boxShadow->x() + blurAndSpread); - bottom = max(bottom, boxShadow->y() + blurAndSpread); - left = min(left, boxShadow->x() - blurAndSpread); + top = min(top, shadow->y() - blurAndSpread); + right = max(right, shadow->x() + blurAndSpread); + bottom = max(bottom, shadow->y() + blurAndSpread); + left = min(left, shadow->x() - blurAndSpread); } } -void RenderStyle::getBoxShadowHorizontalExtent(int &left, int &right) const +void RenderStyle::getShadowHorizontalExtent(const ShadowData* shadow, int &left, int &right) const { left = 0; right = 0; - for (const ShadowData* boxShadow = this->boxShadow(); boxShadow; boxShadow = boxShadow->next()) { - if (boxShadow->style() == Inset) + for ( ; shadow; shadow = shadow->next()) { + if (shadow->style() == Inset) continue; - int blurAndSpread = boxShadow->blur() + boxShadow->spread(); + int blurAndSpread = shadow->blur() + shadow->spread(); - left = min(left, boxShadow->x() - blurAndSpread); - right = max(right, boxShadow->x() + blurAndSpread); + left = min(left, shadow->x() - blurAndSpread); + right = max(right, shadow->x() + blurAndSpread); } } -void RenderStyle::getBoxShadowVerticalExtent(int &top, int &bottom) const +void RenderStyle::getShadowVerticalExtent(const ShadowData* shadow, int &top, int &bottom) const { top = 0; bottom = 0; - for (const ShadowData* boxShadow = this->boxShadow(); boxShadow; boxShadow = boxShadow->next()) { - if (boxShadow->style() == Inset) + for ( ; shadow; shadow = shadow->next()) { + if (shadow->style() == Inset) continue; - int blurAndSpread = boxShadow->blur() + boxShadow->spread(); + int blurAndSpread = shadow->blur() + shadow->spread(); - top = min(top, boxShadow->y() - blurAndSpread); - bottom = max(bottom, boxShadow->y() + blurAndSpread); + top = min(top, shadow->y() - blurAndSpread); + bottom = max(bottom, shadow->y() + blurAndSpread); } } @@ -1066,56 +1079,56 @@ const Color RenderStyle::visitedDependentColor(int colorProperty) const Length RenderStyle::logicalWidth() const { - if (isVerticalBlockFlow()) + if (isHorizontalWritingMode()) return width(); return height(); } Length RenderStyle::logicalHeight() const { - if (isVerticalBlockFlow()) + if (isHorizontalWritingMode()) return height(); return width(); } Length RenderStyle::logicalMinWidth() const { - if (isVerticalBlockFlow()) + if (isHorizontalWritingMode()) return minWidth(); return minHeight(); } Length RenderStyle::logicalMaxWidth() const { - if (isVerticalBlockFlow()) + if (isHorizontalWritingMode()) return maxWidth(); return maxHeight(); } Length RenderStyle::logicalMinHeight() const { - if (isVerticalBlockFlow()) + if (isHorizontalWritingMode()) return minHeight(); return minWidth(); } Length RenderStyle::logicalMaxHeight() const { - if (isVerticalBlockFlow()) + if (isHorizontalWritingMode()) return maxHeight(); return maxWidth(); } unsigned short RenderStyle::borderBeforeWidth() const { - switch (blockFlow()) { - case TopToBottomBlockFlow: + switch (writingMode()) { + case TopToBottomWritingMode: return borderTopWidth(); - case BottomToTopBlockFlow: + case BottomToTopWritingMode: return borderBottomWidth(); - case LeftToRightBlockFlow: + case LeftToRightWritingMode: return borderLeftWidth(); - case RightToLeftBlockFlow: + case RightToLeftWritingMode: return borderRightWidth(); } ASSERT_NOT_REACHED(); @@ -1124,14 +1137,14 @@ unsigned short RenderStyle::borderBeforeWidth() const unsigned short RenderStyle::borderAfterWidth() const { - switch (blockFlow()) { - case TopToBottomBlockFlow: + switch (writingMode()) { + case TopToBottomWritingMode: return borderBottomWidth(); - case BottomToTopBlockFlow: + case BottomToTopWritingMode: return borderTopWidth(); - case LeftToRightBlockFlow: + case LeftToRightWritingMode: return borderRightWidth(); - case RightToLeftBlockFlow: + case RightToLeftWritingMode: return borderLeftWidth(); } ASSERT_NOT_REACHED(); @@ -1140,28 +1153,28 @@ unsigned short RenderStyle::borderAfterWidth() const unsigned short RenderStyle::borderStartWidth() const { - if (isVerticalBlockFlow()) - return direction() == LTR ? borderLeftWidth() : borderRightWidth(); - return direction() == LTR ? borderTopWidth() : borderBottomWidth(); + if (isHorizontalWritingMode()) + return isLeftToRightDirection() ? borderLeftWidth() : borderRightWidth(); + return isLeftToRightDirection() ? borderTopWidth() : borderBottomWidth(); } unsigned short RenderStyle::borderEndWidth() const { - if (isVerticalBlockFlow()) - return direction() == LTR ? borderRightWidth() : borderLeftWidth(); - return direction() == LTR ? borderBottomWidth() : borderTopWidth(); + if (isHorizontalWritingMode()) + return isLeftToRightDirection() ? borderRightWidth() : borderLeftWidth(); + return isLeftToRightDirection() ? borderBottomWidth() : borderTopWidth(); } Length RenderStyle::marginBefore() const { - switch (blockFlow()) { - case TopToBottomBlockFlow: + switch (writingMode()) { + case TopToBottomWritingMode: return marginTop(); - case BottomToTopBlockFlow: + case BottomToTopWritingMode: return marginBottom(); - case LeftToRightBlockFlow: + case LeftToRightWritingMode: return marginLeft(); - case RightToLeftBlockFlow: + case RightToLeftWritingMode: return marginRight(); } ASSERT_NOT_REACHED(); @@ -1170,14 +1183,14 @@ Length RenderStyle::marginBefore() const Length RenderStyle::marginAfter() const { - switch (blockFlow()) { - case TopToBottomBlockFlow: + switch (writingMode()) { + case TopToBottomWritingMode: return marginBottom(); - case BottomToTopBlockFlow: + case BottomToTopWritingMode: return marginTop(); - case LeftToRightBlockFlow: + case LeftToRightWritingMode: return marginRight(); - case RightToLeftBlockFlow: + case RightToLeftWritingMode: return marginLeft(); } ASSERT_NOT_REACHED(); @@ -1186,14 +1199,14 @@ Length RenderStyle::marginAfter() const Length RenderStyle::marginBeforeUsing(const RenderStyle* otherStyle) const { - switch (otherStyle->blockFlow()) { - case TopToBottomBlockFlow: + switch (otherStyle->writingMode()) { + case TopToBottomWritingMode: return marginTop(); - case BottomToTopBlockFlow: + case BottomToTopWritingMode: return marginBottom(); - case LeftToRightBlockFlow: + case LeftToRightWritingMode: return marginLeft(); - case RightToLeftBlockFlow: + case RightToLeftWritingMode: return marginRight(); } ASSERT_NOT_REACHED(); @@ -1202,14 +1215,14 @@ Length RenderStyle::marginBeforeUsing(const RenderStyle* otherStyle) const Length RenderStyle::marginAfterUsing(const RenderStyle* otherStyle) const { - switch (otherStyle->blockFlow()) { - case TopToBottomBlockFlow: + switch (otherStyle->writingMode()) { + case TopToBottomWritingMode: return marginBottom(); - case BottomToTopBlockFlow: + case BottomToTopWritingMode: return marginTop(); - case LeftToRightBlockFlow: + case LeftToRightWritingMode: return marginRight(); - case RightToLeftBlockFlow: + case RightToLeftWritingMode: return marginLeft(); } ASSERT_NOT_REACHED(); @@ -1218,42 +1231,42 @@ Length RenderStyle::marginAfterUsing(const RenderStyle* otherStyle) const Length RenderStyle::marginStart() const { - if (isVerticalBlockFlow()) - return direction() == LTR ? marginLeft() : marginRight(); - return direction() == LTR ? marginTop() : marginBottom(); + if (isHorizontalWritingMode()) + return isLeftToRightDirection() ? marginLeft() : marginRight(); + return isLeftToRightDirection() ? marginTop() : marginBottom(); } Length RenderStyle::marginEnd() const { - if (isVerticalBlockFlow()) - return direction() == LTR ? marginRight() : marginLeft(); - return direction() == LTR ? marginBottom() : marginTop(); + if (isHorizontalWritingMode()) + return isLeftToRightDirection() ? marginRight() : marginLeft(); + return isLeftToRightDirection() ? marginBottom() : marginTop(); } Length RenderStyle::marginStartUsing(const RenderStyle* otherStyle) const { - if (otherStyle->isVerticalBlockFlow()) - return otherStyle->direction() == LTR ? marginLeft() : marginRight(); - return otherStyle->direction() == LTR ? marginTop() : marginBottom(); + if (otherStyle->isHorizontalWritingMode()) + return otherStyle->isLeftToRightDirection() ? marginLeft() : marginRight(); + return otherStyle->isLeftToRightDirection() ? marginTop() : marginBottom(); } Length RenderStyle::marginEndUsing(const RenderStyle* otherStyle) const { - if (otherStyle->isVerticalBlockFlow()) - return otherStyle->direction() == LTR ? marginRight() : marginLeft(); - return otherStyle->direction() == LTR ? marginBottom() : marginTop(); + if (otherStyle->isHorizontalWritingMode()) + return otherStyle->isLeftToRightDirection() ? marginRight() : marginLeft(); + return otherStyle->isLeftToRightDirection() ? marginBottom() : marginTop(); } Length RenderStyle::paddingBefore() const { - switch (blockFlow()) { - case TopToBottomBlockFlow: + switch (writingMode()) { + case TopToBottomWritingMode: return paddingTop(); - case BottomToTopBlockFlow: + case BottomToTopWritingMode: return paddingBottom(); - case LeftToRightBlockFlow: + case LeftToRightWritingMode: return paddingLeft(); - case RightToLeftBlockFlow: + case RightToLeftWritingMode: return paddingRight(); } ASSERT_NOT_REACHED(); @@ -1262,14 +1275,14 @@ Length RenderStyle::paddingBefore() const Length RenderStyle::paddingAfter() const { - switch (blockFlow()) { - case TopToBottomBlockFlow: + switch (writingMode()) { + case TopToBottomWritingMode: return paddingBottom(); - case BottomToTopBlockFlow: + case BottomToTopWritingMode: return paddingTop(); - case LeftToRightBlockFlow: + case LeftToRightWritingMode: return paddingRight(); - case RightToLeftBlockFlow: + case RightToLeftWritingMode: return paddingLeft(); } ASSERT_NOT_REACHED(); @@ -1278,16 +1291,16 @@ Length RenderStyle::paddingAfter() const Length RenderStyle::paddingStart() const { - if (isVerticalBlockFlow()) - return direction() == LTR ? paddingLeft() : paddingRight(); - return direction() == LTR ? paddingTop() : paddingBottom(); + if (isHorizontalWritingMode()) + return isLeftToRightDirection() ? paddingLeft() : paddingRight(); + return isLeftToRightDirection() ? paddingTop() : paddingBottom(); } Length RenderStyle::paddingEnd() const { - if (isVerticalBlockFlow()) - return direction() == LTR ? paddingRight() : paddingLeft(); - return direction() == LTR ? paddingBottom() : paddingTop(); + if (isHorizontalWritingMode()) + return isLeftToRightDirection() ? paddingRight() : paddingLeft(); + return isLeftToRightDirection() ? paddingBottom() : paddingTop(); } } // namespace WebCore diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h index 6ecbd56..587b473 100644 --- a/WebCore/rendering/style/RenderStyle.h +++ b/WebCore/rendering/style/RenderStyle.h @@ -29,7 +29,6 @@ #include "AnimationList.h" #include "BorderData.h" #include "BorderValue.h" -#include "CSSHelper.h" #include "CSSImageGeneratorValue.h" #include "CSSPrimitiveValue.h" #include "CSSPropertyNames.h" @@ -179,7 +178,7 @@ protected: (_force_backgrounds_to_white == other._force_backgrounds_to_white) && (_pointerEvents == other._pointerEvents) && (_insideLink == other._insideLink) && - (_blockFlow == other._blockFlow); + (m_writingMode == other.m_writingMode); } bool operator!=(const InheritedFlags& other) const { return !(*this == other); } @@ -207,7 +206,7 @@ protected: // 43 bits // CSS Text Layout Module Level 3: Vertical writing support - unsigned _blockFlow : 2; // EBlockFlowDirection + unsigned m_writingMode : 2; // WritingMode // 45 bits } inherited_flags; @@ -284,7 +283,7 @@ protected: inherited_flags._force_backgrounds_to_white = false; inherited_flags._pointerEvents = initialPointerEvents(); inherited_flags._insideLink = NotInsideLink; - inherited_flags._blockFlow = initialBlockFlow(); + inherited_flags.m_writingMode = initialWritingMode(); noninherited_flags._effectiveDisplay = noninherited_flags._originalDisplay = initialDisplay(); noninherited_flags._overflowX = initialOverflowX(); @@ -307,10 +306,10 @@ protected: } private: - RenderStyle(); + ALWAYS_INLINE RenderStyle(); // used to create the default style. - RenderStyle(bool); - RenderStyle(const RenderStyle&); + ALWAYS_INLINE RenderStyle(bool); + ALWAYS_INLINE RenderStyle(const RenderStyle&); public: static PassRefPtr<RenderStyle> create(); @@ -476,6 +475,8 @@ public: float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; } TextDirection direction() const { return static_cast<TextDirection>(inherited_flags._direction); } + bool isLeftToRightDirection() const { return direction() == LTR; } + Length lineHeight() const { return inherited->line_height; } int computedLineHeight() const { @@ -636,6 +637,11 @@ public: } const ShadowData* textShadow() const { return rareInheritedData->textShadow; } + void getTextShadowExtent(int& top, int& right, int& bottom, int& left) const { getShadowExtent(textShadow(), top, right, bottom, left); } + void getTextShadowHorizontalExtent(int& left, int& right) const { getShadowHorizontalExtent(textShadow(), left, right); } + void getTextShadowVerticalExtent(int& top, int& bottom) const { getShadowVerticalExtent(textShadow(), top, bottom); } + void getTextShadowInlineDirectionExtent(int& logicalLeft, int& logicalRight) { getShadowInlineDirectionExtent(textShadow(), logicalLeft, logicalRight); } + float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; } ColorSpace colorSpace() const { return static_cast<ColorSpace>(rareInheritedData->colorSpace); } float opacity() const { return rareNonInheritedData->opacity; } @@ -650,9 +656,10 @@ public: EBoxAlignment boxPack() const { return static_cast<EBoxAlignment>(rareNonInheritedData->flexibleBox->pack); } const ShadowData* boxShadow() const { return rareNonInheritedData->m_boxShadow.get(); } - void getBoxShadowExtent(int &top, int &right, int &bottom, int &left) const; - void getBoxShadowHorizontalExtent(int &left, int &right) const; - void getBoxShadowVerticalExtent(int &top, int &bottom) const; + void getBoxShadowExtent(int& top, int& right, int& bottom, int& left) const { getShadowExtent(boxShadow(), top, right, bottom, left); } + void getBoxShadowHorizontalExtent(int& left, int& right) const { getShadowHorizontalExtent(boxShadow(), left, right); } + void getBoxShadowVerticalExtent(int& top, int& bottom) const { getShadowVerticalExtent(boxShadow(), top, bottom); } + void getBoxShadowInlineDirectionExtent(int& logicalLeft, int& logicalRight) { getShadowInlineDirectionExtent(boxShadow(), logicalLeft, logicalRight); } StyleReflection* boxReflect() const { return rareNonInheritedData->m_boxReflect.get(); } EBoxSizing boxSizing() const { return m_box->boxSizing(); } @@ -742,9 +749,11 @@ public: bool textSizeAdjust() const { return rareInheritedData->textSizeAdjust; } ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(rareInheritedData->textSecurity); } - EBlockFlowDirection blockFlow() const { return static_cast<EBlockFlowDirection>(inherited_flags._blockFlow); } - bool isVerticalBlockFlow() const { return blockFlow() == TopToBottomBlockFlow || blockFlow() == BottomToTopBlockFlow; } + WritingMode writingMode() const { return static_cast<WritingMode>(inherited_flags.m_writingMode); } + bool isHorizontalWritingMode() const { return writingMode() == TopToBottomWritingMode || writingMode() == BottomToTopWritingMode; } + bool isFlippedLinesWritingMode() const { return writingMode() == LeftToRightWritingMode || writingMode() == BottomToTopWritingMode; } +<<<<<<< HEAD #ifdef ANDROID_CSS_RING // called when building nav cache to determine if the ring data is unchanged const void* ringData() const { return reinterpret_cast<const void*>(rareInheritedData.get()); } @@ -762,6 +771,10 @@ public: Color tapHighlightColor() const { return rareInheritedData->tapHighlightColor; } #endif +======= + ESpeak speak() { return static_cast<ESpeak>(rareInheritedData->speak); } + +>>>>>>> webkit.org at r70209 // attribute setter methods void setDisplay(EDisplay v) { noninherited_flags._effectiveDisplay = v; } @@ -1054,6 +1067,7 @@ public: void setTransformOriginX(Length l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_x, l); } void setTransformOriginY(Length l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_y, l); } void setTransformOriginZ(float f) { SET_VAR(rareNonInheritedData.access()->m_transform, m_z, f); } + void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); } // End CSS3 Setters // Apple-specific property setters @@ -1156,7 +1170,7 @@ public: originalDisplay() == INLINE_BOX || originalDisplay() == INLINE_TABLE; } - void setBlockFlow(EBlockFlowDirection v) { inherited_flags._blockFlow = v; } + void setWritingMode(WritingMode v) { inherited_flags.m_writingMode = v; } // To tell if this style matched attribute selectors. This makes it impossible to share. bool affectedByAttributeSelectors() const { return m_affectedByAttributeSelectors; } @@ -1197,7 +1211,7 @@ public: static ECaptionSide initialCaptionSide() { return CAPTOP; } static EClear initialClear() { return CNONE; } static TextDirection initialDirection() { return LTR; } - static EBlockFlowDirection initialBlockFlow() { return TopToBottomBlockFlow; } + static WritingMode initialWritingMode() { return TopToBottomWritingMode; } static EDisplay initialDisplay() { return INLINE; } static EEmptyCell initialEmptyCells() { return SHOW; } static EFloat initialFloating() { return FNONE; } @@ -1262,6 +1276,7 @@ public: static EKHTMLLineBreak initialKHTMLLineBreak() { return LBNORMAL; } static EMatchNearestMailBlockquoteColor initialMatchNearestMailBlockquoteColor() { return BCNORMAL; } static const AtomicString& initialHighlight() { return nullAtom; } + static ESpeak initialSpeak() { return SpeakNormal; } static Hyphens initialHyphens() { return HyphensManual; } static const AtomicString& initialHyphenationString() { return nullAtom; } static const AtomicString& initialHyphenationLocale() { return nullAtom; } @@ -1309,6 +1324,14 @@ public: #endif private: + void getShadowExtent(const ShadowData*, int& top, int& right, int& bottom, int& left) const; + void getShadowHorizontalExtent(const ShadowData*, int& left, int& right) const; + void getShadowVerticalExtent(const ShadowData*, int& top, int& bottom) const; + void getShadowInlineDirectionExtent(const ShadowData* shadow, int& logicalLeft, int& logicalRight) const + { + return isHorizontalWritingMode() ? getShadowHorizontalExtent(shadow, logicalLeft, logicalRight) : getShadowVerticalExtent(shadow, logicalLeft, logicalRight); + } + // Color accessors are all private to make sure callers use visitedDependentColor instead to access them. const Color& borderLeftColor() const { return surround->border.left().color(); } const Color& borderRightColor() const { return surround->border.right().color(); } diff --git a/WebCore/rendering/style/RenderStyleConstants.h b/WebCore/rendering/style/RenderStyleConstants.h index 94d30d5..0112c03 100644 --- a/WebCore/rendering/style/RenderStyleConstants.h +++ b/WebCore/rendering/style/RenderStyleConstants.h @@ -129,8 +129,8 @@ enum EUnicodeBidi { }; // CSS Text Layout Module Level 3: Vertical writing support -enum EBlockFlowDirection { - TopToBottomBlockFlow, RightToLeftBlockFlow, LeftToRightBlockFlow, BottomToTopBlockFlow +enum WritingMode { + TopToBottomWritingMode, RightToLeftWritingMode, LeftToRightWritingMode, BottomToTopWritingMode }; enum EFillAttachment { @@ -415,6 +415,8 @@ enum ELineClampType { LineClampLineCount, LineClampPercentage }; enum Hyphens { HyphensNone, HyphensManual, HyphensAuto }; +enum ESpeak { SpeakNone, SpeakNormal, SpeakSpellOut, SpeakDigits, SpeakLiteralPunctuation, SpeakNoPunctuation }; + } // namespace WebCore #endif // RenderStyleConstants_h diff --git a/WebCore/rendering/style/SVGRenderStyle.cpp b/WebCore/rendering/style/SVGRenderStyle.cpp index 7d1ad3b..28f80f2 100644 --- a/WebCore/rendering/style/SVGRenderStyle.cpp +++ b/WebCore/rendering/style/SVGRenderStyle.cpp @@ -138,7 +138,7 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const if (resources != other->resources) return StyleDifferenceLayout; - // If markers change, we need a relayout, as marker boundaries are cached in RenderPath. + // If markers change, we need a relayout, as marker boundaries are cached in RenderSVGPath. if (inheritedResources != other->inheritedResources) return StyleDifferenceLayout; @@ -190,7 +190,7 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const return StyleDifferenceRepaint; } - // If fill changes, we just need to repaint. Fill boundaries are not influenced by this, only by the Path, that RenderPath contains. + // If fill changes, we just need to repaint. Fill boundaries are not influenced by this, only by the Path, that RenderSVGPath contains. if (fill != other->fill) return StyleDifferenceRepaint; diff --git a/WebCore/rendering/style/SVGRenderStyle.h b/WebCore/rendering/style/SVGRenderStyle.h index d57e4cf..8f0be39 100644 --- a/WebCore/rendering/style/SVGRenderStyle.h +++ b/WebCore/rendering/style/SVGRenderStyle.h @@ -67,7 +67,7 @@ public: static LineJoin initialJoinStyle() { return MiterJoin; } static EShapeRendering initialShapeRendering() { return SR_AUTO; } static ETextAnchor initialTextAnchor() { return TA_START; } - static EWritingMode initialWritingMode() { return WM_LRTB; } + static SVGWritingMode initialWritingMode() { return WM_LRTB; } static EGlyphOrientation initialGlyphOrientationHorizontal() { return GO_0DEG; } static EGlyphOrientation initialGlyphOrientationVertical() { return GO_AUTO; } static float initialFillOpacity() { return 1.0f; } @@ -132,7 +132,7 @@ public: void setJoinStyle(LineJoin val) { svg_inherited_flags._joinStyle = val; } void setShapeRendering(EShapeRendering val) { svg_inherited_flags._shapeRendering = val; } void setTextAnchor(ETextAnchor val) { svg_inherited_flags._textAnchor = val; } - void setWritingMode(EWritingMode val) { svg_inherited_flags._writingMode = val; } + void setWritingMode(SVGWritingMode val) { svg_inherited_flags._writingMode = val; } void setGlyphOrientationHorizontal(EGlyphOrientation val) { svg_inherited_flags._glyphOrientationHorizontal = val; } void setGlyphOrientationVertical(EGlyphOrientation val) { svg_inherited_flags._glyphOrientationVertical = val; } @@ -281,7 +281,7 @@ public: LineJoin joinStyle() const { return (LineJoin) svg_inherited_flags._joinStyle; } EShapeRendering shapeRendering() const { return (EShapeRendering) svg_inherited_flags._shapeRendering; } ETextAnchor textAnchor() const { return (ETextAnchor) svg_inherited_flags._textAnchor; } - EWritingMode writingMode() const { return (EWritingMode) svg_inherited_flags._writingMode; } + SVGWritingMode writingMode() const { return (SVGWritingMode) svg_inherited_flags._writingMode; } EGlyphOrientation glyphOrientationHorizontal() const { return (EGlyphOrientation) svg_inherited_flags._glyphOrientationHorizontal; } EGlyphOrientation glyphOrientationVertical() const { return (EGlyphOrientation) svg_inherited_flags._glyphOrientationVertical; } float fillOpacity() const { return fill->opacity; } @@ -314,6 +314,7 @@ public: bool hasMarkers() const { return !markerStartResource().isEmpty() || !markerMidResource().isEmpty() || !markerEndResource().isEmpty(); } bool hasStroke() const { return strokePaint()->paintType() != SVGPaint::SVG_PAINTTYPE_NONE; } bool hasFill() const { return fillPaint()->paintType() != SVGPaint::SVG_PAINTTYPE_NONE; } + bool isVerticalWritingMode() const { return writingMode() == WM_TBRL || writingMode() == WM_TB; } protected: // inherit @@ -350,7 +351,7 @@ protected: unsigned _textAnchor : 2; // ETextAnchor unsigned _colorInterpolation : 2; // EColorInterpolation unsigned _colorInterpolationFilters : 2; // EColorInterpolation - unsigned _writingMode : 3; // EWritingMode + unsigned _writingMode : 3; // SVGWritingMode unsigned _glyphOrientationHorizontal : 3; // EGlyphOrientation unsigned _glyphOrientationVertical : 3; // EGlyphOrientation } svg_inherited_flags; diff --git a/WebCore/rendering/style/SVGRenderStyleDefs.h b/WebCore/rendering/style/SVGRenderStyleDefs.h index 339bb77..de058a2 100644 --- a/WebCore/rendering/style/SVGRenderStyleDefs.h +++ b/WebCore/rendering/style/SVGRenderStyleDefs.h @@ -64,7 +64,7 @@ namespace WebCore { SR_AUTO, SR_OPTIMIZESPEED, SR_CRISPEDGES, SR_GEOMETRICPRECISION }; - enum EWritingMode { + enum SVGWritingMode { WM_LRTB, WM_LR, WM_RLTB, WM_RL, WM_TBRL, WM_TB }; diff --git a/WebCore/rendering/style/StyleAllInOne.cpp b/WebCore/rendering/style/StyleAllInOne.cpp new file mode 100644 index 0000000..25b539f --- /dev/null +++ b/WebCore/rendering/style/StyleAllInOne.cpp @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2010 Apple Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// This all-in-one cpp file cuts down on template bloat to allow us to build our Windows release build. + +#include "ContentData.cpp" +#include "CounterDirectives.cpp" +#include "FillLayer.cpp" +#include "KeyframeList.cpp" +#include "NinePieceImage.cpp" +#include "RenderStyle.cpp" +#include "SVGRenderStyle.cpp" +#include "SVGRenderStyleDefs.cpp" +#include "ShadowData.cpp" +#include "StyleBackgroundData.cpp" +#include "StyleBoxData.cpp" +#include "StyleCachedImage.cpp" +#include "StyleFlexibleBoxData.cpp" +#include "StyleGeneratedImage.cpp" +#include "StyleInheritedData.cpp" +#include "StyleMarqueeData.cpp" +#include "StyleMultiColData.cpp" +#include "StyleRareInheritedData.cpp" +#include "StyleRareNonInheritedData.cpp" +#include "StyleSurroundData.cpp" +#include "StyleTransformData.cpp" +#include "StyleVisualData.cpp" diff --git a/WebCore/rendering/style/StyleRareInheritedData.cpp b/WebCore/rendering/style/StyleRareInheritedData.cpp index 42f2030..af2b555 100644 --- a/WebCore/rendering/style/StyleRareInheritedData.cpp +++ b/WebCore/rendering/style/StyleRareInheritedData.cpp @@ -57,7 +57,8 @@ StyleRareInheritedData::StyleRareInheritedData() , textSizeAdjust(RenderStyle::initialTextSizeAdjust()) , resize(RenderStyle::initialResize()) , userSelect(RenderStyle::initialUserSelect()) - , colorSpace(DeviceColorSpace) + , colorSpace(ColorSpaceDeviceRGB) + , speak(SpeakNormal) , hyphens(HyphensManual) { } @@ -98,6 +99,7 @@ StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o) , resize(o.resize) , userSelect(o.userSelect) , colorSpace(o.colorSpace) + , speak(o.speak) , hyphens(o.hyphens) , hyphenationString(o.hyphenationString) , hyphenationLocale(o.hyphenationLocale) @@ -154,6 +156,7 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const && resize == o.resize && userSelect == o.userSelect && colorSpace == o.colorSpace + && speak == o.speak && hyphens == o.hyphens && hyphenationString == o.hyphenationString && hyphenationLocale == o.hyphenationLocale; diff --git a/WebCore/rendering/style/StyleRareInheritedData.h b/WebCore/rendering/style/StyleRareInheritedData.h index ba914d4..4ebbf88 100644 --- a/WebCore/rendering/style/StyleRareInheritedData.h +++ b/WebCore/rendering/style/StyleRareInheritedData.h @@ -91,6 +91,7 @@ public: unsigned resize : 2; // EResize unsigned userSelect : 1; // EUserSelect unsigned colorSpace : 1; // ColorSpace + unsigned speak : 3; // ESpeak unsigned hyphens : 2; // Hyphens AtomicString hyphenationString; |