Some Content Security Policy console messages are missing line numbers in JSC

https://bugs.webkit.org/show_bug.cgi?id=87558

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-05-29
Reviewed by Adam Barth.

Source/WebCore:

Make ScriptController::eventHandlerPosition() behave the same way on
JSC than V8. This means that TextPosition::minimumPosition() is
returned if parser is null, instead of
TextPosition::belowRangePosition(). The line numbers are now correctly
printed in the output of Content Security Policy tests.

Tests: http/tests/security/contentSecurityPolicy/inline-script-blocked-javascript-url.html
       http/tests/security/contentSecurityPolicy/javascript-url-blocked.html

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::eventHandlerPosition):

LayoutTests:

Remove Mac/EFL/GTK/Qt-specific expectations for Content Security Policy
tests now that the line numbers are correctly printed.

* platform/efl/http/tests/security/contentSecurityPolicy/inline-script-blocked-javascript-url-expected.txt: Removed.
* platform/efl/http/tests/security/contentSecurityPolicy/javascript-url-blocked-expected.txt: Removed.
* platform/gtk/http/tests/security/contentSecurityPolicy/inline-script-blocked-javascript-url-expected.txt: Removed.
* platform/gtk/http/tests/security/contentSecurityPolicy/javascript-url-blocked-expected.txt: Removed.
* platform/mac/http/tests/security/contentSecurityPolicy/inline-script-blocked-javascript-url-expected.txt: Removed.
* platform/mac/http/tests/security/contentSecurityPolicy/javascript-url-blocked-expected.txt: Removed.
* platform/qt/http/tests/security/contentSecurityPolicy/inline-script-blocked-javascript-url-expected.txt: Removed.
* platform/qt/http/tests/security/contentSecurityPolicy/javascript-url-blocked-expected.txt: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118861 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c0599cb0
2012-05-29 Christophe Dumez <christophe.dumez@intel.com>
Some Content Security Policy console messages are missing line numbers in JSC
https://bugs.webkit.org/show_bug.cgi?id=87558
Reviewed by Adam Barth.
Remove Mac/EFL/GTK/Qt-specific expectations for Content Security Policy
tests now that the line numbers are correctly printed.
* platform/efl/http/tests/security/contentSecurityPolicy/inline-script-blocked-javascript-url-expected.txt: Removed.
* platform/efl/http/tests/security/contentSecurityPolicy/javascript-url-blocked-expected.txt: Removed.
* platform/gtk/http/tests/security/contentSecurityPolicy/inline-script-blocked-javascript-url-expected.txt: Removed.
* platform/gtk/http/tests/security/contentSecurityPolicy/javascript-url-blocked-expected.txt: Removed.
* platform/mac/http/tests/security/contentSecurityPolicy/inline-script-blocked-javascript-url-expected.txt: Removed.
* platform/mac/http/tests/security/contentSecurityPolicy/javascript-url-blocked-expected.txt: Removed.
* platform/qt/http/tests/security/contentSecurityPolicy/inline-script-blocked-javascript-url-expected.txt: Removed.
* platform/qt/http/tests/security/contentSecurityPolicy/javascript-url-blocked-expected.txt: Removed.
2012-05-29 Filip Pizlo <fpizlo@apple.com>
DFG should keep captured variables alive until the (inline) return.
......
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'options'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'options'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'options'.
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.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Refused to execute JavaScript URL because it violates the following Content Security Policy directive: "script-src 'none'".
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'options'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'options'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'options'.
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.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Refused to execute JavaScript URL because it violates the following Content Security Policy directive: "script-src 'none'".
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'options'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'options'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'options'.
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.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Refused to execute JavaScript URL because it violates the following Content Security Policy directive: "script-src 'none'".
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'options'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'options'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'options'.
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.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Refused to execute JavaScript URL because it violates the following Content Security Policy directive: "script-src 'none'".
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'allow'.
2012-05-29 Christophe Dumez <christophe.dumez@intel.com>
Some Content Security Policy console messages are missing line numbers in JSC
https://bugs.webkit.org/show_bug.cgi?id=87558
Reviewed by Adam Barth.
Make ScriptController::eventHandlerPosition() behave the same way on
JSC than V8. This means that TextPosition::minimumPosition() is
returned if parser is null, instead of
TextPosition::belowRangePosition(). The line numbers are now correctly
printed in the output of Content Security Policy tests.
Tests: http/tests/security/contentSecurityPolicy/inline-script-blocked-javascript-url.html
http/tests/security/contentSecurityPolicy/javascript-url-blocked.html
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::eventHandlerPosition):
2012-05-29 Shawn Singh <shawnsingh@chromium.org>
[chromium] make WebTransformationMatrix object usable by non-webkit code
......
......@@ -230,7 +230,7 @@ TextPosition ScriptController::eventHandlerPosition() const
ScriptableDocumentParser* parser = m_frame->document()->scriptableDocumentParser();
if (parser)
return parser->textPosition();
return TextPosition::belowRangePosition();
return TextPosition::minimumPosition();
}
void ScriptController::disableEval()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment