Bug 47772

Summary: Web Inspector: brush up URL parsing on the front-end.
Product: WebKit Reporter: Pavel Feldman <pfeldman>
Component: Web Inspector (Deprecated)Assignee: Pavel Feldman <pfeldman>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed change.
none
[PATCH] Same with layout tests not using old regex. yurys: review+

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