[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
eric at webkit.org
eric at webkit.org
Thu Apr 8 02:23:24 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit 6c57cbcd05c91361704d1189969780e9b5e0a086
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Mar 16 07:27:24 2010 +0000
2010-03-16 Adam Barth <abarth at webkit.org>
Reviewed by Darin Adler.
noscript tag should render when @sandbox disables JavaScript
https://bugs.webkit.org/show_bug.cgi?id=36092
Test that the noscript element renders when @sandbox disables
JavaScript.
* fast/frames/sandboxed-iframe-noscript-expected.txt: Added.
* fast/frames/sandboxed-iframe-noscript.html: Added.
2010-03-16 Adam Barth <abarth at webkit.org>
Reviewed by Darin Adler.
noscript tag should render when @sandbox disables JavaScript
https://bugs.webkit.org/show_bug.cgi?id=36092
Instead of talking to Settings directly to figure out if JavaScript is
enabled in a frame, we need to talk to the ScriptController. The
ScriptController is better at answering that question because it knows
about @sandbox.
Test: fast/frames/sandboxed-iframe-noscript.html
* dom/Document.cpp:
(WebCore::Document::Document):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createRenderer):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::rendererIsNeeded):
* html/HTMLParser.cpp:
(WebCore::HTMLParser::noscriptCreateErrorCheck):
(WebCore::HTMLParser::isInline):
* plugins/PluginView.cpp:
(WebCore::PluginView::load):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@56046 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d51bc6c..bda7ba3 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-03-16 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Darin Adler.
+
+ noscript tag should render when @sandbox disables JavaScript
+ https://bugs.webkit.org/show_bug.cgi?id=36092
+
+ Test that the noscript element renders when @sandbox disables
+ JavaScript.
+
+ * fast/frames/sandboxed-iframe-noscript-expected.txt: Added.
+ * fast/frames/sandboxed-iframe-noscript.html: Added.
+
2010-03-15 Kent Tamura <tkent at chromium.org>
Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/frames/sandboxed-iframe-noscript-expected.txt b/LayoutTests/fast/frames/sandboxed-iframe-noscript-expected.txt
new file mode 100644
index 0000000..e8c22b8
--- /dev/null
+++ b/LayoutTests/fast/frames/sandboxed-iframe-noscript-expected.txt
@@ -0,0 +1,6 @@
+
+
+--------
+Frame: '<!--framePath //<!--frame0-->-->'
+--------
+PASS
diff --git a/LayoutTests/fast/frames/sandboxed-iframe-noscript.html b/LayoutTests/fast/frames/sandboxed-iframe-noscript.html
new file mode 100644
index 0000000..eef8fed
--- /dev/null
+++ b/LayoutTests/fast/frames/sandboxed-iframe-noscript.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.dumpChildFramesAsText();
+}
+</script>
+</head>
+<body>
+<iframe sandbox src="data:text/html,<noscript>PASS</noscript>">
+</iframe>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 20c9950..47aab46 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,29 @@
+2010-03-16 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Darin Adler.
+
+ noscript tag should render when @sandbox disables JavaScript
+ https://bugs.webkit.org/show_bug.cgi?id=36092
+
+ Instead of talking to Settings directly to figure out if JavaScript is
+ enabled in a frame, we need to talk to the ScriptController. The
+ ScriptController is better at answering that question because it knows
+ about @sandbox.
+
+ Test: fast/frames/sandboxed-iframe-noscript.html
+
+ * dom/Document.cpp:
+ (WebCore::Document::Document):
+ * html/HTMLCanvasElement.cpp:
+ (WebCore::HTMLCanvasElement::createRenderer):
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::rendererIsNeeded):
+ * html/HTMLParser.cpp:
+ (WebCore::HTMLParser::noscriptCreateErrorCheck):
+ (WebCore::HTMLParser::isInline):
+ * plugins/PluginView.cpp:
+ (WebCore::PluginView::load):
+
2010-03-15 John Gregg <johnnyg at google.com>
Reviewed by David Levin.
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index 243f83c..b57ffaf 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -451,7 +451,7 @@ Document::Document(Frame* frame, bool isXHTML, bool isHTML)
static int docID = 0;
m_docID = docID++;
#if ENABLE(XHTMLMP)
- m_shouldProcessNoScriptElement = settings() && !settings()->isJavaScriptEnabled();
+ m_shouldProcessNoScriptElement = m_frame->script()->canExecuteScripts(NotAboutToExecuteScript);
#endif
}
diff --git a/WebCore/html/HTMLCanvasElement.cpp b/WebCore/html/HTMLCanvasElement.cpp
index 61281c4..30a620c 100644
--- a/WebCore/html/HTMLCanvasElement.cpp
+++ b/WebCore/html/HTMLCanvasElement.cpp
@@ -113,8 +113,8 @@ void HTMLCanvasElement::parseMappedAttribute(MappedAttribute* attr)
RenderObject* HTMLCanvasElement::createRenderer(RenderArena* arena, RenderStyle* style)
{
- Settings* settings = document()->settings();
- if (settings && settings->isJavaScriptEnabled()) {
+ Frame* frame = document()->frame();
+ if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript)) {
m_rendererIsCanvas = true;
return new (arena) RenderHTMLCanvas(this);
}
diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp
index c224913..3d64fe1 100644
--- a/WebCore/html/HTMLElement.cpp
+++ b/WebCore/html/HTMLElement.cpp
@@ -976,8 +976,8 @@ bool HTMLElement::rendererIsNeeded(RenderStyle *style)
{
#if !ENABLE(XHTMLMP)
if (hasLocalName(noscriptTag)) {
- Settings* settings = document()->settings();
- if (settings && settings->isJavaScriptEnabled())
+ Frame* frame = document()->frame();
+ if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript))
return false;
}
#endif
diff --git a/WebCore/html/HTMLParser.cpp b/WebCore/html/HTMLParser.cpp
index ea32b1d..c5839a8 100644
--- a/WebCore/html/HTMLParser.cpp
+++ b/WebCore/html/HTMLParser.cpp
@@ -875,8 +875,8 @@ bool HTMLParser::noframesCreateErrorCheck(Token*, RefPtr<Node>&)
bool HTMLParser::noscriptCreateErrorCheck(Token*, RefPtr<Node>&)
{
if (!m_isParsingFragment) {
- Settings* settings = m_document->settings();
- if (settings && settings->isJavaScriptEnabled())
+ Frame* frame = m_document->frame();
+ if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript))
setSkipMode(noscriptTag);
}
return true;
@@ -1061,8 +1061,8 @@ bool HTMLParser::isInline(Node* node) const
return true;
#if !ENABLE(XHTMLMP)
if (e->hasLocalName(noscriptTag) && !m_isParsingFragment) {
- Settings* settings = m_document->settings();
- if (settings && settings->isJavaScriptEnabled())
+ Frame* frame = m_document->frame();
+ if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript))
return true;
}
#endif
diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h
index 9b7ccd6..70c3cbd 100644
--- a/WebCore/page/Settings.h
+++ b/WebCore/page/Settings.h
@@ -105,6 +105,9 @@ namespace WebCore {
bool loadsImagesAutomatically() const { return m_loadsImagesAutomatically; }
void setJavaScriptEnabled(bool);
+ // Instead of calling isJavaScriptEnabled directly, please consider calling
+ // ScriptController::canExecuteScripts, which takes things like the
+ // HTML sandbox attribute into account.
bool isJavaScriptEnabled() const { return m_isJavaScriptEnabled; }
void setWebSecurityEnabled(bool);
diff --git a/WebCore/plugins/PluginView.cpp b/WebCore/plugins/PluginView.cpp
index f13a2d6..2713352 100644
--- a/WebCore/plugins/PluginView.cpp
+++ b/WebCore/plugins/PluginView.cpp
@@ -533,12 +533,10 @@ NPError PluginView::load(const FrameLoadRequest& frameLoadRequest, bool sendNoti
String jsString = scriptStringIfJavaScriptURL(url);
if (!jsString.isNull()) {
- Settings* settings = m_parentFrame->settings();
-
// Return NPERR_GENERIC_ERROR if JS is disabled. This is what Mozilla does.
- if (!settings || !settings->isJavaScriptEnabled())
+ if (m_parentFrame->script()->canExecuteScripts(NotAboutToExecuteScript))
return NPERR_GENERIC_ERROR;
-
+
// For security reasons, only allow JS requests to be made on the frame that contains the plug-in.
if (!targetFrameName.isNull() && m_parentFrame->tree()->find(targetFrameName) != m_parentFrame)
return NPERR_INVALID_PARAM;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list