Commit e19551fa authored by darin@apple.com's avatar darin@apple.com

2009-04-28 Darin Adler <darin@apple.com>

        Reviewed by Sam Weinig.

        * rendering/RenderText.cpp:
        (WebCore::RenderText::RenderText): Streamline code path to avoid a bit of reference count
        churn and remove a strange unneeeded PassRefPtr typecast. Also added a comment.
        (WebCore::RenderText::setTextInternal): Ditto.



git-svn-id: svn://svn.chromium.org/blink/trunk@42951 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 9aa3af47
2009-04-28 Darin Adler <darin@apple.com>
Reviewed by Sam Weinig.
* rendering/RenderText.cpp:
(WebCore::RenderText::RenderText): Streamline code path to avoid a bit of reference count
churn and remove a strange unneeeded PassRefPtr typecast. Also added a comment.
(WebCore::RenderText::setTextInternal): Ditto.
2009-04-27 Eric Seidel <eric@webkit.org>
Reviewed by Simon Fraser.
......@@ -54,7 +54,7 @@ static inline bool charactersAreAllASCII(StringImpl* text)
RenderText::RenderText(Node* node, PassRefPtr<StringImpl> str)
: RenderObject(node)
, m_text(str)
, m_text(document()->displayStringModifiedByEncoding(str))
, m_firstTextBox(0)
, m_lastTextBox(0)
, m_minWidth(-1)
......@@ -68,9 +68,12 @@ RenderText::RenderText(Node* node, PassRefPtr<StringImpl> str)
, m_knownNotToUseFallbackFonts(false)
{
ASSERT(m_text);
setIsText();
m_text = document()->displayStringModifiedByEncoding(PassRefPtr<StringImpl>(m_text));
// FIXME: It would be better to call this only if !m_text->containsOnlyWhitespace().
// But that might slow things down, and maybe should only be done if visuallyNonEmpty
// is still false. Not making any change for now, but should consider in the future.
view()->frameView()->setIsVisuallyNonEmpty();
}
......@@ -917,10 +920,10 @@ UChar RenderText::previousCharacter()
void RenderText::setTextInternal(PassRefPtr<StringImpl> text)
{
m_text = text;
ASSERT(text);
m_text = document()->displayStringModifiedByEncoding(text);
ASSERT(m_text);
m_text = document()->displayStringModifiedByEncoding(PassRefPtr<StringImpl>(m_text));
#if ENABLE(SVG)
if (isSVGText()) {
if (style() && style()->whiteSpace() == PRE) {
......
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