[Webkit-unassigned] [Bug 75369] New: Change in href format for frames with applewebdata: location

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 29 14:06:11 PST 2011


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

           Summary: Change in href format for frames with applewebdata:
                    location
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: jalkut at red-sweater.com


WebKit nightly builds return a different format href for applewebdata: based frames than shipping versions of Safari.

I believe the format change occurred with changes in:

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

Notice how the WorkerLocation and Location "href" methods uses to append a "/" to the end of the string if there is no path? That no longer happens.

A concrete example of the bug occurs when you load a web view with a nil baseURL:


    NSString* testDocument = @"\
    <html>\
    <head>\
    <script>document.write(\"hello - our window location href is \" + window.location.href + \",<br /> document location href is \" + document.location.href);</script>\
    </head>\
    <body>\
    </body>\
    </html>";

    [[[self webView] mainFrame] loadHTMLString:testDocument baseURL:nil];

If you run this code on trunk builds of WebKit you'll see a location href like:

applewebdata://A7E269AE-63E7-468C-956A-6A5F670F99DF

While on shipping versions of WebKit in Safari for Mac, you'll see a location href like:

applewebdata://A7E269AE-63E7-468C-956A-6A5F670F99DF/

There is a real-world consequence of this that I ran into: when using TinyMCE in a WebView that has a nil baseURL, TinyMCE uses a regular expression to derive the base URL. It turns out that regular expression depends upon the trailing slash in applewebdata: URLs, or an invalid URL is stored and causes exceptions in the loading of the TinyMCE framework.

Note that I don't think the "canonicalize" URL tests cover this situation because the canonicalize method uses the href attribute of an anchor and doesn't exercise the location code.

This could probably also be effectively addressed by taking care to included a closing / in the unique applewebdata: URL generator. This stems from the fact that the baseURI for the page is in fact missing a trailing slash, but previously it was being added in during the location href lookup.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list