Bug 112905

Summary: Nit: Cleanup casts in XSSAuditorDelegate::didBlockScript.
Product: WebKit Reporter: Mike West <mkwst>
Component: New BugsAssignee: Mike West <mkwst>
Status: RESOLVED WONTFIX    
Severity: Normal CC: bfulgham, dbates, esprehn+autocc, ojan.autocc, tsepez, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Mike West 2013-03-21 05:36:44 PDT
Nit: Don't rely on implicit conversion from KURL to String in XSSAuditorDelegate::didBlockScript.
Comment 1 Mike West 2013-03-21 05:39:27 PDT
Created attachment 194240 [details]
Patch
Comment 2 Mike West 2013-03-28 05:01:02 PDT
Created attachment 195534 [details]
Patch
Comment 3 Thomas Sepez 2013-03-29 15:36:53 PDT
(In reply to comment #2)
> Created an attachment (id=195534) [details]
> Patch

I thought blankURL() was "about:blank"
Comment 4 Mike West 2013-03-30 01:20:51 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > Created an attachment (id=195534) [details] [details]
> > Patch
> 
> I thought blankURL() was "about:blank"

'blankURL()' wraps 'about:blank' in a static KURL: http://trac.webkit.org/browser/trunk/Source/WebCore/platform/KURL.cpp#L1746.

*shrug* not a big deal, just a little nitpicky thing I want to fix. :) Actually... It would probably be worthwhile to have KURL static constants for things like 'about:blank' and 'data:<p></p>' if we're using them as strings in multiple places.
Comment 5 Brent Fulgham 2013-05-31 22:56:55 PDT
Comment on attachment 195534 [details]
Patch

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

I think this is probably okay, but I'd like clarification before we commit this.

> Source/WebCore/ChangeLog:16
> +            pass in 'String()' explicitly. We can also drop the String() cast

Is this really the same thing?  Wouldn't the String produced by blankURL be a string containing the "about:blank" characters?  Does scheduleLocationChange treat this identically to a blank string?

> Source/WebCore/html/parser/XSSAuditorDelegate.cpp:114
> +        m_document->frame()->navigationScheduler()->scheduleLocationChange(m_document->securityOrigin(), "data:text/html,<p></p>", String());

So you are saying that String() in this context will behave the same as the "about:blank" behavior of blankURL()?
Comment 6 Brent Fulgham 2021-09-21 14:37:34 PDT
The XSSAuditor is removed in Bug 230499.