We use the one arg KURL constructor all over WebKit/GTK, but: - It does not pretend to deal with encodings, so it would fail if we pass anything different than ASCII I think (oops?) - The single-argument KURL ctors expect their input to already be the output of a previous KURL::parse call, so for the general case (ie, random user input) we need to use the two-arg ctor anyway.
Created attachment 27351 [details] Uso two-arg KURL ctor
Comment on attachment 27351 [details] Uso two-arg KURL ctor r=me > - SubstituteData substituteData(sharedBuffer.release(), contentMimeType ? String(contentMimeType) : "text/html", contentEncoding ? String(contentEncoding) : "UTF-8", KURL("about:blank"), url); > + SubstituteData substituteData(sharedBuffer.release(), contentMimeType ? String(contentMimeType) : "text/html", contentEncoding ? String(contentEncoding) : "UTF-8", KURL(KURL(), "about:blank"), url); I think that about:blank can be left as is - KURL parsing clearly won't affect it. Not that it matters much.
(In reply to comment #2) > > - SubstituteData substituteData(sharedBuffer.release(), contentMimeType ? String(contentMimeType) : "text/html", contentEncoding ? String(contentEncoding) : "UTF-8", KURL("about:blank"), url); > > + SubstituteData substituteData(sharedBuffer.release(), contentMimeType ? String(contentMimeType) : "text/html", contentEncoding ? String(contentEncoding) : "UTF-8", KURL(KURL(), "about:blank"), url); > > I think that about:blank can be left as is - KURL parsing clearly won't affect > it. Not that it matters much. Or this could use the blankURL() function from KURL.h.
Created attachment 27364 [details] kurl.patch Use blankURL() for 'about:blank'. Great suggestion, thanks!
Committed revision 40715.