Commit e4e30fe8 authored by eae@chromium.org's avatar eae@chromium.org

Remove FontDescription::mutableFontDescription

Change RenderStyle::setWordSpacing and RenderStyle::setLetterSpacing to
replace the FontDescription instead of modifying the existing instance,
the same way the other font methods already do. This allows us to
remove the mutableFontDescription method from FontDescription.

R=dglazkov@chromium.org
BUG=

Review URL: https://codereview.chromium.org/207573002

git-svn-id: svn://svn.chromium.org/blink/trunk@169718 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 8634dbe6
......@@ -1229,8 +1229,23 @@ int RenderStyle::computedLineHeight() const
return lh.value();
}
void RenderStyle::setWordSpacing(float v) { inherited.access()->font.mutableFontDescription().setWordSpacing(v); }
void RenderStyle::setLetterSpacing(float v) { inherited.access()->font.mutableFontDescription().setLetterSpacing(v); }
void RenderStyle::setWordSpacing(float wordSpacing)
{
FontSelector* currentFontSelector = font().fontSelector();
FontDescription desc(fontDescription());
desc.setWordSpacing(wordSpacing);
setFontDescription(desc);
font().update(currentFontSelector);
}
void RenderStyle::setLetterSpacing(float letterSpacing)
{
FontSelector* currentFontSelector = font().fontSelector();
FontDescription desc(fontDescription());
desc.setLetterSpacing(letterSpacing);
setFontDescription(desc);
font().update(currentFontSelector);
}
void RenderStyle::setFontSize(float size)
{
......
......@@ -88,9 +88,6 @@ public:
bool operator!=(const Font& other) const { return !(*this == other); }
const FontDescription& fontDescription() const { return m_fontDescription; }
// FIXME: This is currently used by RenderStyle::setWordSpacing and RenderStyle::setLetterSpacing.
// They are being removed. Do NOT add new uses of this function. Use FontBuilder instead.
FontDescription& mutableFontDescription() { return m_fontDescription; }
void update(PassRefPtr<FontSelector>) const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment