Bug 41166 - Set an initial URL in Document's constructor
: Set an initial URL in Document's constructor
: WebKit
WebCore Misc.
: 528+ (Nightly build)
: PC Mac OS X 10.5
: P2 Normal
Assigned To:
: 41179
: 41165
  Show dependency treegraph
Reported: 2010-06-24 10:20 PST by
Modified: 2010-06-25 10:55 PST (History)

Patch (28.25 KB, patch)
2010-06-24 10:37 PST, Nate Chapin
no flags Review Patch | Details | Formatted Diff | Diff
patch2 (28.38 KB, patch)
2010-06-24 16:59 PST, Nate Chapin
abarth: review+
Review Patch | Details | Formatted Diff | Diff


You need to log in before you can comment on or make changes to this bug.

Description From 2010-06-24 10:20:03 PST
There is one case where Document::url() and FrameLoader::url() are not the same.  During the initialization of a new document, the Document's url has not yet been set and we use FrameLoader's url in Document::initSecurityContext().  By providing a KURL in Document's constructor, we can remove this unnecessary difference and obsolete FrameLoader::url().
------- Comment #1 From 2010-06-24 10:37:53 PST -------
Created an attachment (id=59673) [details]
------- Comment #2 From 2010-06-24 10:53:33 PST -------
(From update of attachment 59673 [details])
------- Comment #3 From 2010-06-24 13:57:07 PST -------
http://trac.webkit.org/changeset/61783 might have broken Qt Linux Release
------- Comment #4 From 2010-06-24 16:59:08 PST -------
Created an attachment (id=59709) [details]

There are just two differences from the first patch:
1. Call setURL in Document::Document() if either a non-null Frame or a non-empty KURL was passed in.  This ensures we handle XMLHttpRequests without a Frame correctly, as well as Documents with a Frame that should be defaulted to "about:blank" instead of "".
2. Pass a non-empty KURL to Document::create() in XMLHttpRequest.cpp and remove the following Document::setURL() call.
------- Comment #5 From 2010-06-24 17:24:39 PST -------
(From update of attachment 59709 [details])
Ok.  This makes more sense than the earlier diff.  Thanks.
------- Comment #6 From 2010-06-24 17:26:03 PST -------
Presumably we have a test for the URL of an XMLHttpRequest document?  I'm not sure how you could get an empty URL in there given that it would be completed w.r.t. a base URL.
------- Comment #7 From 2010-06-24 21:04:39 PST -------
(From update of attachment 59673 [details])
Cleared Adam Barth's review+ from obsolete attachment 59673 [details] so that this bug does not appear in http://webkit.org/pending-commit.
------- Comment #8 From 2010-06-25 10:55:01 PST -------