Turn on ENABLE(8BIT_TEXTRUN) for everyone.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Feb 2014 23:30:10 +0000 (23:30 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Feb 2014 23:30:10 +0000 (23:30 +0000)
<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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163478 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/wtf/FeatureDefines.h
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/TextRun.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h

index b7dacc838f06eb801eecb567a47618d20d7b7044..1f48957d8b682c7e3f7c631ef40fc23ff5e8d5be 100644 (file)
 #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
index 161081cbab0f9427502901924048e19b644a8d53..7e3c7d85b44887fdee1d78b338616164e2761253 100644 (file)
@@ -1,3 +1,17 @@
+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.
index 5296f075874cc8f58284e19fd2d99f510c1ef646..8eb9d9cc5a663366ba140209e0129c2e97cad35b 100644 (file)
@@ -59,7 +59,6 @@ public:
 
     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)
@@ -79,7 +78,6 @@ public:
     {
         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)
@@ -117,7 +115,6 @@ public:
         , m_disableSpacing(false)
         , m_tabSize(0)
     {
-#if ENABLE(8BIT_TEXTRUN)
         if (m_charactersLength && s.is8Bit()) {
             m_data.characters8 = s.characters8();
             m_is8Bit = true;
@@ -125,10 +122,6 @@ public:
             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
@@ -137,14 +130,10 @@ public:
 
         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;
     }
@@ -166,9 +155,7 @@ public:
         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; }
 
index 62767eb3f9588bcb4f38460d5af789e12fa9e7f5..951ec25e6b67cfddf41a8cc79fd583b6e9407516 100644 (file)
@@ -5413,12 +5413,10 @@ static inline TextRun constructTextRunInternal(RenderObject* context, const Font
     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)
 {
@@ -5427,38 +5425,26 @@ TextRun RenderBlock::constructTextRun(RenderObject* context, const Font& font, c
 
 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)
index abc3aa9ec155d9d89316b04cef139a1ac95af643..d20fdac4acac665a6551bdb296596647fb4a3a2f 100644 (file)
@@ -246,10 +246,8 @@ public:
     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);