Bug 16480 - Document::completeURL should return a KURL
Summary: Document::completeURL should return a KURL
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 16485 16487
Blocks:
  Show dependency treegraph
 
Reported: 2007-12-17 14:23 PST by Brett Wilson (Google)
Modified: 2011-09-12 09:53 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brett Wilson (Google) 2007-12-17 14:23:17 PST
Document::completeURL returns either a String or a DepricatedString. Since the output is really a URL, it should return a KURL instead.

This weirdness causes extra conversions that are not necessary and slow things down. For example, in DocLoader::requestResource:
  KURL fullURL = m_doc->completeURL(url.deprecatedString());

This does a conversion to a KURL in completeURL, then does a conversion back to a DeprecatedString, then converts back to a KURL. This is a whole extra parse of the URL that's unnecessary. The String version is even sillier, since it has to convert to and from a String before calling the DepricatedString version of completeURL.

Some functions HTML* especially, need the string, but they should just get it out of the KURL if they want it.
Comment 1 Brett Wilson (Google) 2007-12-17 14:49:26 PST
When fixed, this will expose bug 16487 and bug 16485 which will cause a crash in DocLoader::checkForReload.
Comment 2 Kaustubh Atrawalkar 2011-09-12 04:29:25 PDT
I guess this issue is already been fixed. Can be closed.
Comment 3 Brett Wilson (Google) 2011-09-12 09:53:59 PDT
Yup, this was fixed at some point.