Changeset 56046 in webkit
- Timestamp:
- Mar 16, 2010 12:27:24 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r56041 r56046 1 2010-03-16 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 noscript tag should render when @sandbox disables JavaScript 6 https://bugs.webkit.org/show_bug.cgi?id=36092 7 8 Test that the noscript element renders when @sandbox disables 9 JavaScript. 10 11 * fast/frames/sandboxed-iframe-noscript-expected.txt: Added. 12 * fast/frames/sandboxed-iframe-noscript.html: Added. 13 1 14 2010-03-15 Kent Tamura <tkent@chromium.org> 2 15 -
trunk/WebCore/ChangeLog
r56043 r56046 1 2010-03-16 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 noscript tag should render when @sandbox disables JavaScript 6 https://bugs.webkit.org/show_bug.cgi?id=36092 7 8 Instead of talking to Settings directly to figure out if JavaScript is 9 enabled in a frame, we need to talk to the ScriptController. The 10 ScriptController is better at answering that question because it knows 11 about @sandbox. 12 13 Test: fast/frames/sandboxed-iframe-noscript.html 14 15 * dom/Document.cpp: 16 (WebCore::Document::Document): 17 * html/HTMLCanvasElement.cpp: 18 (WebCore::HTMLCanvasElement::createRenderer): 19 * html/HTMLElement.cpp: 20 (WebCore::HTMLElement::rendererIsNeeded): 21 * html/HTMLParser.cpp: 22 (WebCore::HTMLParser::noscriptCreateErrorCheck): 23 (WebCore::HTMLParser::isInline): 24 * plugins/PluginView.cpp: 25 (WebCore::PluginView::load): 26 1 27 2010-03-15 John Gregg <johnnyg@google.com> 2 28 -
trunk/WebCore/dom/Document.cpp
r55816 r56046 452 452 m_docID = docID++; 453 453 #if ENABLE(XHTMLMP) 454 m_shouldProcessNoScriptElement = settings() && !settings()->isJavaScriptEnabled();454 m_shouldProcessNoScriptElement = m_frame->script()->canExecuteScripts(NotAboutToExecuteScript); 455 455 #endif 456 456 } -
trunk/WebCore/html/HTMLCanvasElement.cpp
r55685 r56046 114 114 RenderObject* HTMLCanvasElement::createRenderer(RenderArena* arena, RenderStyle* style) 115 115 { 116 Settings* settings = document()->settings();117 if ( settings && settings->isJavaScriptEnabled()) {116 Frame* frame = document()->frame(); 117 if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript)) { 118 118 m_rendererIsCanvas = true; 119 119 return new (arena) RenderHTMLCanvas(this); -
trunk/WebCore/html/HTMLElement.cpp
r55980 r56046 977 977 #if !ENABLE(XHTMLMP) 978 978 if (hasLocalName(noscriptTag)) { 979 Settings* settings = document()->settings();980 if ( settings && settings->isJavaScriptEnabled())979 Frame* frame = document()->frame(); 980 if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript)) 981 981 return false; 982 982 } -
trunk/WebCore/html/HTMLParser.cpp
r55710 r56046 876 876 { 877 877 if (!m_isParsingFragment) { 878 Settings* settings = m_document->settings();879 if ( settings && settings->isJavaScriptEnabled())878 Frame* frame = m_document->frame(); 879 if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript)) 880 880 setSkipMode(noscriptTag); 881 881 } … … 1062 1062 #if !ENABLE(XHTMLMP) 1063 1063 if (e->hasLocalName(noscriptTag) && !m_isParsingFragment) { 1064 Settings* settings = m_document->settings();1065 if ( settings && settings->isJavaScriptEnabled())1064 Frame* frame = m_document->frame(); 1065 if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript)) 1066 1066 return true; 1067 1067 } -
trunk/WebCore/page/Settings.h
r55976 r56046 106 106 107 107 void setJavaScriptEnabled(bool); 108 // Instead of calling isJavaScriptEnabled directly, please consider calling 109 // ScriptController::canExecuteScripts, which takes things like the 110 // HTML sandbox attribute into account. 108 111 bool isJavaScriptEnabled() const { return m_isJavaScriptEnabled; } 109 112 -
trunk/WebCore/plugins/PluginView.cpp
r55433 r56046 534 534 535 535 if (!jsString.isNull()) { 536 Settings* settings = m_parentFrame->settings();537 538 536 // Return NPERR_GENERIC_ERROR if JS is disabled. This is what Mozilla does. 539 if ( !settings || !settings->isJavaScriptEnabled())537 if (m_parentFrame->script()->canExecuteScripts(NotAboutToExecuteScript)) 540 538 return NPERR_GENERIC_ERROR; 541 539 542 540 // For security reasons, only allow JS requests to be made on the frame that contains the plug-in. 543 541 if (!targetFrameName.isNull() && m_parentFrame->tree()->find(targetFrameName) != m_parentFrame)
Note: See TracChangeset
for help on using the changeset viewer.