|
Limit console messages' automatic collection of parser state.
PageConsole::addMessage currently grabs the current line number from the
ScriptableDocumentParser if it looks like parsing might be responsible
for the message. We override that line number later on in the reporting
process (ConsoleMessage::autogenerateMetadata) for JavaScript-driven
console messages. This is generally awesome, as it means we don't have
to collect line numbers at every callsite where we'd like to write
something to the console.
It is, however, flaky. Asynchronousness can cause messages to be
triggered before the parser's done parsing, even though they have
nothing to do with whatever the parser is currently looking at. The
line number will be corrected before it hits the console, but we
unfortunately notify clients (and therefore Content Shell) too early
in the process for that to keep the flake from making its way into test
expectations. 'http/tests/security/canvas-remote-read-data-url-svg-image.html'
is one example: I'm sure there are many more.
This patch changes PageConsole's behavior to only automatically collect
metadata for MessageSources that we know to be generally parser-driven.
It also adds a mechanism for particular messages from atypical
MessageSources to force metadata collection if they are known to be
parser-driven.
The rebaselines associated with this patch are a happy consequence, as
we shouldn't have had line numbers with these errors to begin with:
These tests' console messages are triggered from HTTP headers, not the
document:
* 'http/tests/security/xssAuditor/malformed-xss-*'
* 'http/tests/security/contentSecurityPolicy/1.1/reflected-xss-*'
* 'http/tests/security/no-javascript-refresh.php'
'http/tests/security/frame-loading-via-document-write.html' shouldn't
grab a line number, as the console message is triggered via
'document.write', and will end up being collected along with the stack
trace.
BUG= 224317
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+43 lines, -34 lines) |
Patch |
|
M |
LayoutTests/TestExpectations
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/fast/frames/sandboxed-iframe-autofocus-denied-expected.txt
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-allow-invalid-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-block-invalid-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-filter-invalid-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-invalid-invalid-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-unset-invalid-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/security/no-javascript-refresh-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-1-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-2-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-3-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-4-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-5-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-6-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-7-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-8-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-9-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/bindings/v8/ScriptController.cpp
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/dom/Document.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/dom/Document.cpp
|
View
|
|
4 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
|
M |
Source/core/dom/ScriptExecutionContext.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/html/parser/XSSAuditorDelegate.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/loader/FrameLoader.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/loader/MixedContentChecker.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/loader/cache/ResourceFetcher.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/page/ConsoleTypes.h
|
View
|
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/page/PageConsole.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/page/PageConsole.cpp
|
View
|
|
2 chunks |
+7 lines, -2 lines |
0 comments
|
Download
|
|
M |
Source/core/workers/WorkerGlobalScope.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/workers/WorkerGlobalScope.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
Total messages: 6 (0 generated)
|