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

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

Issue 375263002: Revert of 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 const bool allowed = m_frame->document()->scriptEnabled() 502 Settings* settings = m_frame->settings();
503 const bool allowed = m_frame->loader().client()->allowScript(settings && set tings->scriptEnabled())
503 || isInPrivateScriptIsolateWorld(m_isolate); 504 || isInPrivateScriptIsolateWorld(m_isolate);
504 if (!allowed && reason == AboutToExecuteScript) 505 if (!allowed && reason == AboutToExecuteScript)
505 m_frame->loader().client()->didNotAllowScript(); 506 m_frame->loader().client()->didNotAllowScript();
506 return allowed; 507 return allowed;
507 } 508 }
508 509
509 bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url) 510 bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url)
510 { 511 {
511 if (!protocolIsJavaScript(url)) 512 if (!protocolIsJavaScript(url))
512 return false; 513 return false;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 resultArray->Set(i, evaluationResult); 622 resultArray->Set(i, evaluationResult);
622 } 623 }
623 624
624 if (results) { 625 if (results) {
625 for (size_t i = 0; i < resultArray->Length(); ++i) 626 for (size_t i = 0; i < resultArray->Length(); ++i)
626 results->append(handleScope.Escape(resultArray->Get(i))); 627 results->append(handleScope.Escape(resultArray->Get(i)));
627 } 628 }
628 } 629 }
629 630
630 } // namespace WebCore 631 } // 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