Bug 87558

Summary: Some Content Security Policy console messages are missing line numbers in JSC
Product: WebKit Reporter: Stephanie Lewis <slewis>
Component: Page LoadingAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, cdumez, mkwst, rakuco, slewis, webkit-bug-importer, webkit.review.bot
Priority: P2 Keywords: InRadar, MakingBotsRed
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Stephanie Lewis 2012-05-25 18:32:53 PDT
Regression from http://trac.webkit.org/projects/webkit/changeset/118585.

Two test fail on Lion Debug and Release, WK1 and WK2.
+http/tests/security/contentSecurityPolicy/inline-script-blocked-javascript-url.html	expected actual diff pretty diff
+http/tests/security/contentSecurityPolicy/javascript-url-blocked.html

 Example diff :

--- /Volumes/Data/slave/mountainlion-production-wk2-tests/build/OpenSource/layout-test-results/http/tests/security/contentSecurityPolicy/inline-script-blocked-javascript-url-expected.txt
+++ /Volumes/Data/slave/mountainlion-production-wk2-tests/build/OpenSource/layout-test-results/http/tests/security/contentSecurityPolicy/inline-script-blocked-javascript-url-actual.txt
@@ -4,6 +4,6 @@
 
 CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'options'.
 
-CONSOLE MESSAGE: line 1: Refused to execute JavaScript URL because it violates the following Content Security Policy directive: "script-src http://127.0.0.1:*".
+CONSOLE MESSAGE: Refused to execute JavaScript URL because it violates the following Content Security Policy directive: "script-src http://127.0.0.1:*".
 
 This test passes if it doesn't alert fail.
Comment 1 Radar WebKit Bug Importer 2012-05-25 18:33:20 PDT
<rdar://problem/11539513>
Comment 2 Stephanie Lewis 2012-05-25 19:00:09 PDT
Checked in failing results http://trac.webkit.org/projects/webkit/changeset/118598
Comment 3 Chris Dumez 2012-05-29 02:36:25 PDT
Created attachment 144493 [details]
Patch

The found the difference between JSC and V8 implementations of ScriptController::eventHandlerPosition(). Making JSC implementation behave as the V8 one fixes the line printing issue (because the function returns line 1 instead of line 0 in those cases). The patch does not seem to cause any regression for me.
Comment 4 Chris Dumez 2012-05-29 02:59:28 PDT
Created attachment 144498 [details]
Patch

Update patch to remove Qt-specific expectations as well.
Comment 5 Adam Barth 2012-05-29 16:26:55 PDT
Comment on attachment 144498 [details]
Patch

Thanks!
Comment 6 WebKit Review Bot 2012-05-29 17:25:30 PDT
Comment on attachment 144498 [details]
Patch

Clearing flags on attachment: 144498

Committed r118861: <http://trac.webkit.org/changeset/118861>
Comment 7 WebKit Review Bot 2012-05-29 17:25:35 PDT
All reviewed patches have been landed.  Closing bug.