Bug 428653: 'view MathML source' broken due to bug 397791, r=mano, sr=jst, a=beltzner

This commit is contained in:
gavin@gavinsharp.com 2008-04-22 13:50:08 -07:00
Родитель e981b2a90d
Коммит 553822a783
4 изменённых файлов: 105 добавлений и 2 удалений

Просмотреть файл

@ -43,5 +43,8 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
ifdef ENABLE_TESTS
DIRS = test
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -367,7 +367,7 @@ function viewPartialSourceForFragment(node, context)
; // end
// display
var doc = getBrowser().contentDocument;
var doc = getBrowser().contentDocument.wrappedJSObject;
doc.open("text/html", "replace");
doc.write(source);
doc.close();

Просмотреть файл

@ -0,0 +1,53 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = toolkit/components/viewsource/test
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
_CHROME_FILES = \
test_428653.xul \
$(NULL)
libs:: $(_CHROME_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)

Просмотреть файл

@ -0,0 +1,47 @@
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet
href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
<window title="View Source Test (bug 428653)"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<html:body/>
<browser id="content" type="content-primary" name="content" src="about:blank" flex="1"
disablehistory="true" context="viewSourceContextMenu"/>
<script type="application/javascript">
<![CDATA[
/*
Test that we can call the content browser's document.open() via
wrappedJSObject (SafeJSObjectWrapper).
https://bugzilla.mozilla.org/show_bug.cgi?id=428653
*/
SimpleTest.waitForExplicitFinish();
addLoadEvent(function testDocumentOpen() {
var browser = document.getElementById("content");
ok(browser, "got browser");
var doc = browser.contentDocument.wrappedJSObject;
ok(doc, "got content document");
doc.open("text/html", "replace");
var headingText = "This is a heading";
doc.write("<h1 id='heading'>" + headingText + "</h1>");
doc.close();
ok(doc.getElementById("heading").textContent, headingText,
"content document has content");
SimpleTest.finish();
});
]]>
</script>
</window>