Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: Source/bindings/core/v8/ScriptController.cpp

Issue 313173012: HTMLParser should use current value of scriptEnabled flag (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@WebKit-ADD
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 if (reason == AboutToExecuteScript) 492 if (reason == AboutToExecuteScript)
493 m_frame->document()->addConsoleMessage(SecurityMessageSource, ErrorM essageLevel, "Blocked script execution in '" + m_frame->document()->url().elided String() + "' because the document's frame is sandboxed and the 'allow-scripts' permission is not set."); 493 m_frame->document()->addConsoleMessage(SecurityMessageSource, ErrorM essageLevel, "Blocked script execution in '" + m_frame->document()->url().elided String() + "' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.");
494 return false; 494 return false;
495 } 495 }
496 496
497 if (m_frame->document() && m_frame->document()->isViewSource()) { 497 if (m_frame->document() && m_frame->document()->isViewSource()) {
498 ASSERT(m_frame->document()->securityOrigin()->isUnique()); 498 ASSERT(m_frame->document()->securityOrigin()->isUnique());
499 return true; 499 return true;
500 } 500 }
501 501
502 Settings* settings = m_frame->settings(); 502 const bool allowed = m_frame->document()->scriptEnabled()
503 const bool allowed = m_frame->loader().client()->allowScript(settings && set tings->scriptEnabled())
504 || isInPrivateScriptIsolateWorld(m_isolate); 503 || isInPrivateScriptIsolateWorld(m_isolate);
505 if (!allowed && reason == AboutToExecuteScript) 504 if (!allowed && reason == AboutToExecuteScript)
506 m_frame->loader().client()->didNotAllowScript(); 505 m_frame->loader().client()->didNotAllowScript();
507 return allowed; 506 return allowed;
508 } 507 }
509 508
510 bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url) 509 bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url)
511 { 510 {
512 if (!protocolIsJavaScript(url)) 511 if (!protocolIsJavaScript(url))
513 return false; 512 return false;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 resultArray->Set(i, evaluationResult); 621 resultArray->Set(i, evaluationResult);
623 } 622 }
624 623
625 if (results) { 624 if (results) {
626 for (size_t i = 0; i < resultArray->Length(); ++i) 625 for (size_t i = 0; i < resultArray->Length(); ++i)
627 results->append(handleScope.Escape(resultArray->Get(i))); 626 results->append(handleScope.Escape(resultArray->Get(i)));
628 } 627 }
629 } 628 }
630 629
631 } // namespace WebCore 630 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/xsl/xslt-transform-with-javascript-disabled.html ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698