Changeset 235397 in webkit


Ignore:
Timestamp:
Aug 27, 2018, 1:58:07 PM (7 years ago)
Author:
achristensen@apple.com
Message:

REGRESSION(r234985/r234989) WKPageLoadHTMLString with a 16-bit String has the wrong encoding
https://bugs.webkit.org/show_bug.cgi?id=189002

Reviewed by Tim Horton.

Source/WebKit:

  • UIProcess/API/C/WKPage.cpp:

(encodingOf):

Tools:

  • TestWebKitAPI/Tests/WebKit/WillLoad.cpp:

(TestWebKitAPI::TEST_F):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r235392 r235397  
     12018-08-27  Alex Christensen  <achristensen@webkit.org>
     2
     3        REGRESSION(r234985/r234989) WKPageLoadHTMLString with a 16-bit String has the wrong encoding
     4        https://bugs.webkit.org/show_bug.cgi?id=189002
     5
     6        Reviewed by Tim Horton.
     7
     8        * UIProcess/API/C/WKPage.cpp:
     9        (encodingOf):
     10
    1112018-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>
    212
  • trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp

    r235364 r235397  
    203203{
    204204    if (string.isNull() || !string.is8Bit())
    205         "utf-16"_s;
     205        return "utf-16"_s;
    206206    return "latin1"_s;
    207207}
  • trunk/Tools/ChangeLog

    r235392 r235397  
     12018-08-27  Alex Christensen  <achristensen@webkit.org>
     2
     3        REGRESSION(r234985/r234989) WKPageLoadHTMLString with a 16-bit String has the wrong encoding
     4        https://bugs.webkit.org/show_bug.cgi?id=189002
     5
     6        Reviewed by Tim Horton.
     7
     8        * TestWebKitAPI/Tests/WebKit/WillLoad.cpp:
     9        (TestWebKitAPI::TEST_F):
     10
    1112018-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>
    212
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/WillLoad.cpp

    r183265 r235397  
    219219}
    220220
     221TEST_F(WebKit2WillLoadTest, WKPageLoadAlternateHTMLStringUTF16)
     222{
     223    auto htmlString = Util::toWK("<body>Hello, World 😊</body>");
     224
     225    auto baseURL = adoptWK(WKURLCreateWithUTF8CString("about:blank"));
     226    auto unreachableURL = adoptWK(WKURLCreateWithUTF8CString("about:other"));
     227
     228    WKPageLoadAlternateHTMLString(webView->page(), htmlString.get(), baseURL.get(), unreachableURL.get());
     229
     230    testWillLoadDataRequestReturnValues(baseURL.get(), Util::toWK("text/html").get(), Util::toWK("utf-16").get(), unreachableURL.get(), 0);
     231}
     232
    221233TEST_F(WebKit2WillLoadTest, WKPageLoadPlainTextStringWithUserData)
    222234{
Note: See TracChangeset for help on using the changeset viewer.