Bug 22664 - Rename and review uses of parseURL()
Summary: Rename and review uses of parseURL()
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-04 16:52 PST by David Kilzer (:ddkilzer)
Modified: 2023-12-28 08:09 PST (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 David Kilzer (:ddkilzer) 2008-12-04 16:52:16 PST
*SUMMARY
Bug 11850 Comment #4 quoting Darin Adler:

Here's what parseURL does:

    1) Strip leading and trailing spaces.
    2) Strip URL() if it surrounds the string, allowing any mix of uppercase and lowercase.
    3) Strip leading and trailing spaces.
    4) Strip balanced single or double quotes.
    5) Strip leading and trailing spaces.
    6) Strip all characters in the range U+0000-U+000C

It's very strange that we want to do this anywhere except in CSS. In fact, I
think it's a bug almost every where this function is used. Perhaps some of this
is needed but obviously (2) is something specific to CSS property values even
if some of the other behavior is useful.

Someone should create some tests cases and investigate the behavior of other
web browsers for the various places we call this function. And at the same time
we should probably rename it.
Comment 1 David Kilzer (:ddkilzer) 2008-12-04 16:53:46 PST
I think parseURL() should be renamed to parseCSSURL() (or parseURLForCSS()) and moved to be in KURL.h/KURL.cpp.  (That gets rid of CSSHelper.cpp, leaving only CSSHelper.h with a few constants.)

Comment 2 Darin Adler 2008-12-04 17:01:40 PST
(In reply to comment #1)
> I think parseURL() should be renamed to parseCSSURL() (or parseURLForCSS()) and
> moved to be in KURL.h/KURL.cpp. (That gets rid of CSSHelper.cpp, leaving only
> CSSHelper.h with a few constants.)

I agree that parseCSSURL is a good name. But I don't think KURL.h is the header for this. It's not about URL handling, but rather about the CSS syntax for URL properties. I think the right header for this would be CSSParser.h.
Comment 3 Anne van Kesteren 2023-12-28 08:09:54 PST
This has been refactored.