summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/style
diff options
context:
space:
mode:
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>2014-01-08 22:22:50 +0000
committerJulien Brianceau <jbriance@cisco.com>2014-06-23 15:29:39 +0200
commitcfd683d676c2d0b8645725065628f120d3ef27aa (patch)
tree5fee767126e3d760dce981a0d2fe3830076e0bd9 /Source/WebCore/rendering/style
parent907ef525390e28dd2524b918e9cb7a0e64e9ee3a (diff)
downloadqtwebkit-cfd683d676c2d0b8645725065628f120d3ef27aa.tar.gz
A fractional value of the css letter-spacing property is not rendered as expected
https://bugs.webkit.org/show_bug.cgi?id=20606 Reviewed by Simon Fraser. Source/WebCore: This turns on fractional letter-spacing and word-spacing CSS values. It is taken mostly from Blink r153727 and iOS. Updating the relevant types is all that is necessary * css/DeprecatedStyleBuilder.cpp: (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder): * page/animation/CSSPropertyAnimation.cpp: (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): * platform/graphics/Font.cpp: (WebCore::Font::Font): (WebCore::Font::width): * platform/graphics/Font.h: (WebCore::Font::wordSpacing): (WebCore::Font::letterSpacing): (WebCore::Font::setWordSpacing): (WebCore::Font::setLetterSpacing): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::wordSpacing): (WebCore::RenderStyle::letterSpacing): (WebCore::RenderStyle::setWordSpacing): (WebCore::RenderStyle::setLetterSpacing): * rendering/style/RenderStyle.h: Change-Id: I49cedbf555426f3fae3fe58ec4eb25569d358997 git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161521 268f45cc-cd09-0410-ab3c-d52691b4dbfc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/rendering/style')
-rw-r--r--Source/WebCore/rendering/style/RenderStyle.cpp8
-rw-r--r--Source/WebCore/rendering/style/RenderStyle.h11
2 files changed, 10 insertions, 9 deletions
diff --git a/Source/WebCore/rendering/style/RenderStyle.cpp b/Source/WebCore/rendering/style/RenderStyle.cpp
index 3e5590c09..2d0bb3b90 100644
--- a/Source/WebCore/rendering/style/RenderStyle.cpp
+++ b/Source/WebCore/rendering/style/RenderStyle.cpp
@@ -1328,8 +1328,8 @@ float RenderStyle::specifiedFontSize() const { return fontDescription().specifie
float RenderStyle::computedFontSize() const { return fontDescription().computedSize(); }
int RenderStyle::fontSize() const { return inherited->font.pixelSize(); }
-int RenderStyle::wordSpacing() const { return inherited->font.wordSpacing(); }
-int RenderStyle::letterSpacing() const { return inherited->font.letterSpacing(); }
+float RenderStyle::wordSpacing() const { return inherited->font.wordSpacing(); }
+float RenderStyle::letterSpacing() const { return inherited->font.letterSpacing(); }
bool RenderStyle::setFontDescription(const FontDescription& v)
{
@@ -1374,8 +1374,8 @@ int RenderStyle::computedLineHeight(RenderView* renderView) const
return lh.value();
}
-void RenderStyle::setWordSpacing(int v) { inherited.access()->font.setWordSpacing(v); }
-void RenderStyle::setLetterSpacing(int v) { inherited.access()->font.setLetterSpacing(v); }
+void RenderStyle::setWordSpacing(float v) { inherited.access()->font.setWordSpacing(v); }
+void RenderStyle::setLetterSpacing(float v) { inherited.access()->font.setLetterSpacing(v); }
void RenderStyle::setFontSize(float size)
{
diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h
index 6a60d7a8a..289c36b49 100644
--- a/Source/WebCore/rendering/style/RenderStyle.h
+++ b/Source/WebCore/rendering/style/RenderStyle.h
@@ -579,8 +579,8 @@ public:
#else
TextDecorationStyle textDecorationStyle() const { return TextDecorationStyleSolid; }
#endif // CSS3_TEXT
- int wordSpacing() const;
- int letterSpacing() const;
+ float wordSpacing() const;
+ float letterSpacing() const;
float zoom() const { return visual->m_zoom; }
float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; }
@@ -1167,8 +1167,8 @@ public:
void setWhiteSpace(EWhiteSpace v) { inherited_flags._white_space = v; }
- void setWordSpacing(int);
- void setLetterSpacing(int);
+ void setWordSpacing(float);
+ void setLetterSpacing(float);
void clearBackgroundLayers() { m_background.access()->m_background = FillLayer(BackgroundFillLayer); }
void inheritBackgroundLayers(const FillLayer& parent) { m_background.access()->m_background = parent; }
@@ -1607,7 +1607,8 @@ public:
static unsigned initialBorderWidth() { return 3; }
static unsigned short initialColumnRuleWidth() { return 3; }
static unsigned short initialOutlineWidth() { return 3; }
- static int initialLetterWordSpacing() { return 0; }
+ static float initialLetterSpacing() { return 0; }
+ static float initialWordSpacing() { return 0; }
static Length initialSize() { return Length(); }
static Length initialMinSize() { return Length(Fixed); }
static Length initialMaxSize() { return Length(Undefined); }