parseHTMLInteger() should take a StringView in parameter
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Sep 2016 18:08:32 +0000 (18:08 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Sep 2016 18:08:32 +0000 (18:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=161669

Reviewed by Ryosuke Niwa.

Source/JavaScriptCore:

* runtime/DateConversion.cpp:
(JSC::formatDateTime):
Explicitly construct a String from the const WCHAR* on Windows because
it is ambiguous otherwise now that there is a StringBuilder::append()
overload taking an AtomicString in.

Source/WebCore:

parseHTMLInteger() should take a StringView in parameter instead of a
const String&.

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontFaceSrcLocal):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserString::toStringView):
Add toStringView() to avoid unnecessarily constructing a String for
calling StringBuilder::append().

* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseHTMLInteger):
(WebCore::parseHTMLNonNegativeInteger):
(WebCore::parseHTTPRefreshInternal):
* html/parser/HTMLParserIdioms.h:
(WebCore::limitToOnlyHTMLNonNegativeNumbersGreaterThanZero):
(WebCore::limitToOnlyHTMLNonNegative):
Take a StringView in parameter instead of a const String&.

* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::isColumnDeclaredAsBlob):
Avoid unnecessarily constructing a String to call equalLettersIgnoringASCIICase()
by leveraging the StringView constructor taking a 'const char*' in parameter.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::constructTextRun):
* rendering/RenderBlock.h:
Add constructTextRun() overload taking an AtomicString. It was otherwise ambiguous
because both a String or a StringView could be constructed from an AtomicString.

* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS):
(WebCore::buildDisplayStringForTrackBase):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsStyleSheet):
(WebCore::RenderThemeMac::mediaControlsScript):
Explicitly construct a String from NSString / CFStringRef types as such calls are
now ambiguous.

Source/WTF:

* wtf/text/StringBuilder.h:
(WTF::StringBuilder::append):
Add StringBuilder::append() overload taking an AtomicString in parameter.
It used to call StringBuilder::append(const String&) implicitly when
passing an AtomicString. However, it is now ambiguous because there
is an overload taking a StringView, and it is now possible to construct
a StringView from an AtomicString.

* wtf/text/StringView.h:
(WTF::StringView::StringView):
- Add StringView constructor taking an AtomicString in parameter for
  convenience. This avoids having to call AtomicString::string()
  explicitly at call sites.
- Add StringView constructor taking a 'const char*' in parameter for
  performance. There are several call sites that were passing a const
  char* and implicitly constructing an unnecessary String to construct
  a StringView. This became more obvious because the constructor taking
  an AtomicString in parameter made such calls ambiguous.

Tools:

Explicitly construct a String from the CFStringRef in order to call
StringBuilder::append(). This is needed now that there is an append()
overload taking an AtomicString in parameter.

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::dumpDOMAsWebArchive):

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

18 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/DateConversion.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/text/StringBuilder.h
Source/WTF/wtf/text/StringView.h
Source/WebCore/ChangeLog
Source/WebCore/css/parser/CSSParser.cpp
Source/WebCore/css/parser/CSSParserValues.h
Source/WebCore/html/parser/HTMLParserIdioms.cpp
Source/WebCore/html/parser/HTMLParserIdioms.h
Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp
Source/WebCore/platform/sql/SQLiteStatement.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderThemeIOS.mm
Source/WebCore/rendering/RenderThemeMac.mm
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

index 2be0f25..1c47403 100644 (file)
@@ -1,3 +1,16 @@
+2016-09-10  Chris Dumez  <cdumez@apple.com>
+
+        parseHTMLInteger() should take a StringView in parameter
+        https://bugs.webkit.org/show_bug.cgi?id=161669
+
+        Reviewed by Ryosuke Niwa.
+
+        * runtime/DateConversion.cpp:
+        (JSC::formatDateTime):
+        Explicitly construct a String from the const WCHAR* on Windows because
+        it is ambiguous otherwise now that there is a StringBuilder::append()
+        overload taking an AtomicString in.
+
 2016-09-08  Keith Miller  <keith_miller@apple.com>
 
         WASM should support if-then-else
index 0b57f01..df9a60d 100644 (file)
@@ -115,7 +115,11 @@ String formatDateTime(const GregorianDateTime& t, DateTimeFormat format, bool as
 #endif
             if (timeZoneName[0]) {
                 builder.appendLiteral(" (");
+#if OS(WINDOWS)
+                builder.append(String(timeZoneName));
+#else
                 builder.append(timeZoneName);
+#endif
                 builder.append(')');
             }
         }
index 04ce679..410a4e8 100644 (file)
@@ -1,3 +1,30 @@
+2016-09-10  Chris Dumez  <cdumez@apple.com>
+
+        parseHTMLInteger() should take a StringView in parameter
+        https://bugs.webkit.org/show_bug.cgi?id=161669
+
+        Reviewed by Ryosuke Niwa.
+
+        * wtf/text/StringBuilder.h:
+        (WTF::StringBuilder::append):
+        Add StringBuilder::append() overload taking an AtomicString in parameter.
+        It used to call StringBuilder::append(const String&) implicitly when
+        passing an AtomicString. However, it is now ambiguous because there
+        is an overload taking a StringView, and it is now possible to construct
+        a StringView from an AtomicString.
+
+        * wtf/text/StringView.h:
+        (WTF::StringView::StringView):
+        - Add StringView constructor taking an AtomicString in parameter for
+          convenience. This avoids having to call AtomicString::string()
+          explicitly at call sites.
+        - Add StringView constructor taking a 'const char*' in parameter for
+          performance. There are several call sites that were passing a const
+          char* and implicitly constructing an unnecessary String to construct
+          a StringView. This became more obvious because the constructor taking
+          an AtomicString in parameter made such calls ambiguous.
+
+
 2016-09-09  Mark Lam  <mark.lam@apple.com>
 
         Gardening: fixing a few JSC test failures.
index 8224d22..05b15bb 100644 (file)
@@ -50,6 +50,11 @@ public:
 
     ALWAYS_INLINE void append(const char* characters, unsigned length) { append(reinterpret_cast<const LChar*>(characters), length); }
 
+    void append(const AtomicString& atomicString)
+    {
+        append(atomicString.string());
+    }
+
     void append(const String& string)
     {
         if (!string.length())
index bd7e8f6..a39ea07 100644 (file)
@@ -60,11 +60,13 @@ public:
     StringView& operator=(const StringView&);
 #endif
 
+    StringView(const AtomicString&);
     StringView(const String&);
     StringView(const StringImpl&);
     StringView(const StringImpl*);
     StringView(const LChar*, unsigned length);
     StringView(const UChar*, unsigned length);
+    StringView(const char*);
 
     static StringView empty();
 
@@ -193,6 +195,7 @@ inline bool operator!=(const char* a, StringView b) { return !equal(b, a); }
 
 }
 
+#include <wtf/text/AtomicString.h>
 #include <wtf/text/WTFString.h>
 
 namespace WTF {
@@ -285,6 +288,11 @@ inline StringView::StringView(const UChar* characters, unsigned length)
     initialize(characters, length);
 }
 
+inline StringView::StringView(const char* characters)
+{
+    initialize(reinterpret_cast<const LChar*>(characters), strlen(characters));
+}
+
 inline StringView::StringView(const StringImpl& string)
 {
     setUnderlyingString(&string);
@@ -320,6 +328,11 @@ inline StringView::StringView(const String& string)
     initialize(string.characters16(), string.length());
 }
 
+inline StringView::StringView(const AtomicString& atomicString)
+    : StringView(atomicString.string())
+{
+}
+
 inline void StringView::clear()
 {
     m_characters = nullptr;
index 58b303c..d6c2b53 100644 (file)
@@ -1,5 +1,51 @@
 2016-09-10  Chris Dumez  <cdumez@apple.com>
 
+        parseHTMLInteger() should take a StringView in parameter
+        https://bugs.webkit.org/show_bug.cgi?id=161669
+
+        Reviewed by Ryosuke Niwa.
+
+        parseHTMLInteger() should take a StringView in parameter instead of a
+        const String&.
+
+        * css/parser/CSSParser.cpp:
+        (WebCore::CSSParser::parseFontFaceSrcLocal):
+        * css/parser/CSSParserValues.h:
+        (WebCore::CSSParserString::toStringView):
+        Add toStringView() to avoid unnecessarily constructing a String for
+        calling StringBuilder::append().
+
+        * html/parser/HTMLParserIdioms.cpp:
+        (WebCore::parseHTMLInteger):
+        (WebCore::parseHTMLNonNegativeInteger):
+        (WebCore::parseHTTPRefreshInternal):
+        * html/parser/HTMLParserIdioms.h:
+        (WebCore::limitToOnlyHTMLNonNegativeNumbersGreaterThanZero):
+        (WebCore::limitToOnlyHTMLNonNegative):
+        Take a StringView in parameter instead of a const String&.
+
+        * platform/sql/SQLiteStatement.cpp:
+        (WebCore::SQLiteStatement::isColumnDeclaredAsBlob):
+        Avoid unnecessarily constructing a String to call equalLettersIgnoringASCIICase()
+        by leveraging the StringView constructor taking a 'const char*' in parameter.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::constructTextRun):
+        * rendering/RenderBlock.h:
+        Add constructTextRun() overload taking an AtomicString. It was otherwise ambiguous
+        because both a String or a StringView could be constructed from an AtomicString.
+
+        * page/CaptionUserPreferencesMediaAF.cpp:
+        (WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS):
+        (WebCore::buildDisplayStringForTrackBase):
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::mediaControlsStyleSheet):
+        (WebCore::RenderThemeMac::mediaControlsScript):
+        Explicitly construct a String from NSString / CFStringRef types as such calls are
+        now ambiguous.
+
+2016-09-10  Chris Dumez  <cdumez@apple.com>
+
         It is possible for Document::m_frame pointer to become stale
         https://bugs.webkit.org/show_bug.cgi?id=161812
         <rdar://problem/27745023>
index 8fcefbc..6dfaf48 100644 (file)
@@ -7328,7 +7328,7 @@ bool CSSParser::parseFontFaceSrcLocal(CSSValueList& valueList)
                 return false;
             if (!builder.isEmpty())
                 builder.append(' ');
-            builder.append(localValue->string);
+            builder.append(localValue->string.toStringView());
         }
         valueList.append(CSSFontFaceSrcValue::createLocal(builder.toString()));
     } else
index 1e7883f..a919415 100644 (file)
@@ -87,6 +87,7 @@ struct CSSParserString {
 
     operator String() const { return is8Bit() ? String(m_data.characters8, m_length) : String(m_data.characters16, m_length); }
     operator AtomicString() const { return is8Bit() ? AtomicString(m_data.characters8, m_length) : AtomicString(m_data.characters16, m_length); }
+    StringView toStringView() const { return is8Bit() ? StringView(m_data.characters8, m_length) : StringView(m_data.characters16, m_length); }
 
     union {
         LChar* characters8;
index 0dcc7f6..3b8cc4d 100644 (file)
@@ -191,7 +191,7 @@ static Optional<int> parseHTMLIntegerInternal(const CharacterType* position, con
 }
 
 // https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-integers
-Optional<int> parseHTMLInteger(const String& input)
+Optional<int> parseHTMLInteger(StringView input)
 {
     unsigned length = input.length();
     if (!length)
@@ -207,7 +207,7 @@ Optional<int> parseHTMLInteger(const String& input)
 }
 
 // https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-non-negative-integers
-Optional<unsigned> parseHTMLNonNegativeInteger(const String& input)
+Optional<unsigned> parseHTMLNonNegativeInteger(StringView input)
 {
     Optional<int> signedValue = parseHTMLInteger(input);
     if (!signedValue || signedValue.value() < 0)
@@ -363,7 +363,7 @@ static bool parseHTTPRefreshInternal(const CharacterType* position, const Charac
     while (position < end && isASCIIDigit(*position))
         ++position;
 
-    Optional<unsigned> number = parseHTMLNonNegativeInteger(StringView(numberStart, position - numberStart).toStringWithoutCopying());
+    Optional<unsigned> number = parseHTMLNonNegativeInteger(StringView(numberStart, position - numberStart));
     if (!number)
         return false;
 
index d9ed083..3e7989d 100644 (file)
@@ -29,6 +29,7 @@
 #include <wtf/Forward.h>
 #include <wtf/Optional.h>
 #include <wtf/Vector.h>
+#include <wtf/text/StringView.h>
 
 namespace WebCore {
 
@@ -62,10 +63,10 @@ double parseToDoubleForNumberType(const String&);
 double parseToDoubleForNumberType(const String&, double fallbackValue);
 
 // http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-integers
-WEBCORE_EXPORT Optional<int> parseHTMLInteger(const String&);
+WEBCORE_EXPORT Optional<int> parseHTMLInteger(StringView);
 
 // http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-non-negative-integers
-WEBCORE_EXPORT Optional<unsigned> parseHTMLNonNegativeInteger(const String&);
+WEBCORE_EXPORT Optional<unsigned> parseHTMLNonNegativeInteger(StringView);
 
 // https://html.spec.whatwg.org/#valid-non-negative-integer
 Optional<int> parseValidHTMLNonNegativeInteger(StringView);
@@ -132,7 +133,7 @@ inline unsigned limitToOnlyHTMLNonNegativeNumbersGreaterThanZero(unsigned value,
     return (value > 0 && value <= maxHTMLNonNegativeInteger) ? value : defaultValue;
 }
 
-inline unsigned limitToOnlyHTMLNonNegativeNumbersGreaterThanZero(const String& stringValue, unsigned defaultValue = 1)
+inline unsigned limitToOnlyHTMLNonNegativeNumbersGreaterThanZero(StringView stringValue, unsigned defaultValue = 1)
 {
     ASSERT(defaultValue > 0);
     ASSERT(defaultValue <= maxHTMLNonNegativeInteger);
@@ -150,7 +151,7 @@ inline unsigned limitToOnlyHTMLNonNegative(unsigned value, unsigned defaultValue
     return value <= maxHTMLNonNegativeInteger ? value : defaultValue;
 }
 
-inline unsigned limitToOnlyHTMLNonNegative(const String& stringValue, unsigned defaultValue = 0)
+inline unsigned limitToOnlyHTMLNonNegative(StringView stringValue, unsigned defaultValue = 0)
 {
     ASSERT(defaultValue <= maxHTMLNonNegativeInteger);
     unsigned value = parseHTMLNonNegativeInteger(stringValue).valueOr(defaultValue);
index 0ef7db3..5f05bb9 100644 (file)
@@ -432,7 +432,7 @@ String CaptionUserPreferencesMediaAF::captionsDefaultFontCSS() const
     
     builder.append(getPropertyNameString(CSSPropertyFontFamily));
     builder.appendLiteral(": \"");
-    builder.append(static_cast<CFStringRef>(name.get()));
+    builder.append(String(static_cast<CFStringRef>(name.get())));
     builder.append('"');
     if (behavior == kMACaptionAppearanceBehaviorUseValue)
         builder.appendLiteral(" !important");
@@ -642,7 +642,7 @@ static void buildDisplayStringForTrackBase(StringBuilder& displayName, const Tra
         else if (!language.isEmpty())
             displayName.append(language);
         else
-            displayName.append(localeIdentifier.get());
+            displayName.append(String(localeIdentifier.get()));
     }
 }
 
index d66c817..e4c771d 100644 (file)
@@ -288,7 +288,7 @@ bool SQLiteStatement::isColumnDeclaredAsBlob(int col)
         if (prepare() != SQLITE_OK)
             return false;
     }
-    return equalLettersIgnoringASCIICase(StringView(reinterpret_cast<const UChar*>(sqlite3_column_decltype16(m_statement, col))), "blob");
+    return equalLettersIgnoringASCIICase(StringView(sqlite3_column_decltype(m_statement, col)), "blob");
 }
 
 String SQLiteStatement::getColumnName(int col)
index 6787fd1..9845c37 100644 (file)
@@ -3803,6 +3803,11 @@ TextRun RenderBlock::constructTextRun(const String& string, const RenderStyle& s
     return constructTextRun(StringView(string), style, expansion, flags);
 }
 
+TextRun RenderBlock::constructTextRun(const AtomicString& atomicString, const RenderStyle& style, ExpansionBehavior expansion, TextRunFlags flags)
+{
+    return constructTextRun(StringView(atomicString), style, expansion, flags);
+}
+
 TextRun RenderBlock::constructTextRun(const RenderText& text, const RenderStyle& style, ExpansionBehavior expansion)
 {
     return constructTextRun(text.stringView(), style, expansion);
index 71fb09d..b7b506d 100644 (file)
@@ -207,6 +207,8 @@ public:
         ExpansionBehavior = DefaultExpansion, TextRunFlags = DefaultTextRunFlags);
     static TextRun constructTextRun(const String&, const RenderStyle&,
         ExpansionBehavior = DefaultExpansion, TextRunFlags = DefaultTextRunFlags);
+    static TextRun constructTextRun(const AtomicString&, const RenderStyle&,
+        ExpansionBehavior = DefaultExpansion, TextRunFlags = DefaultTextRunFlags);
     static TextRun constructTextRun(const RenderText&, const RenderStyle&,
         ExpansionBehavior = DefaultExpansion);
     static TextRun constructTextRun(const RenderText&, unsigned offset, unsigned length, const RenderStyle&,
index e11e69f..ffc30d4 100644 (file)
@@ -1292,7 +1292,7 @@ String RenderThemeIOS::mediaControlsStyleSheet()
 #if ENABLE(MEDIA_CONTROLS_SCRIPT)
     if (m_mediaControlsStyleSheet.isEmpty()) {
         StringBuilder builder;
-        builder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsiOS" ofType:@"css"] encoding:NSUTF8StringEncoding error:nil]);
+        builder.append(String([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsiOS" ofType:@"css"] encoding:NSUTF8StringEncoding error:nil]));
         m_mediaControlsStyleSheet = builder.toString();
     }
     return m_mediaControlsStyleSheet;
@@ -1306,9 +1306,9 @@ String RenderThemeIOS::mediaControlsScript()
 #if ENABLE(MEDIA_CONTROLS_SCRIPT)
     if (m_mediaControlsScript.isEmpty()) {
         StringBuilder scriptBuilder;
-        scriptBuilder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsLocalizedStrings" ofType:@"js"] encoding:NSUTF8StringEncoding error:nil]);
-        scriptBuilder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsApple" ofType:@"js"] encoding:NSUTF8StringEncoding error:nil]);
-        scriptBuilder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsiOS" ofType:@"js"] encoding:NSUTF8StringEncoding error:nil]);
+        scriptBuilder.append(String([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsLocalizedStrings" ofType:@"js"] encoding:NSUTF8StringEncoding error:nil]));
+        scriptBuilder.append(String([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsApple" ofType:@"js"] encoding:NSUTF8StringEncoding error:nil]));
+        scriptBuilder.append(String([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsiOS" ofType:@"js"] encoding:NSUTF8StringEncoding error:nil]));
         m_mediaControlsScript = scriptBuilder.toString();
     }
     return m_mediaControlsScript;
index b7bfb1a..3aafd65 100644 (file)
@@ -235,7 +235,7 @@ String RenderThemeMac::mediaControlsStyleSheet()
 #if ENABLE(MEDIA_CONTROLS_SCRIPT)
     if (m_mediaControlsStyleSheet.isEmpty()) {
         StringBuilder styleSheetBuilder;
-        styleSheetBuilder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsApple" ofType:@"css"] encoding:NSUTF8StringEncoding error:nil]);
+        styleSheetBuilder.append(String([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsApple" ofType:@"css"] encoding:NSUTF8StringEncoding error:nil]));
         m_mediaControlsStyleSheet = styleSheetBuilder.toString();
     }
     return m_mediaControlsStyleSheet;
@@ -249,8 +249,8 @@ String RenderThemeMac::mediaControlsScript()
 #if ENABLE(MEDIA_CONTROLS_SCRIPT)
     if (m_mediaControlsScript.isEmpty()) {
         StringBuilder scriptBuilder;
-        scriptBuilder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsLocalizedStrings" ofType:@"js"] encoding:NSUTF8StringEncoding error:nil]);
-        scriptBuilder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsApple" ofType:@"js"] encoding:NSUTF8StringEncoding error:nil]);
+        scriptBuilder.append(String([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsLocalizedStrings" ofType:@"js"] encoding:NSUTF8StringEncoding error:nil]));
+        scriptBuilder.append(String([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsApple" ofType:@"js"] encoding:NSUTF8StringEncoding error:nil]));
         m_mediaControlsScript = scriptBuilder.toString();
     }
     return m_mediaControlsScript;
index 5744a4b..da450f1 100644 (file)
@@ -1,3 +1,17 @@
+2016-09-10  Chris Dumez  <cdumez@apple.com>
+
+        parseHTMLInteger() should take a StringView in parameter
+        https://bugs.webkit.org/show_bug.cgi?id=161669
+
+        Reviewed by Ryosuke Niwa.
+
+        Explicitly construct a String from the CFStringRef in order to call
+        StringBuilder::append(). This is needed now that there is an append()
+        overload taking an AtomicString in parameter.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::dumpDOMAsWebArchive):
+
 2016-09-10  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Apple.com keynote does not display media controls
index 1899a8b..798a855 100644 (file)
@@ -843,7 +843,7 @@ void InjectedBundlePage::dumpDOMAsWebArchive(WKBundleFrameRef frame, StringBuild
     WKRetainPtr<WKDataRef> wkData = adoptWK(WKBundleFrameCopyWebArchive(frame));
     RetainPtr<CFDataRef> cfData = adoptCF(CFDataCreate(0, WKDataGetBytes(wkData.get()), WKDataGetSize(wkData.get())));
     RetainPtr<CFStringRef> cfString = adoptCF(createXMLStringFromWebArchiveData(cfData.get()));
-    stringBuilder.append(cfString.get());
+    stringBuilder.append(String(cfString.get()));
 #endif
 }