Changeset 178648 in webkit
- Timestamp:
- Jan 19, 2015, 9:25:23 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/LayoutTests/ChangeLog ¶
r178645 r178648 1 2015-01-16 Alexey Proskuryakov <ap@apple.com> 2 3 Console log sometimes prefixed with line number 4 https://bugs.webkit.org/show_bug.cgi?id=105280 5 6 Reviewed by Darin Adler. 7 8 Some messages lost line numbers now. Some of these were definitely wrong, others 9 were roughly right. Unfortunately, it is not currently possible to figure out whether 10 ScriptController actually executes a script after passing control to it. So the cases 11 where it refuses to execute the script and logs a message are handled like those 12 where it does. 13 14 I think that it shouldn't be a big obstacle in practice, it is easy enough to find 15 a script in a page when Web Inspector tells you that scripts were not allowed. 16 17 * fast/frames/sandboxed-iframe-attribute-parsing-06-expected.txt: 18 * fast/frames/sandboxed-iframe-attribute-parsing-07-expected.txt: 19 * fast/frames/sandboxed-iframe-attribute-parsing-08-expected.txt: 20 * fast/frames/sandboxed-iframe-attribute-parsing-09-expected.txt: 21 * fast/frames/sandboxed-iframe-attribute-parsing-10-expected.txt: 22 * fast/frames/sandboxed-iframe-attribute-parsing-11-expected.txt: 23 * fast/frames/sandboxed-iframe-attribute-parsing-12-expected.txt: 24 * fast/frames/sandboxed-iframe-attribute-parsing-13-expected.txt: 25 * fast/frames/sandboxed-iframe-attribute-parsing-14-expected.txt: 26 * fast/frames/sandboxed-iframe-parsing-space-characters-expected.txt: 27 * fast/frames/sandboxed-iframe-scripting-04-expected.txt: 28 * http/tests/security/contentSecurityPolicy/sandbox-empty-expected.txt: 29 * http/tests/security/contentSecurityPolicy/sandbox-empty-subframe-expected.txt: 30 * http/tests/security/contentSecurityPolicy/sandbox-in-http-header-control-expected.txt: 31 * http/tests/security/contentSecurityPolicy/sandbox-in-http-header-expected.txt: 32 * http/tests/security/contentSecurityPolicy/sandbox-invalid-header-expected.txt: 33 * http/tests/security/isolatedWorld/sandboxed-iframe-expected.txt: 34 * http/tests/security/mixedContent/insecure-script-in-iframe-expected.txt: 35 * http/tests/security/mixedContent/redirect-http-to-https-script-in-iframe-expected.txt: 36 * http/tests/security/no-javascript-refresh-expected.txt: 37 * http/tests/security/no-javascript-refresh-spaces-expected.txt: 38 39 * platform/efl/TestExpectations: 40 * platform/gtk/TestExpectations: 41 Unmark tests that were broken by this. 42 1 43 2015-01-19 Csaba Osztrogonác <ossy@webkit.org> 2 44 -
TabularUnified trunk/LayoutTests/fast/frames/sandboxed-iframe-attribute-parsing-06-expected.txt ¶
r156130 r178648 1 1 CONSOLE MESSAGE: line 9: Error while parsing the 'sandbox' attribute: 'allowscripts' is an invalid sandbox flag. 2 CONSOLE MESSAGE: line 4:Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.2 CONSOLE MESSAGE: Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 3 3 Misspelling. 4 4 -
TabularUnified trunk/LayoutTests/fast/frames/sandboxed-iframe-attribute-parsing-07-expected.txt ¶
r156130 r178648 1 1 CONSOLE MESSAGE: line 9: Error while parsing the 'sandbox' attribute: 'allows-cripts' is an invalid sandbox flag. 2 CONSOLE MESSAGE: line 4:Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.2 CONSOLE MESSAGE: Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 3 3 Misspelling. 4 4 -
TabularUnified trunk/LayoutTests/fast/frames/sandboxed-iframe-attribute-parsing-08-expected.txt ¶
r156130 r178648 1 1 CONSOLE MESSAGE: line 9: Error while parsing the 'sandbox' attribute: '-allow-scripts' is an invalid sandbox flag. 2 CONSOLE MESSAGE: line 4:Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.2 CONSOLE MESSAGE: Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 3 3 Misspelling. 4 4 -
TabularUnified trunk/LayoutTests/fast/frames/sandboxed-iframe-attribute-parsing-09-expected.txt ¶
r156130 r178648 1 1 CONSOLE MESSAGE: line 9: Error while parsing the 'sandbox' attribute: 'allow_scripts' is an invalid sandbox flag. 2 CONSOLE MESSAGE: line 4:Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.2 CONSOLE MESSAGE: Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 3 3 Misspelling. 4 4 -
TabularUnified trunk/LayoutTests/fast/frames/sandboxed-iframe-attribute-parsing-10-expected.txt ¶
r156130 r178648 1 1 CONSOLE MESSAGE: line 9: Error while parsing the 'sandbox' attribute: 'allowScripts' is an invalid sandbox flag. 2 CONSOLE MESSAGE: line 4:Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.2 CONSOLE MESSAGE: Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 3 3 Misspelling. 4 4 -
TabularUnified trunk/LayoutTests/fast/frames/sandboxed-iframe-attribute-parsing-11-expected.txt ¶
r156130 r178648 1 1 CONSOLE MESSAGE: line 9: Error while parsing the 'sandbox' attribute: 'aallow-scripts' is an invalid sandbox flag. 2 CONSOLE MESSAGE: line 4:Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.2 CONSOLE MESSAGE: Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 3 3 Misspelling. 4 4 -
TabularUnified trunk/LayoutTests/fast/frames/sandboxed-iframe-attribute-parsing-12-expected.txt ¶
r156130 r178648 1 1 CONSOLE MESSAGE: line 9: Error while parsing the 'sandbox' attribute: 'allow-scriptss' is an invalid sandbox flag. 2 CONSOLE MESSAGE: line 4:Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.2 CONSOLE MESSAGE: Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 3 3 Misspelling. 4 4 -
TabularUnified trunk/LayoutTests/fast/frames/sandboxed-iframe-attribute-parsing-13-expected.txt ¶
r156130 r178648 1 1 CONSOLE MESSAGE: line 9: Error while parsing the 'sandbox' attribute: 'allow-script' is an invalid sandbox flag. 2 CONSOLE MESSAGE: line 4:Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.2 CONSOLE MESSAGE: Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 3 3 Misspelling. 4 4 -
TabularUnified trunk/LayoutTests/fast/frames/sandboxed-iframe-attribute-parsing-14-expected.txt ¶
r156130 r178648 1 CONSOLE MESSAGE: line 4:Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.1 CONSOLE MESSAGE: Blocked script execution in 'sandboxed-iframe-attribute-parsing-disallowed.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 2 2 Full sandbox. 3 3 -
TabularUnified trunk/LayoutTests/fast/frames/sandboxed-iframe-parsing-space-characters-expected.txt ¶
r178527 r178648 2 2 CONSOLE MESSAGE: line 16: Error while parsing the 'sandbox' attribute: 'allow-scripts 3 3 allow-forms' is an invalid sandbox flag. 4 CONSOLE MESSAGE: line 1:Blocked script execution in 'data:text/html,<script>alert('FAIL: Vertical tab is not a delimiter.');</script>' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.4 CONSOLE MESSAGE: Blocked script execution in 'data:text/html,<script>alert('FAIL: Vertical tab is not a delimiter.');</script>' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 5 5 ALERT: PASS: Newline is a delimiter. 6 6 ALERT: PASS: Return is a delimiter. 7 7 CONSOLE MESSAGE: line 16: Error while parsing the 'sandbox' attribute: 'allow-scriptsxallow-forms' is an invalid sandbox flag. 8 CONSOLE MESSAGE: line 1:Blocked script execution in 'data:text/html,<script>alert('FAIL: x is not a delimiter.');</script>' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.8 CONSOLE MESSAGE: Blocked script execution in 'data:text/html,<script>alert('FAIL: x is not a delimiter.');</script>' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 9 9 ALERT: PASS: Tab is a delimiter. 10 10 ALERT: PASS: Space is a delimiter character. -
TabularUnified trunk/LayoutTests/fast/frames/sandboxed-iframe-scripting-04-expected.txt ¶
r156130 r178648 1 CONSOLE MESSAGE: line 1:Blocked script execution in 'data:text/html,<script>alert('FAIL: Executed script without allow-scripts in data URL');window.parent.postMessage({'fail': true}, '*');</script>' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.1 CONSOLE MESSAGE: Blocked script execution in 'data:text/html,<script>alert('FAIL: Executed script without allow-scripts in data URL');window.parent.postMessage({'fail': true}, '*');</script>' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 2 2 Verify that sandboxed frames without sandbox='allow-scripts' cannot execute script from data: URLs. 3 3 -
TabularUnified trunk/LayoutTests/http/tests/security/contentSecurityPolicy/sandbox-empty-expected.txt ¶
r156130 r178648 1 CONSOLE MESSAGE: line 9:Blocked script execution in 'http://127.0.0.1:8000/security/contentSecurityPolicy/sandbox-empty.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.1 CONSOLE MESSAGE: Blocked script execution in 'http://127.0.0.1:8000/security/contentSecurityPolicy/sandbox-empty.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 2 2 This test passes if it doesn't alert fail. -
TabularUnified trunk/LayoutTests/http/tests/security/contentSecurityPolicy/sandbox-empty-subframe-expected.txt ¶
r156130 r178648 1 CONSOLE MESSAGE: line 1:Blocked script execution in 'data:text/html,<script>alert('FAIL');</script>' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.1 CONSOLE MESSAGE: Blocked script execution in 'data:text/html,<script>alert('FAIL');</script>' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 2 2 This test passes if it doesn't alert fail. -
TabularUnified trunk/LayoutTests/http/tests/security/contentSecurityPolicy/sandbox-in-http-header-control-expected.txt ¶
r156130 r178648 1 CONSOLE MESSAGE: line 6:Blocked script execution in 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/sandbox.php?sandbox=allow-top-navigation%20allow-same-origin' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.1 CONSOLE MESSAGE: Blocked script execution in 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/sandbox.php?sandbox=allow-top-navigation%20allow-same-origin' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 2 2 ALERT: PASS: Iframe was not in a unique origin 3 3 -
TabularUnified trunk/LayoutTests/http/tests/security/contentSecurityPolicy/sandbox-in-http-header-expected.txt ¶
r178527 r178648 1 CONSOLE MESSAGE: line 6:Blocked script execution in 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/sandbox.php?sandbox=allow-top-navigation' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.1 CONSOLE MESSAGE: Blocked script execution in 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/sandbox.php?sandbox=allow-top-navigation' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 2 2 CONSOLE MESSAGE: line 9: Sandbox access violation: Blocked a frame at "http://127.0.0.1:8000" from accessing a frame at "http://127.0.0.1:8000". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag. 3 3 ALERT: PASS: Iframe was in a unique origin -
TabularUnified trunk/LayoutTests/http/tests/security/contentSecurityPolicy/sandbox-invalid-header-expected.txt ¶
r156130 r178648 1 1 CONSOLE MESSAGE: Error while parsing the 'sandbox' Content Security Policy directive: 'allowScript' is an invalid sandbox flag. 2 CONSOLE MESSAGE: line 6:Blocked script execution in 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/sandbox.php?sandbox=allowScript' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.2 CONSOLE MESSAGE: Blocked script execution in 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/sandbox.php?sandbox=allowScript' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 3 3 -
TabularUnified trunk/LayoutTests/http/tests/security/isolatedWorld/sandboxed-iframe-expected.txt ¶
r156130 r178648 1 CONSOLE MESSAGE: line 3:Blocked script execution in 'http://127.0.0.1:8000/security/isolatedWorld/resources/fail.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.1 CONSOLE MESSAGE: Blocked script execution in 'http://127.0.0.1:8000/security/isolatedWorld/resources/fail.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. 2 2 ALERT: PASS 3 3 Test that executing scripts in an isolated world works even inside sandboxed iframes. The test passes, if an alert with the text "PASS" is shown. -
TabularUnified trunk/LayoutTests/http/tests/security/mixedContent/insecure-script-in-iframe-expected.txt ¶
r156130 r178648 1 CONSOLE MESSAGE: line 1:The page at https://127.0.0.1:8443/security/mixedContent/resources/frame-with-insecure-script.html ran insecure content from http://127.0.0.1:8080/security/mixedContent/resources/script.js.1 CONSOLE MESSAGE: The page at https://127.0.0.1:8443/security/mixedContent/resources/frame-with-insecure-script.html ran insecure content from http://127.0.0.1:8080/security/mixedContent/resources/script.js. 2 2 3 3 This test loads a secure iframe that loads an insecure script. We should trigger a mixed content callback even though the main frame is HTTP because the HTTPS frame's origin is contaminated with an insecure script. -
TabularUnified trunk/LayoutTests/http/tests/security/mixedContent/redirect-http-to-https-script-in-iframe-expected.txt ¶
r156130 r178648 2 2 main frame - didFinishDocumentLoadForFrame 3 3 frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame 4 CONSOLE MESSAGE: line 1:The page at https://127.0.0.1:8443/security/mixedContent/resources/frame-with-redirect-http-to-https-script.html ran insecure content from http://127.0.0.1:8080/resources/redirect.php?url=https://127.0.0.1:8443/security/mixedContent/resources/script.js.4 CONSOLE MESSAGE: The page at https://127.0.0.1:8443/security/mixedContent/resources/frame-with-redirect-http-to-https-script.html ran insecure content from http://127.0.0.1:8080/resources/redirect.php?url=https://127.0.0.1:8443/security/mixedContent/resources/script.js. 5 5 6 6 didRunInsecureContent -
TabularUnified trunk/LayoutTests/http/tests/security/no-javascript-refresh-expected.txt ¶
r166600 r178648 1 CONSOLE MESSAGE: line 1:Refused to refresh http://127.0.0.1:8000/security/no-javascript-refresh.php to a javascript: URL1 CONSOLE MESSAGE: Refused to refresh http://127.0.0.1:8000/security/no-javascript-refresh.php to a javascript: URL 2 2 PASS: This is the content that appears in place of a refresh. -
TabularUnified trunk/LayoutTests/http/tests/security/no-javascript-refresh-spaces-expected.txt ¶
r166600 r178648 1 CONSOLE MESSAGE: line 1:Refused to refresh http://127.0.0.1:8000/security/no-javascript-refresh-spaces.php to a javascript: URL1 CONSOLE MESSAGE: Refused to refresh http://127.0.0.1:8000/security/no-javascript-refresh-spaces.php to a javascript: URL 2 2 PASS: This is the content that appears in place of a refresh. -
TabularUnified trunk/LayoutTests/platform/efl/TestExpectations ¶
r178508 r178648 690 690 691 691 webkit.org/b/103383 fast/css/counters/element-removal-crash.xhtml [ Failure Pass ] 692 693 # flaky console output problem694 webkit.org/b/105280 http/tests/xmlhttprequest/origin-whitelisting-https.html [ Failure Pass ]695 webkit.org/b/105280 http/tests/xmlhttprequest/access-control-preflight-async-header-denied.html [ Failure Pass ]696 webkit.org/b/105280 http/tests/xmlhttprequest/access-control-preflight-async-method-denied.html [ Failure Pass ]697 webkit.org/b/105280 http/tests/xmlhttprequest/cross-site-denied-response.html [ Failure Pass ]698 webkit.org/b/105280 http/tests/xmlhttprequest/access-control-preflight-async-not-supported.html [ Failure Pass ]699 692 700 693 webkit.org/b/105296 webaudio/delaynode-maxdelay.html [ Failure Pass ] -
TabularUnified trunk/LayoutTests/platform/gtk/TestExpectations ¶
r178508 r178648 761 761 762 762 webkit.org/b/105191 media/video-playing-and-pause.html [ Failure Pass ] 763 764 webkit.org/b/105280 http/tests/xmlhttprequest/access-control-preflight-async-header-denied.html [ Failure Pass ]765 webkit.org/b/105280 http/tests/xmlhttprequest/access-control-preflight-async-method-denied.html [ Failure Pass ]766 webkit.org/b/105280 http/tests/xmlhttprequest/access-control-preflight-async-not-supported.html [ Failure Pass ]767 webkit.org/b/105280 http/tests/xmlhttprequest/cross-site-denied-response.html [ Failure Pass ]768 webkit.org/b/105280 http/tests/xmlhttprequest/origin-whitelisting-https.html [ Failure Pass ]769 webkit.org/b/105280 http/tests/xmlhttprequest/simple-cross-origin-denied-events.html [ Failure Pass ]770 webkit.org/b/105280 http/tests/xmlhttprequest/simple-cross-origin-denied-events-post.html [ Failure Pass ]771 763 772 764 webkit.org/b/118460 media/media-element-play-after-eos.html [ Timeout Pass ] -
TabularUnified trunk/Source/WebCore/ChangeLog ¶
r178647 r178648 1 2015-01-16 Alexey Proskuryakov <ap@apple.com> 2 3 Console log sometimes prefixed with line number 4 https://bugs.webkit.org/show_bug.cgi?id=105280 5 6 Reviewed by Darin Adler. 7 8 Improve the logic for determining whether a console message should be associated 9 with a source code location. 10 11 * dom/ScriptableDocumentParser.h: 12 * html/parser/HTMLDocumentParser.cpp: 13 (WebCore::HTMLDocumentParser::shouldAssociateConsoleMessagesWithTextPosition): 14 * html/parser/HTMLDocumentParser.h: 15 * page/PageConsoleClient.cpp: 16 (WebCore::getParserLocationForConsoleMessage): 17 (WebCore::PageConsoleClient::addMessage): 18 * xml/parser/XMLDocumentParser.cpp: 19 (WebCore::XMLDocumentParser::pauseParsing): 20 * xml/parser/XMLDocumentParser.h: 21 * xml/parser/XMLDocumentParserLibxml2.cpp: 22 (WebCore::XMLDocumentParser::shouldAssociateConsoleMessagesWithTextPosition): 23 1 24 2015-01-19 Myles C. Maxfield <mmaxfield@apple.com> 2 25 -
TabularUnified trunk/Source/WebCore/dom/ScriptableDocumentParser.h ¶
r175148 r178648 47 47 virtual TextPosition textPosition() const = 0; 48 48 49 // Returns true if the parser didn't yield or pause or synchronously execute a script, 50 // so calls to PageConsoleClient should be associated with the parser's text position. 51 virtual bool shouldAssociateConsoleMessagesWithTextPosition() const = 0; 52 49 53 void setWasCreatedByScript(bool wasCreatedByScript) { m_wasCreatedByScript = wasCreatedByScript; } 50 54 bool wasCreatedByScript() const { return m_wasCreatedByScript; } -
TabularUnified trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp ¶
r178265 r178648 463 463 } 464 464 465 bool HTMLDocumentParser::shouldAssociateConsoleMessagesWithTextPosition() const 466 { 467 return inPumpSession() && !isExecutingScript(); 468 } 469 465 470 bool HTMLDocumentParser::isWaitingForScripts() const 466 471 { -
TabularUnified trunk/Source/WebCore/html/parser/HTMLDocumentParser.h ¶
r178265 r178648 88 88 virtual void resumeScheduledTasks() override final; 89 89 90 virtual bool shouldAssociateConsoleMessagesWithTextPosition() const override final; 91 90 92 // HTMLScriptRunnerHost 91 93 virtual void watchForLoad(CachedResource*) override final; -
TabularUnified trunk/Source/WebCore/page/PageConsoleClient.cpp ¶
r178527 r178648 84 84 } 85 85 86 static void getParserLocationForConsoleMessage(Document* document, String& url, unsigned& line, unsigned& column) 87 { 88 if (!document) 89 return; 90 91 // We definitely cannot associate the message with a location being parsed if we are not even parsing. 92 if (!document->parsing()) 93 return; 94 95 ScriptableDocumentParser* parser = document->scriptableDocumentParser(); 96 97 // When the parser waits for scripts, any messages must be coming from some other source, and are not related to the location of the script element that made the parser wait. 98 if (!parser->shouldAssociateConsoleMessagesWithTextPosition()) 99 return; 100 101 url = document->url().string(); 102 TextPosition position = parser->textPosition(); 103 line = position.m_line.oneBasedInt(); 104 column = position.m_column.oneBasedInt(); 105 } 106 86 107 void PageConsoleClient::addMessage(MessageSource source, MessageLevel level, const String& message, unsigned long requestIdentifier, Document* document) 87 108 { 88 109 String url; 89 if (document)90 url = document->url().string();91 92 // FIXME: The below code attempts to determine line numbers for parser generated errors, but this is not the only reason why we can get here.93 // For example, if we are still parsing and get a WebSocket network error, it will be erroneously attributed to a line where parsing was paused.94 // Also, we should determine line numbers for script generated messages (e.g. calling getImageData on a canvas).95 // We probably need to split this function into multiple ones, as appropriate for different call sites. Or maybe decide based on MessageSource.96 // https://bugs.webkit.org/show_bug.cgi?id=12534097 110 unsigned line = 0; 98 111 unsigned column = 0; 99 if (document && document->parsing() && !document->isInDocumentWrite() && document->scriptableDocumentParser()) { 100 ScriptableDocumentParser* parser = document->scriptableDocumentParser(); 101 if (!parser->isWaitingForScripts() && !JSMainThreadExecState::currentState()) { 102 TextPosition position = parser->textPosition(); 103 line = position.m_line.oneBasedInt(); 104 column = position.m_column.oneBasedInt(); 105 } 106 } 112 getParserLocationForConsoleMessage(document, url, line, column); 113 107 114 addMessage(source, level, message, url, line, column, 0, JSMainThreadExecState::currentState(), requestIdentifier); 108 115 } -
TabularUnified trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp ¶
r174278 r178648 262 262 void XMLDocumentParser::pauseParsing() 263 263 { 264 ASSERT(!m_parserPaused); 265 264 266 if (m_parsingFragment) 265 267 return; -
TabularUnified trunk/Source/WebCore/xml/parser/XMLDocumentParser.h ¶
r177559 r178648 66 66 }; 67 67 68 class XMLDocumentParser : public ScriptableDocumentParser, public CachedResourceClient {68 class XMLDocumentParser final : public ScriptableDocumentParser, public CachedResourceClient { 69 69 WTF_MAKE_FAST_ALLOCATED; 70 70 public: … … 91 91 virtual bool wellFormed() const { return !m_sawError; } 92 92 93 TextPosition textPosition() const;94 95 93 static bool supportsXMLVersion(const String&); 96 94 … … 106 104 virtual void stopParsing() override; 107 105 virtual void detach() override; 106 107 virtual TextPosition textPosition() const override; 108 virtual bool shouldAssociateConsoleMessagesWithTextPosition() const override; 108 109 109 110 // from CachedResourceClient -
TabularUnified trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp ¶
r177559 r178648 1435 1435 } 1436 1436 1437 bool XMLDocumentParser::shouldAssociateConsoleMessagesWithTextPosition() const 1438 { 1439 return !m_parserPaused && !m_requestingScript; 1440 } 1441 1437 1442 void XMLDocumentParser::stopParsing() 1438 1443 {
Note:
See TracChangeset
for help on using the changeset viewer.