Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1057)

Unified Diff: Source/core/rendering/RenderText.cpp

Issue 27030014: Remove Backslash-as-JPY hack (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: TextCodec/Encoding added Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/RenderText.cpp
diff --git a/Source/core/rendering/RenderText.cpp b/Source/core/rendering/RenderText.cpp
index 1ce6ed6b510b4a1034a2c6190df236252c6adc11..84808c189ef3ffe0d673143ec3974527919aa645 100644
--- a/Source/core/rendering/RenderText.cpp
+++ b/Source/core/rendering/RenderText.cpp
@@ -30,7 +30,6 @@
#include "core/fetch/TextResourceDecoder.h"
#include "core/frame/FrameView.h"
#include "core/page/Settings.h"
-#include "core/platform/text/transcoder/FontTranscoder.h"
#include "core/rendering/EllipsisBox.h"
#include "core/rendering/InlineTextBox.h"
#include "core/rendering/RenderBlock.h"
@@ -137,7 +136,6 @@ RenderText::RenderText(Node* node, PassRefPtr<StringImpl> str)
, m_linesDirty(false)
, m_containsReversedText(false)
, m_knownToHaveNoOverflowAndNoFallbackFonts(false)
- , m_needsTranscoding(false)
, m_minWidth(-1)
, m_maxWidth(-1)
, m_firstLineMinWidth(0)
@@ -184,12 +182,6 @@ bool RenderText::isWordBreak() const
return false;
}
-void RenderText::updateNeedsTranscoding()
-{
- const WTF::TextEncoding* encoding = document().decoder() ? &document().decoder()->encoding() : 0;
- m_needsTranscoding = fontTranscoder().needsTranscoding(style()->font().fontDescription(), encoding);
-}
-
void RenderText::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
// There is no need to ever schedule repaints from a style change of a text run, since
@@ -202,18 +194,9 @@ void RenderText::styleDidChange(StyleDifference diff, const RenderStyle* oldStyl
}
RenderStyle* newStyle = style();
- bool needsResetText = false;
- if (!oldStyle) {
- updateNeedsTranscoding();
- needsResetText = m_needsTranscoding;
- } else if (oldStyle->font().needsTranscoding() != newStyle->font().needsTranscoding() || (newStyle->font().needsTranscoding() && oldStyle->font().family().family() != newStyle->font().family().family())) {
- updateNeedsTranscoding();
- needsResetText = true;
- }
-
ETextTransform oldTransform = oldStyle ? oldStyle->textTransform() : TTNONE;
ETextSecurity oldSecurity = oldStyle ? oldStyle->textSecurity() : TSNONE;
- if (needsResetText || oldTransform != newStyle->textTransform() || oldSecurity != newStyle->textSecurity())
+ if (oldTransform != newStyle->textTransform() || oldSecurity != newStyle->textSecurity())
transformText();
if (!text().containsOnlyWhitespace())
@@ -1329,11 +1312,6 @@ void RenderText::setTextInternal(PassRefPtr<StringImpl> text)
{
ASSERT(text);
m_text = text;
- if (m_needsTranscoding) {
- const WTF::TextEncoding* encoding = document().decoder() ? &document().decoder()->encoding() : 0;
- fontTranscoder().convert(m_text, style()->font().fontDescription(), encoding);
- }
- ASSERT(m_text);
if (style()) {
applyTextTransform(style(), m_text, previousCharacter());
@@ -1398,19 +1376,6 @@ void RenderText::setText(PassRefPtr<StringImpl> text, bool force)
cache->textChanged(this);
}
-String RenderText::textWithoutTranscoding() const
-{
- // If m_text isn't transcoded or is secure, we can just return the modified text.
- if (!m_needsTranscoding || style()->textSecurity() != TSNONE)
- return text();
-
- // Otherwise, we should use original text. If text-transform is
- // specified, we should transform the text on the fly.
- String text = originalText();
- applyTextTransform(style(), text, previousCharacter());
- return text;
-}
-
void RenderText::dirtyLineBoxes(bool fullLayout)
{
if (fullLayout)
« no previous file with comments | « Source/core/rendering/RenderImage.cpp ('k') | Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698