Bug 47772 - Web Inspector: brush up URL parsing on the front-end.
Summary: Web Inspector: brush up URL parsing on the front-end.
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pavel Feldman
Depends on:
Reported: 2010-10-16 08:23 PDT by Pavel Feldman
Modified: 2010-10-18 02:19 PDT (History)
10 users (show)

See Also:

[PATCH] Proposed change. (19.15 KB, patch)
2010-10-16 09:16 PDT, Pavel Feldman
no flags Details | Formatted Diff | Diff
[PATCH] Same with layout tests not using old regex. (20.09 KB, patch)
2010-10-16 09:31 PDT, Pavel Feldman
yurys: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2010-10-16 08:23:26 PDT
1. We should not be doing match[2] all over the code to extract the domain
2. We currently rely on backend to calculate host, port, lastPathComponent and such, but they can areally be cracked on the front-end side.
Comment 1 Pavel Feldman 2010-10-16 09:16:32 PDT
Created attachment 70958 [details]
[PATCH] Proposed change.
Comment 2 Pavel Feldman 2010-10-16 09:31:41 PDT
Created attachment 70959 [details]
[PATCH] Same with layout tests not using old regex.
Comment 3 Yury Semikhatsky 2010-10-18 02:00:51 PDT
Comment on attachment 70959 [details]
[PATCH] Same with layout tests not using old regex.

View in context: https://bugs.webkit.org/attachment.cgi?id=70959&action=review

> WebCore/inspector/front-end/utilities.js:396
> +String.prototype.asParsedURL = function()

I'd rather make it a function, not a method.

> WebCore/inspector/front-end/utilities.js:413
> +    return result;

You may want to cache result on the String object.
Comment 4 Pavel Feldman 2010-10-18 02:19:29 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	LayoutTests/inspector/elements-panel-rewrite-href.html
	M	WebCore/ChangeLog
	M	WebCore/inspector/InspectorResource.cpp
	M	WebCore/inspector/front-end/AuditRules.js
	M	WebCore/inspector/front-end/CookieItemsView.js
	M	WebCore/inspector/front-end/DOMAgent.js
	M	WebCore/inspector/front-end/Resource.js
	M	WebCore/inspector/front-end/ResourceCategory.js
	M	WebCore/inspector/front-end/ResourceView.js
	M	WebCore/inspector/front-end/inspector.js
	M	WebCore/inspector/front-end/utilities.js
Committed r69947