Skip to content
Permalink
Browse files
REGRESSION(r274270): [WPE][GTK] Broke Epiphany test /embed/ephy-web-v…
…iew/error-pages-not-stored-in-history

https://bugs.webkit.org/show_bug.cgi?id=223140

Patch by Michael Catanzaro <mcatanzaro@gnome.org> on 2021-03-12
Reviewed by Alex Christensen.

Source/WebCore:

If the SecurityOriginData has no protocol or host, return an empty string instead of "://"

* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::toString const):

Source/WebKit:

Convert empty strings to NULL.

* UIProcess/API/glib/WebKitSecurityOrigin.cpp:
(webkit_security_origin_to_string):

Tools:

Improve WebKitSecurityOrigin tests a bit.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSecurityOrigin.cpp:
(testCustomProtocolOrigin): Drive-by improvement: check webkit_security_origin_to_string().
(testBogusURI): Added, tests for this bug.
(beforeAll):

Canonical link: https://commits.webkit.org/235242@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274375 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
mcatanzaro authored and webkit-commit-queue committed Mar 13, 2021
1 parent 519c4ea commit 414e91ec5c27346bc3248349885c7cabb9020d97
Showing 6 changed files with 57 additions and 1 deletion.
@@ -1,3 +1,15 @@
2021-03-12 Michael Catanzaro <mcatanzaro@gnome.org>

REGRESSION(r274270): [WPE][GTK] Broke Epiphany test /embed/ephy-web-view/error-pages-not-stored-in-history
https://bugs.webkit.org/show_bug.cgi?id=223140

Reviewed by Alex Christensen.

If the SecurityOriginData has no protocol or host, return an empty string instead of "://"

* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::toString const):

2021-03-12 Said Abou-Hallawa <said@apple.com>

[GPU Process] inspector/canvas/memory.html fails when GPU rendering is enabled for 2D Canvas
@@ -41,6 +41,9 @@ String SecurityOriginData::toString() const
if (protocol == "file")
return "file://"_s;

if (protocol.isEmpty() && host.isEmpty())
return { };

if (!port)
return makeString(protocol, "://", host);
return makeString(protocol, "://", host, ':', static_cast<uint32_t>(*port));
@@ -1,3 +1,15 @@
2021-03-12 Michael Catanzaro <mcatanzaro@gnome.org>

REGRESSION(r274270): [WPE][GTK] Broke Epiphany test /embed/ephy-web-view/error-pages-not-stored-in-history
https://bugs.webkit.org/show_bug.cgi?id=223140

Reviewed by Alex Christensen.

Convert empty strings to NULL.

* UIProcess/API/glib/WebKitSecurityOrigin.cpp:
(webkit_security_origin_to_string):

2021-03-12 Myles C. Maxfield <mmaxfield@apple.com>

[macOS] MobileAsset fonts are broken in Reader mode in Safari
@@ -257,5 +257,5 @@ gchar* webkit_security_origin_to_string(WebKitSecurityOrigin* origin)
g_return_val_if_fail(origin, nullptr);

CString cstring = origin->securityOriginData.toString().utf8();
return cstring == "null" ? nullptr : g_strdup (cstring.data());
return cstring == "null" || cstring == "" ? nullptr : g_strdup (cstring.data());
}
@@ -1,3 +1,17 @@
2021-03-12 Michael Catanzaro <mcatanzaro@gnome.org>

REGRESSION(r274270): [WPE][GTK] Broke Epiphany test /embed/ephy-web-view/error-pages-not-stored-in-history
https://bugs.webkit.org/show_bug.cgi?id=223140

Reviewed by Alex Christensen.

Improve WebKitSecurityOrigin tests a bit.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSecurityOrigin.cpp:
(testCustomProtocolOrigin): Drive-by improvement: check webkit_security_origin_to_string().
(testBogusURI): Added, tests for this bug.
(beforeAll):

2021-03-12 Myles C. Maxfield <mmaxfield@apple.com>

[macOS] MobileAsset fonts are broken in Reader mode in Safari
@@ -122,12 +122,26 @@ static void testCustomProtocolOrigin(Test*, gconstpointer)
{
WebKitSecurityOrigin* origin = webkit_security_origin_new_for_uri("squirrel://fish");
g_assert_nonnull(origin);
GUniquePtr<char> asString(webkit_security_origin_to_string(origin));
g_assert_cmpstr(asString.get(), ==, "squirrel://fish");
g_assert_cmpstr(webkit_security_origin_get_protocol(origin), ==, "squirrel");
g_assert_cmpstr(webkit_security_origin_get_host(origin), ==, "fish");
g_assert_cmpint(webkit_security_origin_get_port(origin), ==, 0);
webkit_security_origin_unref(origin);
}

static void testBogusURI(Test*, gconstpointer)
{
WebKitSecurityOrigin* origin = webkit_security_origin_new_for_uri("http://localhost:2984375932");
g_assert_nonnull(origin);
GUniquePtr<char> asString(webkit_security_origin_to_string(origin));
g_assert_null(asString.get());
g_assert_null(webkit_security_origin_get_protocol(origin));
g_assert_null(webkit_security_origin_get_host(origin));
g_assert_cmpint(webkit_security_origin_get_port(origin), ==, 0);
webkit_security_origin_unref(origin);
}

void beforeAll()
{
Test::add("WebKitSecurityOrigin", "basic-constructor", testSecurityOriginBasicConstructor);
@@ -136,6 +150,7 @@ void beforeAll()
Test::add("WebKitSecurityOrigin", "file-uri", testSecurityOriginFileURI);
Test::add("WebKitSecurityOrigin", "blob-uri", testSecurityOriginDataURI);
Test::add("WebKitSecurityOrigin", "custom-protocol-origin", testCustomProtocolOrigin);
Test::add("WebKitSecurityOrigin", "bogus-uri", testBogusURI);
}

void afterAll()

0 comments on commit 414e91e

Please sign in to comment.