From e14391e94c850b8bd03680c23b38978db68687a8 Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 4 Nov 2010 12:00:17 -0700 Subject: Merge Webkit at r70949: Initial merge by git. Change-Id: I77b8645c083b5d0da8dba73ed01d4014aab9848e --- WebCore/rendering/style/CursorList.h | 2 ++ WebCore/rendering/style/RenderStyle.cpp | 25 +++++++++++++++++++++++++ WebCore/rendering/style/RenderStyle.h | 9 +++++++++ 3 files changed, 36 insertions(+) (limited to 'WebCore/rendering/style') diff --git a/WebCore/rendering/style/CursorList.h b/WebCore/rendering/style/CursorList.h index 1b82684..a1d1fe7 100644 --- a/WebCore/rendering/style/CursorList.h +++ b/WebCore/rendering/style/CursorList.h @@ -40,6 +40,8 @@ public: const CursorData& operator[](int i) const { return m_vector[i]; } CursorData& operator[](int i) { return m_vector[i]; } + const CursorData& at(size_t i) const { return m_vector.at(i); } + CursorData& at(size_t i) { return m_vector.at(i); } bool operator==(const CursorList& o) const { return m_vector == o.m_vector; } bool operator!=(const CursorList& o) const { return m_vector != o.m_vector; } diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp index b56bb1e..ec77367 100644 --- a/WebCore/rendering/style/RenderStyle.cpp +++ b/WebCore/rendering/style/RenderStyle.cpp @@ -27,6 +27,7 @@ #include "FontSelector.h" #include "RenderArena.h" #include "RenderObject.h" +#include "ScaleTransformOperation.h" #include "StyleImage.h" #include #include @@ -244,6 +245,19 @@ RenderStyle* RenderStyle::addCachedPseudoStyle(PassRefPtr pseudo) return result; } +void RenderStyle::removeCachedPseudoStyle(PseudoId pid) +{ + if (!m_cachedPseudoStyles) + return; + for (size_t i = 0; i < m_cachedPseudoStyles->size(); ++i) { + RenderStyle* pseudoStyle = m_cachedPseudoStyles->at(i).get(); + if (pseudoStyle->styleType() == pid) { + m_cachedPseudoStyles->remove(i); + return; + } + } +} + bool RenderStyle::inheritedNotEqual(const RenderStyle* other) const { return inherited_flags != other->inherited_flags || @@ -680,6 +694,17 @@ void RenderStyle::applyTransform(TransformationMatrix& transform, const IntSize& } } +void RenderStyle::setPageScaleTransform(float scale) +{ + if (scale == 1) + return; + TransformOperations transform; + transform.operations().append(ScaleTransformOperation::create(scale, scale, ScaleTransformOperation::SCALE)); + setTransform(transform); + setTransformOriginX(Length(0, Fixed)); + setTransformOriginY(Length(0, Fixed)); +} + void RenderStyle::setTextShadow(ShadowData* val, bool add) { ASSERT(!val || (!val->spread() && val->style() == Normal)); diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h index 96645cf..f14e8f5 100644 --- a/WebCore/rendering/style/RenderStyle.h +++ b/WebCore/rendering/style/RenderStyle.h @@ -325,6 +325,7 @@ public: RenderStyle* getCachedPseudoStyle(PseudoId) const; RenderStyle* addCachedPseudoStyle(PassRefPtr); + void removeCachedPseudoStyle(PseudoId); const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoStyles.get(); } @@ -641,6 +642,7 @@ public: 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); } + void getTextShadowBlockDirectionExtent(int& logicalTop, int& logicalBottom) { getShadowBlockDirectionExtent(textShadow(), logicalTop, logicalBottom); } float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; } ColorSpace colorSpace() const { return static_cast(rareInheritedData->colorSpace); } @@ -660,6 +662,7 @@ public: 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); } + void getBoxShadowBlockDirectionExtent(int& logicalTop, int& logicalBottom) { getShadowBlockDirectionExtent(boxShadow(), logicalTop, logicalBottom); } StyleReflection* boxReflect() const { return rareNonInheritedData->m_boxReflect.get(); } EBoxSizing boxSizing() const { return m_box->boxSizing(); } @@ -711,6 +714,7 @@ public: enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin }; void applyTransform(TransformationMatrix&, const IntSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin) const; + void setPageScaleTransform(float); bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); } // End CSS3 Getters @@ -752,6 +756,7 @@ public: WritingMode writingMode() const { return static_cast(inherited_flags.m_writingMode); } bool isHorizontalWritingMode() const { return writingMode() == TopToBottomWritingMode || writingMode() == BottomToTopWritingMode; } bool isFlippedLinesWritingMode() const { return writingMode() == LeftToRightWritingMode || writingMode() == BottomToTopWritingMode; } + bool isFlippedBlocksWritingMode() const { return writingMode() == RightToLeftWritingMode || writingMode() == BottomToTopWritingMode; } ESpeak speak() { return static_cast(rareInheritedData->speak); } @@ -1327,6 +1332,10 @@ private: { return isHorizontalWritingMode() ? getShadowHorizontalExtent(shadow, logicalLeft, logicalRight) : getShadowVerticalExtent(shadow, logicalLeft, logicalRight); } + void getShadowBlockDirectionExtent(const ShadowData* shadow, int& logicalTop, int& logicalBottom) const + { + return isHorizontalWritingMode() ? getShadowVerticalExtent(shadow, logicalTop, logicalBottom) : getShadowHorizontalExtent(shadow, logicalTop, logicalBottom); + } // Color accessors are all private to make sure callers use visitedDependentColor instead to access them. const Color& borderLeftColor() const { return surround->border.left().color(); } -- cgit v1.1