summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/xml/XMLTreeViewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/xml/XMLTreeViewer.cpp')
-rw-r--r--Source/WebCore/xml/XMLTreeViewer.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/WebCore/xml/XMLTreeViewer.cpp b/Source/WebCore/xml/XMLTreeViewer.cpp
index a2110db..874a8cf 100644
--- a/Source/WebCore/xml/XMLTreeViewer.cpp
+++ b/Source/WebCore/xml/XMLTreeViewer.cpp
@@ -70,6 +70,12 @@ bool XMLTreeViewer::hasNoStyleInformation() const
void XMLTreeViewer::transformDocumentToTreeView()
{
+ // FIXME: Temporary hack to ensure that we still display some of the document (and don't crash)
+ // when script is disabled. See https://bugs.webkit.org/show_bug.cgi?id=59113 for work on a
+ // better solution.
+ if (!m_document->frame()->script()->canExecuteScripts(NotAboutToExecuteScript))
+ return;
+
String scriptString(reinterpret_cast<const char*>(XMLViewer_js), sizeof(XMLViewer_js));
m_document->frame()->script()->evaluate(ScriptSourceCode(scriptString));
String noStyleMessage("This XML file does not appear to have any style information associated with it. The document tree is shown below.");