Changeset 278894 in webkit


Ignore:
Timestamp:
Jun 15, 2021 1:19:05 PM (3 years ago)
Author:
achristensen@apple.com
Message:

Allow legacy SecurityOrigin behavior for x-apple-ql-id2 scheme
https://bugs.webkit.org/show_bug.cgi?id=226993
Source/WebCore:

<rdar://76474042>

Reviewed by Tim Horton.

Why have one x-apple-ql-id scheme when you can have 2?

  • page/SecurityOrigin.cpp:

(WebCore::shouldTreatAsUniqueOrigin):
Also move the linked-on-or-before check to after the hasSpecialScheme check which will be true for most URLs (http, https, file, etc.)

Tools:

Reviewed by Tim Horton.

  • TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp:

(TestWebKitAPI::TEST_F):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r278892 r278894  
     12021-06-15  Alex Christensen  <achristensen@webkit.org>
     2
     3        Allow legacy SecurityOrigin behavior for x-apple-ql-id2 scheme
     4        https://bugs.webkit.org/show_bug.cgi?id=226993
     5        <rdar://76474042>
     6
     7        Reviewed by Tim Horton.
     8
     9        Why have one x-apple-ql-id scheme when you can have 2?
     10
     11        * page/SecurityOrigin.cpp:
     12        (WebCore::shouldTreatAsUniqueOrigin):
     13        Also move the linked-on-or-before check to after the hasSpecialScheme check which will be true for most URLs (http, https, file, etc.)
     14
    1152021-06-15  Philippe Normand  <pnormand@igalia.com>
    216
  • trunk/Source/WebCore/page/SecurityOrigin.cpp

    r278806 r278894  
    111111        return true;
    112112
    113 #if PLATFORM(COCOA)
    114     if (!linkedOnOrAfter(SDKVersion::FirstWithNullOriginForNonSpecialSchemedURLs))
    115         return false;
    116 #endif
    117 
    118113    // https://url.spec.whatwg.org/#origin with some additions
    119114    if (url.hasSpecialScheme()
    120115#if PLATFORM(COCOA)
     116        || !linkedOnOrAfter(SDKVersion::FirstWithNullOriginForNonSpecialSchemedURLs)
    121117        || url.protocolIs("applewebdata")
    122118        || url.protocolIs("x-apple-ql-id")
     119        || url.protocolIs("x-apple-ql-id2")
    123120        || url.protocolIs("x-apple-ql-magic")
    124121#endif
  • trunk/Tools/ChangeLog

    r278890 r278894  
     12021-06-15  Alex Christensen  <achristensen@webkit.org>
     2
     3        Allow legacy SecurityOrigin behavior for x-apple-ql-id2 scheme
     4        https://bugs.webkit.org/show_bug.cgi?id=226993
     5
     6        Reviewed by Tim Horton.
     7
     8        * TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp:
     9        (TestWebKitAPI::TEST_F):
     10
    1112021-06-15  Jonathan Bedard  <jbedard@apple.com>
    212
  • trunk/Tools/TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp

    r278253 r278894  
    8989    auto o9 = SecurityOrigin::createFromString("x-apple-ql-id://host");
    9090    auto o10 = SecurityOrigin::createFromString("x-apple-ql-magic://host");
     91    auto o11 = SecurityOrigin::createFromString("x-apple-ql-id2://host");
    9192#endif
    9293
     
    102103    EXPECT_EQ(String("x-apple-ql-id"), o9->protocol());
    103104    EXPECT_EQ(String("x-apple-ql-magic"), o10->protocol());
     105    EXPECT_EQ(String("x-apple-ql-id2"), o11->protocol());
    104106#endif
    105107
     
    115117    EXPECT_EQ(String("host"), o9->host());
    116118    EXPECT_EQ(String("host"), o10->host());
     119    EXPECT_EQ(String("host"), o11->host());
    117120#endif
    118121
     
    128131    EXPECT_FALSE(o9->port());
    129132    EXPECT_FALSE(o10->port());
     133    EXPECT_FALSE(o11->port());
    130134#endif
    131135
     
    141145    EXPECT_EQ("x-apple-ql-id://host", o9->toString());
    142146    EXPECT_EQ("x-apple-ql-magic://host", o10->toString());
     147    EXPECT_EQ("x-apple-ql-id2://host", o11->toString());
    143148#endif
    144149
     
    153158    EXPECT_FALSE(o1->isSameOriginAs(o9.get()));
    154159    EXPECT_FALSE(o1->isSameOriginAs(o10.get()));
     160    EXPECT_FALSE(o1->isSameOriginAs(o11.get()));
    155161#endif
    156162}
Note: See TracChangeset for help on using the changeset viewer.