#define ENABLE_ASYNC_SCROLLING 1
#endif
-#if !defined(ENABLE_8BIT_TEXTRUN)
-#define ENABLE_8BIT_TEXTRUN 1
-#endif
-
#if !defined(ENABLE_CONTEXT_MENUS)
#define ENABLE_CONTEXT_MENUS 0
#endif
/* --------- Apple MAC port (not IOS) --------- */
#if PLATFORM(MAC) && !PLATFORM(IOS)
-#if !defined(ENABLE_8BIT_TEXTRUN)
-#define ENABLE_8BIT_TEXTRUN 1
-#endif
-
#if !defined(ENABLE_CSS_IMAGE_SET)
#define ENABLE_CSS_IMAGE_SET 1
#endif
#define ENABLE_SUBPIXEL_LAYOUT 1
#endif
-#if !defined(ENABLE_8BIT_TEXTRUN)
-#define ENABLE_8BIT_TEXTRUN 1
-#endif
-
#endif /* PLATFORM(EFL) */
/* --------- Gtk port (Unix, Windows, Mac) --------- */
#define ENABLE_SUBPIXEL_LAYOUT 1
#endif
-#if !defined(ENABLE_8BIT_TEXTRUN)
-#define ENABLE_8BIT_TEXTRUN 1
-#endif
-
#endif /* PLATFORM(GTK) */
/* ENABLE macro defaults for WebCore */
#define ENABLE_3D_RENDERING 0
#endif
-#if !defined(ENABLE_8BIT_TEXTRUN)
-#define ENABLE_8BIT_TEXTRUN 0
-#endif
-
#if !defined(ENABLE_ACCELERATED_2D_CANVAS)
#define ENABLE_ACCELERATED_2D_CANVAS 0
#endif
+2014-02-05 Andreas Kling <akling@apple.com>
+
+ Turn on ENABLE(8BIT_TEXTRUN) for everyone.
+ <https://webkit.org/b/128273>
+
+ Reviewed by Anders Carlsson.
+
+ * platform/graphics/TextRun.h:
+ (WebCore::TextRun::TextRun):
+ (WebCore::TextRun::subRun):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::constructTextRun):
+ * rendering/RenderBlock.h:
+
2014-02-05 Enrica Casucci <enrica@apple.com>
WK2: Caret, selections and autocorrection bubbles are incorrectly positioned when inside an iframe.
typedef unsigned RoundingHacks;
-#if ENABLE(8BIT_TEXTRUN)
TextRun(const LChar* c, unsigned len, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false, bool characterScanForCodePath = true, RoundingHacks roundingHacks = RunRounding | WordRounding)
: m_charactersLength(len)
, m_len(len)
{
m_data.characters8 = c;
}
-#endif
TextRun(const UChar* c, unsigned len, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false, bool characterScanForCodePath = true, RoundingHacks roundingHacks = RunRounding | WordRounding)
: m_charactersLength(len)
, m_disableSpacing(false)
, m_tabSize(0)
{
-#if ENABLE(8BIT_TEXTRUN)
if (m_charactersLength && s.is8Bit()) {
m_data.characters8 = s.characters8();
m_is8Bit = true;
m_data.characters16 = s.deprecatedCharacters();
m_is8Bit = false;
}
-#else
- m_data.characters16 = s.deprecatedCharacters();
- m_is8Bit = false;
-#endif
}
TextRun subRun(unsigned startOffset, unsigned length) const
TextRun result = *this;
-#if ENABLE(8BIT_TEXTRUN)
if (is8Bit()) {
result.setText(data8(startOffset), length);
return result;
}
-#else
- ASSERT(!is8Bit());
-#endif
result.setText(data16(startOffset), length);
return result;
}
return String(m_data.characters16, m_len);
}
-#if ENABLE(8BIT_TEXTRUN)
void setText(const LChar* c, unsigned len) { m_data.characters8 = c; m_len = len; m_is8Bit = true;}
-#endif
void setText(const UChar* c, unsigned len) { m_data.characters16 = c; m_len = len; m_is8Bit = false;}
void setCharactersLength(unsigned charactersLength) { m_charactersLength = charactersLength; }
return run;
}
-#if ENABLE(8BIT_TEXTRUN)
TextRun RenderBlock::constructTextRun(RenderObject* context, const Font& font, const LChar* characters, int length, const RenderStyle& style, TextRun::ExpansionBehavior expansion)
{
return constructTextRunInternal(context, font, characters, length, style, expansion);
}
-#endif
TextRun RenderBlock::constructTextRun(RenderObject* context, const Font& font, const UChar* characters, int length, const RenderStyle& style, TextRun::ExpansionBehavior expansion)
{
TextRun RenderBlock::constructTextRun(RenderObject* context, const Font& font, const RenderText* text, const RenderStyle& style, TextRun::ExpansionBehavior expansion)
{
-#if ENABLE(8BIT_TEXTRUN)
if (text->is8Bit())
return constructTextRunInternal(context, font, text->characters8(), text->textLength(), style, expansion);
return constructTextRunInternal(context, font, text->characters16(), text->textLength(), style, expansion);
-#else
- return constructTextRunInternal(context, font, text->deprecatedCharacters(), text->textLength(), style, expansion);
-#endif
}
TextRun RenderBlock::constructTextRun(RenderObject* context, const Font& font, const RenderText* text, unsigned offset, unsigned length, const RenderStyle& style, TextRun::ExpansionBehavior expansion)
{
ASSERT(offset + length <= text->textLength());
-#if ENABLE(8BIT_TEXTRUN)
if (text->is8Bit())
return constructTextRunInternal(context, font, text->characters8() + offset, length, style, expansion);
return constructTextRunInternal(context, font, text->characters16() + offset, length, style, expansion);
-#else
- return constructTextRunInternal(context, font, text->deprecatedCharacters() + offset, length, style, expansion);
-#endif
}
TextRun RenderBlock::constructTextRun(RenderObject* context, const Font& font, const String& string, const RenderStyle& style, TextRun::ExpansionBehavior expansion, TextRunFlags flags)
{
unsigned length = string.length();
-#if ENABLE(8BIT_TEXTRUN)
if (length && string.is8Bit())
return constructTextRunInternal(context, font, string.characters8(), length, style, expansion, flags);
return constructTextRunInternal(context, font, string.deprecatedCharacters(), length, style, expansion, flags);
-#else
- return constructTextRunInternal(context, font, string.deprecatedCharacters(), length, style, expansion, flags);
-#endif
}
RenderBlock* RenderBlock::createAnonymousWithParentRendererAndDisplay(const RenderObject* parent, EDisplay display)
static TextRun constructTextRun(RenderObject* context, const Font&, const RenderText*, unsigned offset, const RenderStyle&,
TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion);
-#if ENABLE(8BIT_TEXTRUN)
static TextRun constructTextRun(RenderObject* context, const Font&, const LChar* characters, int length, const RenderStyle&,
TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion);
-#endif
static TextRun constructTextRun(RenderObject* context, const Font&, const UChar* characters, int length, const RenderStyle&,
TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion);