diff options
author | Ben Murdoch <benm@google.com> | 2010-06-15 19:36:43 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-06-16 14:52:28 +0100 |
commit | 545e470e52f0ac6a3a072bf559c796b42c6066b6 (patch) | |
tree | c0c14763654d84d37577dde512c3d3b4699a9e86 /WebCore/rendering/style | |
parent | 719298a66237d38ea5c05f1547123ad8aacbc237 (diff) | |
download | external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.zip external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.tar.gz external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.tar.bz2 |
Merge webkit.org at r61121: Initial merge by git.
Change-Id: Icd6db395c62285be384d137164d95d7466c98760
Diffstat (limited to 'WebCore/rendering/style')
-rw-r--r-- | WebCore/rendering/style/RenderStyle.cpp | 3 | ||||
-rw-r--r-- | WebCore/rendering/style/SVGRenderStyle.cpp | 33 | ||||
-rw-r--r-- | WebCore/rendering/style/SVGRenderStyle.h | 8 | ||||
-rw-r--r-- | WebCore/rendering/style/SVGRenderStyleDefs.h | 5 |
4 files changed, 27 insertions, 22 deletions
diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp index 220e657..af4e055 100644 --- a/WebCore/rendering/style/RenderStyle.cpp +++ b/WebCore/rendering/style/RenderStyle.cpp @@ -916,11 +916,12 @@ const Animation* RenderStyle::transitionForProperty(int property) const void RenderStyle::setBlendedFontSize(int size) { + FontSelector* currentFontSelector = font().fontSelector(); FontDescription desc(fontDescription()); desc.setSpecifiedSize(size); desc.setComputedSize(size); setFontDescription(desc); - font().update(font().fontSelector()); + font().update(currentFontSelector); } void RenderStyle::getBoxShadowExtent(int &top, int &right, int &bottom, int &left) const diff --git a/WebCore/rendering/style/SVGRenderStyle.cpp b/WebCore/rendering/style/SVGRenderStyle.cpp index 042b8f7..f4e6cb5 100644 --- a/WebCore/rendering/style/SVGRenderStyle.cpp +++ b/WebCore/rendering/style/SVGRenderStyle.cpp @@ -1,6 +1,6 @@ /* Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> - 2004, 2005 Rob Buis <buis@kde.org> + 2004, 2005, 2010 Rob Buis <buis@kde.org> Copyright (C) Research In Motion Limited 2010. All rights reserved. Based on khtml code by: @@ -146,14 +146,14 @@ float SVGRenderStyle::cssPrimitiveToLength(const RenderObject* item, CSSValue* v return primitive->computeLengthFloat(const_cast<RenderStyle*>(item->style()), item->document()->documentElement()->renderStyle()); } -static void getSVGShadowExtent(ShadowData* shadow, int& top, int& right, int& bottom, int& left) +static void getSVGShadowExtent(ShadowData* shadow, float& top, float& right, float& bottom, float& left) { - top = 0; - right = 0; - bottom = 0; - left = 0; + top = 0.0f; + right = 0.0f; + bottom = 0.0f; + left = 0.0f; - int blurAndSpread = shadow->blur() + shadow->spread(); + float blurAndSpread = shadow->blur() + shadow->spread(); top = min(top, shadow->y() - blurAndSpread); right = max(right, shadow->x() + blurAndSpread); @@ -178,21 +178,14 @@ void SVGRenderStyle::inflateForShadow(FloatRect& repaintRect) const if (!svgShadow) return; - int shadowTop; - int shadowRight; - int shadowBottom; - int shadowLeft; + float shadowTop; + float shadowRight; + float shadowBottom; + float shadowLeft; getSVGShadowExtent(svgShadow, shadowTop, shadowRight, shadowBottom, shadowLeft); - int overflowLeft = repaintRect.x() + shadowLeft; - int overflowRight = repaintRect.right() + shadowRight; - int overflowTop = repaintRect.y() + shadowTop; - int overflowBottom = repaintRect.bottom() + shadowBottom; - - repaintRect.setX(overflowLeft); - repaintRect.setY(overflowTop); - repaintRect.setWidth(overflowRight - overflowLeft); - repaintRect.setHeight(overflowBottom - overflowTop); + repaintRect.move(shadowLeft, shadowTop); + repaintRect.setSize(repaintRect.size() + FloatSize(shadowRight - shadowLeft, shadowBottom - shadowTop)); } } diff --git a/WebCore/rendering/style/SVGRenderStyle.h b/WebCore/rendering/style/SVGRenderStyle.h index 3d6a7da..b0bef61 100644 --- a/WebCore/rendering/style/SVGRenderStyle.h +++ b/WebCore/rendering/style/SVGRenderStyle.h @@ -58,6 +58,7 @@ public: SVG_RS_DEFINE_ATTRIBUTE(EAlignmentBaseline, AlignmentBaseline, alignmentBaseline, AB_AUTO) SVG_RS_DEFINE_ATTRIBUTE(EDominantBaseline, DominantBaseline, dominantBaseline, DB_AUTO) SVG_RS_DEFINE_ATTRIBUTE(EBaselineShift, BaselineShift, baselineShift, BS_BASELINE) + SVG_RS_DEFINE_ATTRIBUTE(EVectorEffect, VectorEffect, vectorEffect, VE_NONE) SVG_RS_DEFINE_ATTRIBUTE_INHERITED(LineCap, CapStyle, capStyle, ButtCap) SVG_RS_DEFINE_ATTRIBUTE_INHERITED(WindRule, ClipRule, clipRule, RULE_NONZERO) @@ -108,6 +109,9 @@ public: SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, inheritedResources, markerEnd, MarkerEndResource, markerEndResource, String()) // convenience + bool hasClipper() const { return !clipperResource().isEmpty(); } + bool hasMasker() const { return !maskerResource().isEmpty(); } + bool hasFilter() const { return !filterResource().isEmpty(); } 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; } @@ -165,7 +169,8 @@ protected: unsigned _alignmentBaseline : 4; // EAlignmentBaseline unsigned _dominantBaseline : 4; // EDominantBaseline unsigned _baselineShift : 2; // EBaselineShift - // 22 bits unused + unsigned _vectorEffect: 1; // EVectorEffect + // 21 bits unused } f; uint32_t _niflags; }; @@ -210,6 +215,7 @@ private: svg_noninherited_flags.f._alignmentBaseline = initialAlignmentBaseline(); svg_noninherited_flags.f._dominantBaseline = initialDominantBaseline(); svg_noninherited_flags.f._baselineShift = initialBaselineShift(); + svg_noninherited_flags.f._vectorEffect = initialVectorEffect(); } }; diff --git a/WebCore/rendering/style/SVGRenderStyleDefs.h b/WebCore/rendering/style/SVGRenderStyleDefs.h index e0354e6..207cefa 100644 --- a/WebCore/rendering/style/SVGRenderStyleDefs.h +++ b/WebCore/rendering/style/SVGRenderStyleDefs.h @@ -121,6 +121,11 @@ namespace WebCore { DB_IDEOGRAPHIC, DB_ALPHABETIC, DB_HANGING, DB_MATHEMATICAL, DB_CENTRAL, DB_MIDDLE, DB_TEXT_AFTER_EDGE, DB_TEXT_BEFORE_EDGE }; + + enum EVectorEffect { + VE_NONE, + VE_NON_SCALING_STROKE + }; class CSSValue; class CSSValueList; |