Skip to content

Commit 1f91fee

Browse files
committed
2011-04-22 Nate Chapin <japhet@chromium.org>
Reviewed by Adam Barth. Don't use XMLTreeViewer when script is disabled (it uses Javascript to build a prettified version of the xml document). https://bugs.webkit.org/show_bug.cgi?id=59113 * xml/XMLTreeViewer.cpp: (WebCore::XMLTreeViewer::transformDocumentToTreeView): Canonical link: https://commits.webkit.org/74461@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 5d396f8 commit 1f91fee

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

Source/WebCore/ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2011-04-22 Nate Chapin <japhet@chromium.org>
2+
3+
Reviewed by Adam Barth.
4+
5+
Don't use XMLTreeViewer when script is disabled (it uses Javascript
6+
to build a prettified version of the xml document).
7+
https://bugs.webkit.org/show_bug.cgi?id=59113
8+
9+
* xml/XMLTreeViewer.cpp:
10+
(WebCore::XMLTreeViewer::transformDocumentToTreeView):
11+
112
2011-04-22 Sheriff Bot <webkit.review.bot@gmail.com>
213

314
Unreviewed, rolling out r84725 and r84728.

Source/WebCore/xml/XMLTreeViewer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ bool XMLTreeViewer::hasNoStyleInformation() const
6969

7070
void XMLTreeViewer::transformDocumentToTreeView()
7171
{
72+
// FIXME: Temporary hack to ensure that we still display some of the document (and don't crash)
73+
// when script is disabled. See https://bugs.webkit.org/show_bug.cgi?id=59113 for work on a
74+
// better solution.
75+
if (!m_document->frame()->script()->canExecuteScripts(NotAboutToExecuteScript))
76+
return;
77+
7278
String scriptString(reinterpret_cast<const char*>(XMLViewer_js), sizeof(XMLViewer_js));
7379
m_document->frame()->script()->evaluate(ScriptSourceCode(scriptString));
7480
String noStyleMessage("This XML file does not appear to have any style information associated with it. The document tree is shown below.");

0 commit comments

Comments
 (0)