Bug 34011 - invalidated KURLs can be used accidentally
Summary: invalidated KURLs can be used accidentally
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-22 11:34 PST by Bryan Yeung
Modified: 2010-02-02 11:24 PST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan Yeung 2010-01-22 11:34:07 PST
If a KURL has a null base, it is marked as invalidated but the relative portion is set as the URL.  These invalidated URLs can then be used accidentally, as they do contain some data.  It seems that using KURLs with unvalidated relative paths could cause problems, so I think it would be safer (and more correct) to make the URL empty when a KURL is invalidated.

I'm going to do a bunch of testing to ensure this doesn't break anything, but in the meantime wanted a bug to track opinions on this.
Comment 1 Eric Seidel (no email) 2010-01-22 12:06:12 PST
This bug came up because this behavior differs from GKURL and revealed a bug in SVGImageLoader.
Comment 2 Darin Adler 2010-01-22 13:36:29 PST
Lets look at the specific symptoms and consider the best way to fix them.

There may well be places where we want to carry around arbitrary strings even if KURL thinks they are invalid URLs -- it would be risky to make this change to such an often-used class.

The fact that Google’s separate version of KURL did not preserve this feature is interesting, but we haven’t tested the vast number of WebKit clients on Mac OS X, for example, with Google’s implementation. So we don’t know what the repercussions of starting to completely disallow invalid URLs would be.
Comment 3 Bryan Yeung 2010-02-02 10:49:09 PST
Fixing symptoms sounds reasonable.  I understand that with such a core piece of infrastructure, such a fundamental change is extremely difficult to make.

Here is a bug about a specific symptom I would like to fix:
https://bugs.webkit.org/show_bug.cgi?id=34492

Should this bug remain open to track any further symptoms that arise, or should it be closed and individual bugs filed for each symptom?

Thanks.
Comment 4 Darin Adler 2010-02-02 10:58:30 PST
Generally we file bugs about actual problems rather than design issues. I added comments to that other bug.
Comment 5 Bryan Yeung 2010-02-02 11:24:11 PST
Individual issues related to the different in KURL and KURLGoogle can be tracked in their own bugs.  Closing this one.