From 2bde8e466a4451c7319e3a072d118917957d6554 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Wed, 25 May 2011 19:08:45 +0100 Subject: Merge WebKit at r82507: Initial merge by git Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e --- Source/WebCore/rendering/RenderCombineText.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Source/WebCore/rendering/RenderCombineText.cpp') diff --git a/Source/WebCore/rendering/RenderCombineText.cpp b/Source/WebCore/rendering/RenderCombineText.cpp index 250ec9b..37ca1ed 100644 --- a/Source/WebCore/rendering/RenderCombineText.cpp +++ b/Source/WebCore/rendering/RenderCombineText.cpp @@ -37,6 +37,7 @@ RenderCombineText::RenderCombineText(Node* node, PassRefPtr string) void RenderCombineText::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) { + setStyleInternal(RenderStyle::clone(style())); RenderText::styleDidChange(diff, oldStyle); if (m_isCombined) @@ -93,12 +94,12 @@ void RenderCombineText::combineText() return; TextRun run = TextRun(String(text())); - FontDescription description = style()->font().fontDescription(); + FontDescription description = originalFont().fontDescription(); float emWidth = description.computedSize() * textCombineMargin; bool shouldUpdateFont = false; description.setOrientation(Horizontal); // We are going to draw combined text horizontally. - m_combinedTextWidth = style()->font().width(run); + m_combinedTextWidth = originalFont().width(run); m_isCombined = m_combinedTextWidth <= emWidth; if (m_isCombined) @@ -122,12 +123,14 @@ void RenderCombineText::combineText() } } + if (!m_isCombined) + shouldUpdateFont = style()->setFontDescription(originalFont().fontDescription()); + if (shouldUpdateFont) style()->font().update(style()->font().fontSelector()); if (m_isCombined) { - static const UChar newCharacter = objectReplacementCharacter; - DEFINE_STATIC_LOCAL(String, objectReplacementCharacterString, (&newCharacter, 1)); + DEFINE_STATIC_LOCAL(String, objectReplacementCharacterString, (&objectReplacementCharacter, 1)); RenderText::setTextInternal(objectReplacementCharacterString.impl()); } } -- cgit v1.1