mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 9fde2bdd93ef
This commit is contained in:
parent
d8485a11a8
commit
29475226ef
@ -77,28 +77,25 @@ interface nsIDocumentEncoder : nsISupports
|
||||
* Implies wrap (except inside <pre>), since html wraps.
|
||||
* HTML output: always do prettyprinting, ignoring existing formatting.
|
||||
* (Probably not well tested for HTML output.)
|
||||
* XML output: unsupported
|
||||
*/
|
||||
const unsigned long OutputFormatted = (1 << 1);
|
||||
|
||||
/** Don't do prettyprinting of HTML. Don't do any wrapping that's not in
|
||||
* the existing HTML source. This option overrides OutputFormatted if both
|
||||
* are set.
|
||||
* Plaintext and HTML output only.
|
||||
* @note This option does not affect entity conversion.
|
||||
*/
|
||||
const unsigned long OutputRaw = (1 << 2);
|
||||
|
||||
/**
|
||||
* Do not print html head tags.
|
||||
* HTML output only.
|
||||
*/
|
||||
const unsigned long OutputBodyOnly = (1 << 3);
|
||||
|
||||
/**
|
||||
* Wrap even if we're not doing formatted output (e.g. for text fields).
|
||||
* Plaintext output only.
|
||||
* XXXbz How does this interact with
|
||||
* Wrap even if we're not doing formatted output (e.g. for text fields)
|
||||
* XXXbz this doesn't seem to be used by all serializers... document? How
|
||||
* does this interact with
|
||||
* OutputFormatted/OutputRaw/OutputWrap/OutputFormatFlowed?
|
||||
*/
|
||||
const unsigned long OutputPreformatted = (1 << 4);
|
||||
@ -106,8 +103,8 @@ interface nsIDocumentEncoder : nsISupports
|
||||
/**
|
||||
* Output as though the content is preformatted
|
||||
* (e.g. maybe it's wrapped in a PRE or PRE_WRAP style tag)
|
||||
* Plaintext output only.
|
||||
* XXXbz How does this interact with
|
||||
* XXXbz this doesn't seem to be used by all serializers... document? How
|
||||
* does this interact with
|
||||
* OutputFormatted/OutputRaw/OutputPreformatted/OutputFormatFlowed?
|
||||
*/
|
||||
const unsigned long OutputWrap = (1 << 5);
|
||||
@ -117,15 +114,14 @@ interface nsIDocumentEncoder : nsISupports
|
||||
* to text for mail sending. This differs just slightly
|
||||
* but in an important way from normal formatted, and that is that
|
||||
* lines are space stuffed. This can't (correctly) be done later.
|
||||
* PlainText output only.
|
||||
* XXXbz How does this interact with
|
||||
* XXXbz this doesn't seem to be used by all serializers... document? How
|
||||
* does this interact with
|
||||
* OutputFormatted/OutputRaw/OutputPreformatted/OutputWrap?
|
||||
*/
|
||||
const unsigned long OutputFormatFlowed = (1 << 6);
|
||||
|
||||
/**
|
||||
* Convert links, image src, and script src to absolute URLs when possible.
|
||||
* HTML output only.
|
||||
* Convert links, image src, and script src to absolute URLs when possible
|
||||
*/
|
||||
const unsigned long OutputAbsoluteLinks = (1 << 7);
|
||||
|
||||
@ -134,7 +130,6 @@ interface nsIDocumentEncoder : nsISupports
|
||||
* This is a catch-all flag for documents with mixed contents. Beware of
|
||||
* interoperability issues. See below for other flags which might likely
|
||||
* do what you want.
|
||||
* HTML output only.
|
||||
*/
|
||||
const unsigned long OutputEncodeW3CEntities = (1 << 8);
|
||||
|
||||
@ -168,7 +163,7 @@ interface nsIDocumentEncoder : nsISupports
|
||||
|
||||
/**
|
||||
* Don't allow any formatting nodes (e.g. <br>, <b>) inside a <pre>.
|
||||
* This is used primarily by mail. HTML output only.
|
||||
* This is used primarily by mail.
|
||||
*/
|
||||
const unsigned long OutputNoFormattingInPre = (1 << 13);
|
||||
|
||||
@ -177,7 +172,6 @@ interface nsIDocumentEncoder : nsISupports
|
||||
* E.g. If set, we'll output if clear, we'll output 0xa0.
|
||||
* The basic set is just & < > " for interoperability
|
||||
* with older products that don't support α and friends.
|
||||
* HTML output only.
|
||||
*/
|
||||
const unsigned long OutputEncodeBasicEntities = (1 << 14);
|
||||
|
||||
@ -185,7 +179,6 @@ interface nsIDocumentEncoder : nsISupports
|
||||
* Encode entities when outputting to a string.
|
||||
* The Latin1 entity set additionally includes 8bit accented letters
|
||||
* between 128 and 255.
|
||||
* HTML output only.
|
||||
*/
|
||||
const unsigned long OutputEncodeLatin1Entities = (1 << 15);
|
||||
|
||||
@ -193,7 +186,6 @@ interface nsIDocumentEncoder : nsISupports
|
||||
* Encode entities when outputting to a string.
|
||||
* The HTML entity set additionally includes accented letters, greek
|
||||
* letters, and other special markup symbols as defined in HTML4.
|
||||
* HTML output only.
|
||||
*/
|
||||
const unsigned long OutputEncodeHTMLEntities = (1 << 16);
|
||||
|
||||
@ -201,7 +193,6 @@ interface nsIDocumentEncoder : nsISupports
|
||||
* Normally is replaced with a space character when
|
||||
* encoding data as plain text, set this flag if that's
|
||||
* not desired.
|
||||
* Plaintext output only.
|
||||
*/
|
||||
const unsigned long OutputPersistNBSP = (1 << 17);
|
||||
|
||||
|
@ -22,7 +22,6 @@
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ryan Jones <sciguyryan@gmail.com>
|
||||
* Laurent Jouanneau <laurent.jouanneau@disruptive-innovations.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
@ -68,7 +67,6 @@
|
||||
#include "nsLWBrkCIID.h"
|
||||
#include "nsIScriptElement.h"
|
||||
#include "nsAttrName.h"
|
||||
#include "nsILineBreaker.h"
|
||||
|
||||
#define kIndentStr NS_LITERAL_STRING(" ")
|
||||
#define kLessThan NS_LITERAL_STRING("<")
|
||||
@ -91,11 +89,13 @@ nsresult NS_NewHTMLContentSerializer(nsIContentSerializer** aSerializer)
|
||||
|
||||
nsHTMLContentSerializer::nsHTMLContentSerializer()
|
||||
: mIndent(0),
|
||||
mInBody(0),
|
||||
mColPos(0),
|
||||
mInBody(PR_FALSE),
|
||||
mAddSpace(PR_FALSE),
|
||||
mMayIgnoreLineBreakSequence(PR_FALSE),
|
||||
mIsWholeDocument(PR_FALSE),
|
||||
mInCDATA(PR_FALSE)
|
||||
mInCDATA(PR_FALSE),
|
||||
mNeedLineBreaker(PR_TRUE)
|
||||
{
|
||||
}
|
||||
|
||||
@ -116,10 +116,7 @@ nsHTMLContentSerializer::Init(PRUint32 aFlags, PRUint32 aWrapColumn,
|
||||
const char* aCharSet, PRBool aIsCopying,
|
||||
PRBool aIsWholeDocument)
|
||||
{
|
||||
nsresult rv;
|
||||
rv = nsXMLContentSerializer::Init(aFlags, aWrapColumn, aCharSet, aIsCopying, aIsWholeDocument);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mFlags = aFlags;
|
||||
if (!aWrapColumn) {
|
||||
mMaxColumn = 72;
|
||||
}
|
||||
@ -134,9 +131,25 @@ nsHTMLContentSerializer::Init(PRUint32 aFlags, PRUint32 aWrapColumn,
|
||||
: PR_FALSE;
|
||||
mBodyOnly = (mFlags & nsIDocumentEncoder::OutputBodyOnly) ? PR_TRUE
|
||||
: PR_FALSE;
|
||||
// Set the line break character:
|
||||
if ((mFlags & nsIDocumentEncoder::OutputCRLineBreak)
|
||||
&& (mFlags & nsIDocumentEncoder::OutputLFLineBreak)) { // Windows
|
||||
mLineBreak.AssignLiteral("\r\n");
|
||||
}
|
||||
else if (mFlags & nsIDocumentEncoder::OutputCRLineBreak) { // Mac
|
||||
mLineBreak.AssignLiteral("\r");
|
||||
}
|
||||
else if (mFlags & nsIDocumentEncoder::OutputLFLineBreak) { // Unix/DOM
|
||||
mLineBreak.AssignLiteral("\n");
|
||||
}
|
||||
else {
|
||||
mLineBreak.AssignLiteral(NS_LINEBREAK); // Platform/default
|
||||
}
|
||||
|
||||
mPreLevel = 0;
|
||||
|
||||
mCharset = aCharSet;
|
||||
|
||||
// set up entity converter if we are going to need it
|
||||
if (mFlags & nsIDocumentEncoder::OutputEncodeW3CEntities) {
|
||||
mEntityConverter = do_CreateInstance(NS_ENTITYCONVERTER_CONTRACTID);
|
||||
@ -153,6 +166,14 @@ nsHTMLContentSerializer::AppendText(nsIDOMText* aText,
|
||||
{
|
||||
NS_ENSURE_ARG(aText);
|
||||
|
||||
if (mNeedLineBreaker) {
|
||||
mNeedLineBreaker = PR_FALSE;
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> domDoc;
|
||||
aText->GetOwnerDocument(getter_AddRefs(domDoc));
|
||||
nsCOMPtr<nsIDocument> document = do_QueryInterface(domDoc);
|
||||
}
|
||||
|
||||
nsAutoString data;
|
||||
|
||||
nsresult rv;
|
||||
@ -637,7 +658,7 @@ nsHTMLContentSerializer::AppendElementStart(nsIDOMElement *aElement,
|
||||
}
|
||||
|
||||
if (name == nsGkAtoms::body) {
|
||||
++mInBody;
|
||||
mInBody = PR_TRUE;
|
||||
}
|
||||
|
||||
if (LineBreakBeforeOpen(name, hasDirtyAttr)) {
|
||||
@ -837,10 +858,6 @@ nsHTMLContentSerializer::AppendElementEnd(nsIDOMElement *aElement,
|
||||
MaybeFlagNewline(aElement);
|
||||
}
|
||||
|
||||
if (name == nsGkAtoms::body) {
|
||||
--mInBody;
|
||||
}
|
||||
|
||||
mInCDATA = PR_FALSE;
|
||||
|
||||
return NS_OK;
|
||||
@ -1019,6 +1036,31 @@ nsHTMLContentSerializer::AppendToString(const nsAString& aStr,
|
||||
aOutputStr.Append(aStr);
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLContentSerializer::AppendToStringConvertLF(const nsAString& aStr,
|
||||
nsAString& aOutputStr)
|
||||
{
|
||||
// Convert line-endings to mLineBreak
|
||||
PRUint32 start = 0;
|
||||
PRUint32 theLen = aStr.Length();
|
||||
while (start < theLen) {
|
||||
PRInt32 eol = aStr.FindChar('\n', start);
|
||||
if (eol == kNotFound) {
|
||||
nsDependentSubstring dataSubstring(aStr, start, theLen - start);
|
||||
AppendToString(dataSubstring, aOutputStr);
|
||||
start = theLen;
|
||||
}
|
||||
else {
|
||||
nsDependentSubstring dataSubstring(aStr, start, eol - start);
|
||||
AppendToString(dataSubstring, aOutputStr);
|
||||
AppendToString(mLineBreak, aOutputStr);
|
||||
start = eol + 1;
|
||||
if (start == theLen)
|
||||
mColPos = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsHTMLContentSerializer::LineBreakBeforeOpen(nsIAtom* aName,
|
||||
PRBool aHasDirtyAttr)
|
||||
|
@ -20,7 +20,6 @@
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Laurent Jouanneau <laurent.jouanneau@disruptive-innovations.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
@ -48,6 +47,7 @@
|
||||
#include "nsXMLContentSerializer.h"
|
||||
#include "nsIEntityConverter.h"
|
||||
#include "nsString.h"
|
||||
#include "nsILineBreaker.h"
|
||||
|
||||
class nsIContent;
|
||||
class nsIAtom;
|
||||
@ -101,7 +101,8 @@ class nsHTMLContentSerializer : public nsXMLContentSerializer {
|
||||
nsAString& aOutputStr,
|
||||
PRBool aTranslateEntities = PR_FALSE,
|
||||
PRBool aIncrColumn = PR_TRUE);
|
||||
|
||||
virtual void AppendToStringConvertLF(const nsAString& aStr,
|
||||
nsAString& aOutputStr);
|
||||
void AppendWrapped_WhitespaceSequence(
|
||||
nsASingleFragmentString::const_char_iterator &aPos,
|
||||
const nsASingleFragmentString::const_char_iterator aEnd,
|
||||
@ -124,8 +125,9 @@ class nsHTMLContentSerializer : public nsXMLContentSerializer {
|
||||
nsCOMPtr<nsIEntityConverter> mEntityConverter;
|
||||
|
||||
PRInt32 mIndent;
|
||||
|
||||
PRUint32 mInBody;
|
||||
PRInt32 mColPos;
|
||||
PRUint32 mFlags;
|
||||
PRPackedBool mInBody;
|
||||
|
||||
PRPackedBool mDoFormat;
|
||||
PRPackedBool mDoHeader;
|
||||
@ -156,8 +158,12 @@ class nsHTMLContentSerializer : public nsXMLContentSerializer {
|
||||
* what so ever.
|
||||
*/
|
||||
PRPackedBool mInCDATA;
|
||||
PRPackedBool mNeedLineBreaker;
|
||||
|
||||
nsCOMPtr<nsILineBreaker> mLineBreaker;
|
||||
|
||||
PRInt32 mMaxColumn;
|
||||
nsString mLineBreak;
|
||||
|
||||
// To keep track of startvalue of OL and first list item for nested lists
|
||||
struct olState {
|
||||
|
@ -20,7 +20,6 @@
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Laurent Jouanneau <laurent.jouanneau@disruptive-innovations.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
@ -54,7 +53,6 @@
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDocumentEncoder.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsTextFragment.h"
|
||||
#include "nsString.h"
|
||||
@ -82,7 +80,6 @@ nsresult NS_NewXMLContentSerializer(nsIContentSerializer** aSerializer)
|
||||
|
||||
nsXMLContentSerializer::nsXMLContentSerializer()
|
||||
: mPrefixIndex(0),
|
||||
mColPos(0),
|
||||
mInAttribute(PR_FALSE),
|
||||
mAddNewline(PR_FALSE)
|
||||
{
|
||||
@ -95,27 +92,11 @@ nsXMLContentSerializer::~nsXMLContentSerializer()
|
||||
NS_IMPL_ISUPPORTS1(nsXMLContentSerializer, nsIContentSerializer)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXMLContentSerializer::Init(PRUint32 aFlags, PRUint32 aWrapColumn,
|
||||
nsXMLContentSerializer::Init(PRUint32 flags, PRUint32 aWrapColumn,
|
||||
const char* aCharSet, PRBool aIsCopying,
|
||||
PRBool aIsWholeDocument)
|
||||
{
|
||||
mCharset = aCharSet;
|
||||
mFlags = aFlags;
|
||||
|
||||
// Set the line break character:
|
||||
if ((mFlags & nsIDocumentEncoder::OutputCRLineBreak)
|
||||
&& (mFlags & nsIDocumentEncoder::OutputLFLineBreak)) { // Windows
|
||||
mLineBreak.AssignLiteral("\r\n");
|
||||
}
|
||||
else if (mFlags & nsIDocumentEncoder::OutputCRLineBreak) { // Mac
|
||||
mLineBreak.AssignLiteral("\r");
|
||||
}
|
||||
else if (mFlags & nsIDocumentEncoder::OutputLFLineBreak) { // Unix/DOM
|
||||
mLineBreak.AssignLiteral("\n");
|
||||
}
|
||||
else {
|
||||
mLineBreak.AssignLiteral(NS_LINEBREAK); // Platform/default
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -142,6 +123,7 @@ nsXMLContentSerializer::AppendTextData(nsIDOMNode* aNode,
|
||||
if (length <= 0) {
|
||||
// XXX Zero is a legal value, maybe non-zero values should be an
|
||||
// error.
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -166,16 +148,7 @@ nsXMLContentSerializer::AppendText(nsIDOMText* aText,
|
||||
{
|
||||
NS_ENSURE_ARG(aText);
|
||||
|
||||
nsAutoString data;
|
||||
nsresult rv;
|
||||
|
||||
rv = AppendTextData(aText, aStartOffset, aEndOffset, data, PR_TRUE, PR_TRUE);
|
||||
if (NS_FAILED(rv))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
AppendToStringConvertLF(data, aStr);
|
||||
|
||||
return NS_OK;
|
||||
return AppendTextData(aText, aStartOffset, aEndOffset, aStr, PR_TRUE, PR_TRUE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -217,7 +190,7 @@ nsXMLContentSerializer::AppendProcessingInstruction(nsIDOMProcessingInstruction*
|
||||
AppendToString(target, aStr);
|
||||
if (!data.IsEmpty()) {
|
||||
AppendToString(NS_LITERAL_STRING(" "), aStr);
|
||||
AppendToStringConvertLF(data, aStr);
|
||||
AppendToString(data, aStr);
|
||||
}
|
||||
AppendToString(NS_LITERAL_STRING("?>"), aStr);
|
||||
MaybeFlagNewline(aPI);
|
||||
@ -247,10 +220,10 @@ nsXMLContentSerializer::AppendComment(nsIDOMComment* aComment,
|
||||
|
||||
nsAutoString frag;
|
||||
data.Mid(frag, aStartOffset, length);
|
||||
AppendToStringConvertLF(frag, aStr);
|
||||
AppendToString(frag, aStr);
|
||||
}
|
||||
else {
|
||||
AppendToStringConvertLF(data, aStr);
|
||||
AppendToString(data, aStr);
|
||||
}
|
||||
AppendToString(NS_LITERAL_STRING("-->"), aStr);
|
||||
MaybeFlagNewline(aComment);
|
||||
@ -992,7 +965,7 @@ void
|
||||
nsXMLContentSerializer::MaybeAddNewline(nsAString& aStr)
|
||||
{
|
||||
if (mAddNewline) {
|
||||
aStr.Append(mLineBreak);
|
||||
aStr.Append((PRUnichar)'\n');
|
||||
mAddNewline = PR_FALSE;
|
||||
}
|
||||
}
|
||||
@ -1051,28 +1024,3 @@ nsXMLContentSerializer::AppendDocumentStart(nsIDOMDocument *aDocument,
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsXMLContentSerializer::AppendToStringConvertLF(const nsAString& aStr,
|
||||
nsAString& aOutputStr)
|
||||
{
|
||||
// Convert line-endings to mLineBreak
|
||||
PRUint32 start = 0;
|
||||
PRUint32 theLen = aStr.Length();
|
||||
while (start < theLen) {
|
||||
PRInt32 eol = aStr.FindChar('\n', start);
|
||||
if (eol == kNotFound) {
|
||||
nsDependentSubstring dataSubstring(aStr, start, theLen - start);
|
||||
AppendToString(dataSubstring, aOutputStr);
|
||||
start = theLen;
|
||||
}
|
||||
else {
|
||||
nsDependentSubstring dataSubstring(aStr, start, eol - start);
|
||||
AppendToString(dataSubstring, aOutputStr);
|
||||
AppendToString(mLineBreak, aOutputStr);
|
||||
start = eol + 1;
|
||||
if (start == theLen)
|
||||
mColPos = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -147,9 +147,6 @@ class nsXMLContentSerializer : public nsIContentSerializer {
|
||||
PRBool IsShorthandAttr(const nsIAtom* aAttrName,
|
||||
const nsIAtom* aElementName);
|
||||
|
||||
virtual void AppendToStringConvertLF(const nsAString& aStr,
|
||||
nsAString& aOutputStr);
|
||||
|
||||
// Functions to check for newlines that needs to be added between nodes in
|
||||
// the root of a document.
|
||||
void MaybeAddNewline(nsAString& aStr);
|
||||
@ -158,18 +155,9 @@ class nsXMLContentSerializer : public nsIContentSerializer {
|
||||
PRInt32 mPrefixIndex;
|
||||
nsVoidArray mNameSpaceStack;
|
||||
|
||||
// nsIDocumentEncoder flags
|
||||
PRUint32 mFlags;
|
||||
|
||||
// characters to use for line break
|
||||
nsString mLineBreak;
|
||||
|
||||
// The charset that was passed to Init()
|
||||
nsCString mCharset;
|
||||
|
||||
// current column position
|
||||
PRInt32 mColPos;
|
||||
|
||||
PRPackedBool mInAttribute;
|
||||
PRPackedBool mAddNewline;
|
||||
};
|
||||
|
@ -47,8 +47,6 @@ DIRS += \
|
||||
chrome \
|
||||
$(NULL)
|
||||
|
||||
MODULE = content
|
||||
|
||||
CPP_UNIT_TESTS += TestNativeXMLHttpRequest.cpp TestPlainTextSerializer.cpp
|
||||
|
||||
LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/tests
|
||||
@ -74,10 +72,6 @@ LIBS += \
|
||||
$(NSPR_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
XPCSHELL_TESTS = \
|
||||
unit \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_TEST_FILES = test_bug5141.html \
|
||||
@ -173,25 +167,6 @@ _TEST_FILES = test_bug5141.html \
|
||||
test_bug420700.html \
|
||||
test_bug421602.html \
|
||||
test_bug422537.html \
|
||||
test_bug424359-1.html \
|
||||
file_htmlserializer_1.html \
|
||||
file_htmlserializer_1_bodyonly.html \
|
||||
file_htmlserializer_1_format.html \
|
||||
file_htmlserializer_1_linebreak.html \
|
||||
file_htmlserializer_1_links.html \
|
||||
file_htmlserializer_1_noflag.html \
|
||||
file_htmlserializer_1_noformatpre.html \
|
||||
file_htmlserializer_1_raw.html \
|
||||
file_htmlserializer_1_nested_body.html \
|
||||
file_htmlserializer_1_sibling_body.html \
|
||||
file_htmlserializer_1_sibling_body_only_body.html \
|
||||
file_htmlserializer_1_no_body.html \
|
||||
test_bug424359-2.html \
|
||||
file_htmlserializer_2.html \
|
||||
file_htmlserializer_2_basic.html \
|
||||
file_htmlserializer_2_enthtml.html \
|
||||
file_htmlserializer_2_entw3c.html \
|
||||
file_htmlserializer_2_latin1.html \
|
||||
test_bug424212.html \
|
||||
test_bug425013.html \
|
||||
bug426308-redirect.sjs \
|
||||
|
@ -1,43 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>Test for html serializer</title>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>Hello world</p> <p>
|
||||
|
||||
Lorem ipsum dolor sit amet, <strong>consectetuer</strong> adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
|
||||
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
|
||||
nostra, per inceptos hymenaeos. </p>
|
||||
|
||||
|
||||
<ul><li>Nam tellus massa,éàèçù</li><li>
|
||||
fringilla
|
||||
aliquam,</li><li> fermentum sit amet,</li><li>posuere ac,</li><li> est.</li></ul>
|
||||
<div> Duis tristique egestas ligula. Mauris quis felis. </div>
|
||||
<script type="text/javascript">
|
||||
// a script which does nothing
|
||||
|
||||
function nothing() {
|
||||
var hey="hello";
|
||||
var aLongLine="consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere";
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<ol><li>Fusce
|
||||
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
|
||||
Donec sollicitudin tortor
|
||||
<!-- test on
|
||||
comments -->
|
||||
<pre>lacinia <em>libero</em> ullamcorper laoreet.<br>
|
||||
Cras quis<br>
|
||||
nisi at odio<br>
|
||||
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum, <br>
|
||||
lacus risus pulvinar ante.
|
||||
</pre>
|
||||
ut gravida eros leo ut libero
|
||||
</body>
|
||||
</html>
|
@ -1,38 +0,0 @@
|
||||
|
||||
<body>
|
||||
<p>Hello world</p> <p>
|
||||
|
||||
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
|
||||
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
|
||||
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
|
||||
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
|
||||
nostra, per inceptos hymenaeos. </p>
|
||||
|
||||
|
||||
<ul><li>Nam tellus massa,éàèçù</li><li>
|
||||
fringilla
|
||||
aliquam,</li><li> fermentum sit amet,</li><li>posuere ac,</li><li> est.</li></ul>
|
||||
<div> Duis tristique egestas ligula. Mauris quis felis. </div>
|
||||
<script type="text/javascript">
|
||||
// a script which does nothing
|
||||
|
||||
function nothing() {
|
||||
var hey="hello";
|
||||
var aLongLine="consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere";
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<ol><li>Fusce
|
||||
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
|
||||
Donec sollicitudin tortor
|
||||
<!-- test on
|
||||
comments -->
|
||||
<pre>lacinia <em>libero</em> ullamcorper laoreet.<br>
|
||||
Cras quis<br>
|
||||
nisi at odio<br>
|
||||
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum, <br>
|
||||
lacus risus pulvinar ante.
|
||||
</pre>
|
||||
ut gravida eros leo ut libero
|
||||
</body>
|
@ -1,47 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>Test for html serializer</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Hello world</p>
|
||||
<p> Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
|
||||
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
|
||||
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
|
||||
ad litora</span> torquent <a href="file_htmlserializer_1_result1.html">per
|
||||
conubia</a> nostra, per inceptos hymenaeos. </p>
|
||||
<ul>
|
||||
<li>Nam tellus massa,éàèçù</li>
|
||||
<li> fringilla aliquam,</li>
|
||||
<li> fermentum sit amet,</li>
|
||||
<li>posuere ac,</li>
|
||||
<li> est.</li>
|
||||
</ul>
|
||||
<div> Duis tristique egestas ligula. Mauris quis felis. </div>
|
||||
<script type="text/javascript">
|
||||
// a script which does nothing
|
||||
|
||||
function nothing() {
|
||||
var hey="hello";
|
||||
var aLongLine="consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere";
|
||||
}
|
||||
|
||||
</script>
|
||||
<ol>
|
||||
<li>Fusce a ipsum</li>
|
||||
<li> non lacus posuere aliquet.</li>
|
||||
<li> Sed fermentum posuere nulla</li>
|
||||
<li> Donec tempor.</li>
|
||||
</ol>
|
||||
Donec sollicitudin tortor<!-- test on
|
||||
comments -->
|
||||
<pre>lacinia <em>libero</em> ullamcorper laoreet.<br>
|
||||
Cras quis<br>
|
||||
nisi at odio<br>
|
||||
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum, <br>
|
||||
lacus risus pulvinar ante.
|
||||
</pre>
|
||||
ut gravida eros leo ut libero
|
||||
</body>
|
||||
</html>
|
@ -1,44 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>Test for html serializer</title>
|
||||
|
||||
</head><body>
|
||||
<p>Hello world</p> <p>
|
||||
|
||||
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
|
||||
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
|
||||
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
|
||||
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
|
||||
nostra, per inceptos hymenaeos. </p>
|
||||
|
||||
|
||||
<ul><li>Nam tellus massa,éàèçù</li><li>
|
||||
fringilla
|
||||
aliquam,</li><li> fermentum sit amet,</li><li>posuere ac,</li><li> est.</li></ul>
|
||||
<div> Duis tristique egestas ligula. Mauris quis felis. </div>
|
||||
<script type="text/javascript">
|
||||
// a script which does nothing
|
||||
|
||||
function nothing() {
|
||||
var hey="hello";
|
||||
var aLongLine="consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere";
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<ol><li>Fusce
|
||||
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
|
||||
Donec sollicitudin tortor
|
||||
<!-- test on
|
||||
comments -->
|
||||
<pre>lacinia <em>libero</em> ullamcorper laoreet.<br>
|
||||
Cras quis<br>
|
||||
nisi at odio<br>
|
||||
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum, <br>
|
||||
lacus risus pulvinar ante.
|
||||
</pre>
|
||||
ut gravida eros leo ut libero
|
||||
</body></html>
|
@ -1,44 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>Test for html serializer</title>
|
||||
|
||||
</head><body>
|
||||
<p>Hello world</p> <p>
|
||||
|
||||
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
|
||||
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
|
||||
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
|
||||
litora</span> torquent <a href="http://localhost:8888/tests/content/base/test/file_htmlserializer_1_result1.html">per conubia</a>
|
||||
nostra, per inceptos hymenaeos. </p>
|
||||
|
||||
|
||||
<ul><li>Nam tellus massa,éàèçù</li><li>
|
||||
fringilla
|
||||
aliquam,</li><li> fermentum sit amet,</li><li>posuere ac,</li><li> est.</li></ul>
|
||||
<div> Duis tristique egestas ligula. Mauris quis felis. </div>
|
||||
<script type="text/javascript">
|
||||
// a script which does nothing
|
||||
|
||||
function nothing() {
|
||||
var hey="hello";
|
||||
var aLongLine="consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere";
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<ol><li>Fusce
|
||||
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
|
||||
Donec sollicitudin tortor
|
||||
<!-- test on
|
||||
comments -->
|
||||
<pre>lacinia <em>libero</em> ullamcorper laoreet.<br>
|
||||
Cras quis<br>
|
||||
nisi at odio<br>
|
||||
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum, <br>
|
||||
lacus risus pulvinar ante.
|
||||
</pre>
|
||||
ut gravida eros leo ut libero
|
||||
</body></html>
|
@ -1,44 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>Test for html serializer</title>
|
||||
|
||||
</head><body>
|
||||
<p>Hello world</p> <p>
|
||||
|
||||
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
|
||||
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
|
||||
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
|
||||
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
|
||||
nostra, per inceptos hymenaeos. </p>
|
||||
|
||||
|
||||
<ul><li>Nam tellus massa,éàèçù</li><li>
|
||||
fringilla
|
||||
aliquam,</li><li> fermentum sit amet,</li><li>posuere ac,</li><li> est.</li></ul>
|
||||
<div> Duis tristique egestas ligula. Mauris quis felis. </div>
|
||||
<script type="text/javascript">
|
||||
// a script which does nothing
|
||||
|
||||
function nothing() {
|
||||
var hey="hello";
|
||||
var aLongLine="consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere";
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<ol><li>Fusce
|
||||
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
|
||||
Donec sollicitudin tortor
|
||||
<!-- test on
|
||||
comments -->
|
||||
<pre>lacinia <em>libero</em> ullamcorper laoreet.<br>
|
||||
Cras quis<br>
|
||||
nisi at odio<br>
|
||||
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum, <br>
|
||||
lacus risus pulvinar ante.
|
||||
</pre>
|
||||
ut gravida eros leo ut libero
|
||||
<body><p>this is an other body element</p></body></body></html>
|
@ -1,8 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>Test for html serializer</title>
|
||||
|
||||
</head></html>
|
@ -1,44 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>Test for html serializer</title>
|
||||
|
||||
</head><body>
|
||||
<p>Hello world</p> <p>
|
||||
|
||||
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
|
||||
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
|
||||
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
|
||||
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
|
||||
nostra, per inceptos hymenaeos. </p>
|
||||
|
||||
|
||||
<ul><li>Nam tellus massa,éàèçù</li><li>
|
||||
fringilla
|
||||
aliquam,</li><li> fermentum sit amet,</li><li>posuere ac,</li><li> est.</li></ul>
|
||||
<div> Duis tristique egestas ligula. Mauris quis felis. </div>
|
||||
<script type="text/javascript">
|
||||
// a script which does nothing
|
||||
|
||||
function nothing() {
|
||||
var hey="hello";
|
||||
var aLongLine="consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere";
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<ol><li>Fusce
|
||||
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
|
||||
Donec sollicitudin tortor
|
||||
<!-- test on
|
||||
comments -->
|
||||
<pre>lacinia <em>libero</em> ullamcorper laoreet.<br>
|
||||
Cras quis<br>
|
||||
nisi at odio<br>
|
||||
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum, <br>
|
||||
lacus risus pulvinar ante.
|
||||
</pre>
|
||||
ut gravida eros leo ut libero
|
||||
</body></html>
|
@ -1,48 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>Test for html serializer</title>
|
||||
|
||||
</head><body>
|
||||
<p>Hello world</p> <p>
|
||||
|
||||
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
|
||||
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
|
||||
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
|
||||
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
|
||||
nostra, per inceptos hymenaeos. </p>
|
||||
|
||||
|
||||
<ul><li>Nam tellus massa,éàèçù</li><li>
|
||||
fringilla
|
||||
aliquam,</li><li> fermentum sit amet,</li><li>posuere ac,</li><li> est.</li></ul>
|
||||
<div> Duis tristique egestas ligula. Mauris quis felis. </div>
|
||||
<script type="text/javascript">
|
||||
// a script which does nothing
|
||||
|
||||
function nothing() {
|
||||
var hey="hello";
|
||||
var aLongLine="consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere";
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<ol><li>Fusce
|
||||
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
|
||||
Donec sollicitudin tortor
|
||||
<!-- test on
|
||||
comments -->
|
||||
<pre>lacinia <em>libero</em> ullamcorper laoreet.
|
||||
|
||||
Cras quis
|
||||
|
||||
nisi at odio
|
||||
|
||||
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
|
||||
|
||||
lacus risus pulvinar ante.
|
||||
</pre>
|
||||
ut gravida eros leo ut libero
|
||||
</body></html>
|
@ -1,42 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>Test for html serializer</title>
|
||||
|
||||
</head><body>
|
||||
<p>Hello world</p> <p>
|
||||
|
||||
Lorem ipsum dolor sit amet, <strong>consectetuer</strong> adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
|
||||
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
|
||||
nostra, per inceptos hymenaeos. </p>
|
||||
|
||||
|
||||
<ul><li>Nam tellus massa,éàèçù</li><li>
|
||||
fringilla
|
||||
aliquam,</li><li> fermentum sit amet,</li><li>posuere ac,</li><li> est.</li></ul>
|
||||
<div> Duis tristique egestas ligula. Mauris quis felis. </div>
|
||||
<script type="text/javascript">
|
||||
// a script which does nothing
|
||||
|
||||
function nothing() {
|
||||
var hey="hello";
|
||||
var aLongLine="consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere";
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<ol><li>Fusce
|
||||
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
|
||||
Donec sollicitudin tortor
|
||||
<!-- test on
|
||||
comments -->
|
||||
<pre>lacinia <em>libero</em> ullamcorper laoreet.<br>
|
||||
Cras quis<br>
|
||||
nisi at odio<br>
|
||||
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum, <br>
|
||||
lacus risus pulvinar ante.
|
||||
</pre>
|
||||
ut gravida eros leo ut libero
|
||||
</body></html>
|
@ -1,44 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>Test for html serializer</title>
|
||||
|
||||
</head><body><p>this is an other body element</p></body><body>
|
||||
<p>Hello world</p> <p>
|
||||
|
||||
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
|
||||
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
|
||||
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
|
||||
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
|
||||
nostra, per inceptos hymenaeos. </p>
|
||||
|
||||
|
||||
<ul><li>Nam tellus massa,éàèçù</li><li>
|
||||
fringilla
|
||||
aliquam,</li><li> fermentum sit amet,</li><li>posuere ac,</li><li> est.</li></ul>
|
||||
<div> Duis tristique egestas ligula. Mauris quis felis. </div>
|
||||
<script type="text/javascript">
|
||||
// a script which does nothing
|
||||
|
||||
function nothing() {
|
||||
var hey="hello";
|
||||
var aLongLine="consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere";
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<ol><li>Fusce
|
||||
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
|
||||
Donec sollicitudin tortor
|
||||
<!-- test on
|
||||
comments -->
|
||||
<pre>lacinia <em>libero</em> ullamcorper laoreet.<br>
|
||||
Cras quis<br>
|
||||
nisi at odio<br>
|
||||
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum, <br>
|
||||
lacus risus pulvinar ante.
|
||||
</pre>
|
||||
ut gravida eros leo ut libero
|
||||
</body></html>
|
@ -1,38 +0,0 @@
|
||||
|
||||
<body><p>this is an other body element</p></body><body>
|
||||
<p>Hello world</p> <p>
|
||||
|
||||
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
|
||||
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
|
||||
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
|
||||
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
|
||||
nostra, per inceptos hymenaeos. </p>
|
||||
|
||||
|
||||
<ul><li>Nam tellus massa,éàèçù</li><li>
|
||||
fringilla
|
||||
aliquam,</li><li> fermentum sit amet,</li><li>posuere ac,</li><li> est.</li></ul>
|
||||
<div> Duis tristique egestas ligula. Mauris quis felis. </div>
|
||||
<script type="text/javascript">
|
||||
// a script which does nothing
|
||||
|
||||
function nothing() {
|
||||
var hey="hello";
|
||||
var aLongLine="consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere";
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<ol><li>Fusce
|
||||
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
|
||||
Donec sollicitudin tortor
|
||||
<!-- test on
|
||||
comments -->
|
||||
<pre>lacinia <em>libero</em> ullamcorper laoreet.<br>
|
||||
Cras quis<br>
|
||||
nisi at odio<br>
|
||||
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum, <br>
|
||||
lacus risus pulvinar ante.
|
||||
</pre>
|
||||
ut gravida eros leo ut libero
|
||||
</body>
|
@ -1,29 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test for html serializer with entities</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>The basic set is just & < > " for interoperability with older products that don't support α and friends.</p>
|
||||
|
||||
<p>latin1 ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´
|
||||
µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ
|
||||
Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø
|
||||
Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê
|
||||
ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý
|
||||
þ ÿ </p>
|
||||
<p>symbols, math.. ƒ Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ
|
||||
Φ Χ Ψ Ω α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ ς
|
||||
σ τ υ φ χ ψ ω ϑ ϒ ϖ • … ′ ″ ‾ ⁄ ℘ ℑ ℜ
|
||||
™ ℵ ← ↑ → ↓ ↔ ↵ ⇐ ⇑ ⇒ ⇓ ⇔ ∀ ∂ ∃ ∅ ∇ ∈ ∉
|
||||
∋ ∏ ∑ − ∗ √ ∝ ∞ ∠ ∧ ∨ ∩ ∪ ∫ ∴ ∼ ≅ ≈ ≠ ≡ ≤ ≥
|
||||
⊂ ⊃ ⊄ ⊆ ⊇ ⊕ ⊗ ⊥ ⋅ ⌈ ⌉ ⌊ ⌋ ⟨ ⟩ ◊ ♠ ♣ ♥ ♦
|
||||
</p>
|
||||
<p> others
|
||||
Œ œ Š š Ÿ ˆ ˜       ‌ ‍ ‎ ‏–— ‘ ’
|
||||
‚“ ” „ † ‡ ‰ ‹ › €
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,29 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=">
|
||||
|
||||
|
||||
<title>Test for html serializer with entities</title>
|
||||
</head><body>
|
||||
|
||||
<p>The basic set is just & < > " for interoperability with older products that don't support α and friends.</p>
|
||||
|
||||
<p>latin1 ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ® ¯ ° ± ² ³ ´
|
||||
µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ
|
||||
Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø
|
||||
Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê
|
||||
ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý
|
||||
þ ÿ </p>
|
||||
<p>symbols, math.. ƒ Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ
|
||||
Φ Χ Ψ Ω α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ ς
|
||||
σ τ υ φ χ ψ ω ϑ ϒ ϖ • … ′ ″ ‾ ⁄ ℘ ℑ ℜ
|
||||
™ ℵ ← ↑ → ↓ ↔ ↵ ⇐ ⇑ ⇒ ⇓ ⇔ ∀ ∂ ∃ ∅ ∇ ∈ ∉
|
||||
∋ ∏ ∑ − ∗ √ ∝ ∞ ∠ ∧ ∨ ∩ ∪ ∫ ∴ ∼ ≅ ≈ ≠ ≡ ≤ ≥
|
||||
⊂ ⊃ ⊄ ⊆ ⊇ ⊕ ⊗ ⊥ ⋅ ⌈ ⌉ ⌊ ⌋ 〈 〉 ◊ ♠ ♣ ♥ ♦
|
||||
</p>
|
||||
<p> others
|
||||
Œ œ Š š Ÿ ˆ ˜ –— ‘ ’
|
||||
‚“ ” „ † ‡ ‰ ‹ › €
|
||||
</p>
|
||||
|
||||
</body></html>
|
@ -1,50 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=">
|
||||
|
||||
|
||||
<title>Test for html serializer with entities</title>
|
||||
</head><body>
|
||||
|
||||
<p>The basic set is just & < > " for interoperability with older products that don't support α and friends.</p>
|
||||
|
||||
<p>latin1 ¡ ¢ £ ¤ ¥ ¦ § ¨
|
||||
© ª « ¬ ­ ® ¯ ° ± ²
|
||||
³ ´ µ ¶ · ¸ ¹ º »
|
||||
¼ ½ ¾ ¿ À Á Â Ã
|
||||
Ä Å Æ
|
||||
Ç È É Ê Ë Ì Í Î
|
||||
Ï Ð Ñ Ò Ó Ô Õ Ö ×
|
||||
Ø
|
||||
Ù Ú Û Ü Ý Þ ß à
|
||||
á â ã ä å æ ç è
|
||||
é ê ë ì í î ï ð ñ
|
||||
ò ó ô õ ö ÷ ø ù
|
||||
ú û ü ý þ ÿ </p>
|
||||
<p>symbols, math.. ƒ Α Β Γ Δ Ε
|
||||
Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο
|
||||
Π Ρ Σ Τ Υ
|
||||
Φ Χ Ψ Ω α β γ δ ε
|
||||
ζ η θ ι κ λ μ ν ξ ο
|
||||
π ρ ς
|
||||
σ τ υ φ χ ψ ω ϑ ϒ
|
||||
ϖ • … ′ ″ ‾ ⁄ ℘ ℑ
|
||||
ℜ
|
||||
™ ℵ ← ↑ → ↓ ↔ ↵ ⇐
|
||||
⇑ ⇒ ⇓ ⇔ ∀ ∂ ∃ ∅ ∇
|
||||
∈ ∉
|
||||
∋ ∏ ∑ − ∗ √ ∝ ∞ ∠ ∧
|
||||
∨ ∩ ∪ ∫ ∴ ∼ ≅ ≈ ≠ ≡ ≤
|
||||
≥
|
||||
⊂ ⊃ ⊄ ⊆ ⊇ ⊕ ⊗ ⊥ ⋅ ⌈
|
||||
⌉ ⌊ ⌋ ⟨ ⟩ ◊ ♠ ♣ ♥
|
||||
♦
|
||||
</p>
|
||||
<p> others
|
||||
Œ œ Š š Ÿ ˆ ˜    
|
||||
  ‌ ‍ ‎ ‏–— ‘ ’
|
||||
‚“ ” „ † ‡ ‰ ‹
|
||||
› €
|
||||
</p>
|
||||
|
||||
</body></html>
|
@ -1,50 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=">
|
||||
|
||||
|
||||
<title>Test for html serializer with entities</title>
|
||||
</head><body>
|
||||
|
||||
<p>The basic set is just & < > " for interoperability with older products that don't support α and friends.</p>
|
||||
|
||||
<p>latin1 ¡ ¢ £ ¤ ¥ ¦ § ¨
|
||||
© ª « ¬ ­ ® ¯ ° ± ²
|
||||
³ ´ µ ¶ · ¸ ¹ º »
|
||||
¼ ½ ¾ ¿ À Á Â Ã
|
||||
Ä Å Æ
|
||||
Ç È É Ê Ë Ì Í Î
|
||||
Ï Ð Ñ Ò Ó Ô Õ Ö ×
|
||||
Ø
|
||||
Ù Ú Û Ü Ý Þ ß à
|
||||
á â ã ä å æ ç è
|
||||
é ê ë ì í î ï ð ñ
|
||||
ò ó ô õ ö ÷ ø ù
|
||||
ú û ü ý þ ÿ </p>
|
||||
<p>symbols, math.. ƒ Α Β Γ Δ Ε
|
||||
Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο
|
||||
Π Ρ Σ Τ Υ
|
||||
Φ Χ Ψ Ω α β γ δ ε
|
||||
ζ η θ ι κ λ μ ν ξ ο
|
||||
π ρ ς
|
||||
σ τ υ φ χ ψ ω ϑ ϒ
|
||||
ϖ • … ′ ″ ‾ ⁄ ℘ ℑ
|
||||
ℜ
|
||||
™ ℵ ← ↑ → ↓ ↔ ↵ ⇐
|
||||
⇑ ⇒ ⇓ ⇔ ∀ ∂ ∃ ∅ ∇
|
||||
∈ ∉
|
||||
∋ ∏ ∑ − ∗ √ ∝ ∞ ∠ ∧
|
||||
∨ ∩ ∪ ∫ ∴ ∼ ≅ ≈ ≠ ≡ ≤
|
||||
≥
|
||||
⊂ ⊃ ⊄ ⊆ ⊇ ⊕ ⊗ ⊥ ⋅ ⌈
|
||||
⌉ ⌊ ⌋ ⟨ ⟩ ◊ ♠ ♣ ♥
|
||||
♦
|
||||
</p>
|
||||
<p> others
|
||||
Œ œ Š š Ÿ ˆ ˜    
|
||||
  ‌ ‍ ‎ ‏–— ‘ ’
|
||||
‚“ ” „ † ‡ ‰ ‹
|
||||
› €
|
||||
</p>
|
||||
|
||||
</body></html>
|
@ -1,36 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=">
|
||||
|
||||
|
||||
<title>Test for html serializer with entities</title>
|
||||
</head><body>
|
||||
|
||||
<p>The basic set is just & < > " for interoperability with older products that don't support α and friends.</p>
|
||||
|
||||
<p>latin1 ¡ ¢ £ ¤ ¥ ¦ § ¨
|
||||
© ª « ¬ ­ ® ¯ ° ± ²
|
||||
³ ´ µ ¶ · ¸ ¹ º »
|
||||
¼ ½ ¾ ¿ À Á Â Ã
|
||||
Ä Å Æ
|
||||
Ç È É Ê Ë Ì Í Î
|
||||
Ï Ð Ñ Ò Ó Ô Õ Ö ×
|
||||
Ø
|
||||
Ù Ú Û Ü Ý Þ ß à
|
||||
á â ã ä å æ ç è
|
||||
é ê ë ì í î ï ð ñ
|
||||
ò ó ô õ ö ÷ ø ù
|
||||
ú û ü ý þ ÿ </p>
|
||||
<p>symbols, math.. ƒ Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ
|
||||
Φ Χ Ψ Ω α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ ς
|
||||
σ τ υ φ χ ψ ω ϑ ϒ ϖ • … ′ ″ ‾ ⁄ ℘ ℑ ℜ
|
||||
™ ℵ ← ↑ → ↓ ↔ ↵ ⇐ ⇑ ⇒ ⇓ ⇔ ∀ ∂ ∃ ∅ ∇ ∈ ∉
|
||||
∋ ∏ ∑ − ∗ √ ∝ ∞ ∠ ∧ ∨ ∩ ∪ ∫ ∴ ∼ ≅ ≈ ≠ ≡ ≤ ≥
|
||||
⊂ ⊃ ⊄ ⊆ ⊇ ⊕ ⊗ ⊥ ⋅ ⌈ ⌉ ⌊ ⌋ 〈 〉 ◊ ♠ ♣ ♥ ♦
|
||||
</p>
|
||||
<p> others
|
||||
Œ œ Š š Ÿ ˆ ˜ –— ‘ ’
|
||||
‚“ ” „ † ‡ ‰ ‹ › €
|
||||
</p>
|
||||
|
||||
</body></html>
|
@ -1,201 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
-->
|
||||
<head>
|
||||
<title>Test for HTML serializer</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=424359">Mozilla Bug </a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<iframe id="testframe" src="file_htmlserializer_1.html">
|
||||
</iframe>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
|
||||
function loadFileContent(aFile, aCharset) {
|
||||
//if(aAsIso == undefined) aAsIso = false;
|
||||
if(aCharset == undefined)
|
||||
aCharset = 'UTF-8';
|
||||
|
||||
var baseUri = Components.classes['@mozilla.org/network/standard-url;1']
|
||||
.createInstance(Components.interfaces.nsIURI);
|
||||
baseUri.spec = window.location.href;
|
||||
|
||||
var ios = Components.classes['@mozilla.org/network/io-service;1']
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var chann = ios.newChannel(aFile, aCharset, baseUri);
|
||||
|
||||
var cis = Components.interfaces.nsIConverterInputStream;
|
||||
|
||||
var inputStream = Components.classes["@mozilla.org/intl/converter-input-stream;1"]
|
||||
.createInstance(cis);
|
||||
inputStream.init(chann.open(), aCharset, 1024, cis.DEFAULT_REPLACEMENT_CHARACTER);
|
||||
var str = {}, content = '';
|
||||
while (inputStream.readString(4096, str) != 0) {
|
||||
content += str.value;
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
|
||||
function testHtmlSerializer_1 () {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
const de = Components.interfaces.nsIDocumentEncoder
|
||||
var encoder = Components.classes["@mozilla.org/layout/documentEncoder;1?type=text/html"]
|
||||
.createInstance(Components.interfaces.nsIDocumentEncoder);
|
||||
|
||||
var doc = $("testframe").contentDocument;
|
||||
var out, expected;
|
||||
|
||||
// in the following tests, we must use the OutputLFLineBreak flag, to avoid
|
||||
// to have the default line break of the platform in the result, so the test
|
||||
// can pass on all platform
|
||||
|
||||
//------------ no flags
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak);
|
||||
encoder.setCharset("UTF-8");
|
||||
out = encoder.encodeToString();
|
||||
expected = loadFileContent("file_htmlserializer_1_noflag.html");
|
||||
is(out, expected, "test no flags");
|
||||
|
||||
//------------- unsupported flags
|
||||
// since the following flags are not supported, we should
|
||||
// have a result like the one without flag
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak | de.OutputPreformatted);
|
||||
out = encoder.encodeToString();
|
||||
is(out, expected, "test OutputPreformatted");
|
||||
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak | de.OutputWrap);
|
||||
out = encoder.encodeToString();
|
||||
is(out, expected, "test OutputWrap");
|
||||
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak | de.OutputFormatFlowed);
|
||||
out = encoder.encodeToString();
|
||||
is(out, expected, "test OutputFormatFlowed");
|
||||
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak | de.OutputNoScriptContent);
|
||||
out = encoder.encodeToString();
|
||||
is(out, expected, "test OutputNoScriptContent");
|
||||
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak | de.OutputNoFramesContent);
|
||||
out = encoder.encodeToString();
|
||||
is(out, expected, "test OutputNoFramesContent");
|
||||
|
||||
|
||||
//------------ OutputFormatted
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak | de.OutputFormatted);
|
||||
out = encoder.encodeToString();
|
||||
expected = loadFileContent("file_htmlserializer_1_format.html");
|
||||
is(out, expected, "test OutputFormatted");
|
||||
|
||||
//------------ OutputRaw
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak | de.OutputRaw);
|
||||
out = encoder.encodeToString();
|
||||
expected = loadFileContent("file_htmlserializer_1_raw.html");
|
||||
is(out, expected, "test OutputRaw");
|
||||
|
||||
//------------ OutputBodyOnly
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak | de.OutputBodyOnly);
|
||||
out = encoder.encodeToString();
|
||||
expected = loadFileContent("file_htmlserializer_1_bodyonly.html");
|
||||
is(out, expected, "test OutputBodyOnly");
|
||||
|
||||
|
||||
|
||||
//------------ OutputAbsoluteLinks
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak | de.OutputAbsoluteLinks);
|
||||
out = encoder.encodeToString();
|
||||
expected = loadFileContent("file_htmlserializer_1_links.html");
|
||||
is(out, expected, "test OutputAbsoluteLinks");
|
||||
|
||||
//------------ OutputLFLineBreak
|
||||
encoder.init(doc, "text/html",de.OutputLFLineBreak);
|
||||
out = encoder.encodeToString();
|
||||
expected = loadFileContent("file_htmlserializer_1_linebreak.html");
|
||||
is(out, expected, "test OutputLFLineBreak");
|
||||
|
||||
//------------ OutputCRLineBreak
|
||||
encoder.init(doc, "text/html",de.OutputCRLineBreak);
|
||||
out = encoder.encodeToString();
|
||||
expected = expected.replace(/\n/mg, "\r");
|
||||
is(out, expected, "test OutputCRLineBreak");
|
||||
|
||||
//------------ OutputLFLineBreak + OutputCRLineBreak
|
||||
encoder.init(doc, "text/html",de.OutputLFLineBreak | de.OutputCRLineBreak);
|
||||
out = encoder.encodeToString();
|
||||
expected = expected.replace(/\r/mg, "\r\n");
|
||||
is(out, expected, "test OutputLFLineBreak + OutputCRLineBreak");
|
||||
|
||||
//------------ OutputNoFormattingInPre
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak | de.OutputNoFormattingInPre);
|
||||
out = encoder.encodeToString();
|
||||
expected = loadFileContent("file_htmlserializer_1_noformatpre.html");
|
||||
is(out, expected, "test OutputNoFormattingInPre");
|
||||
|
||||
// ------------- nested body elements
|
||||
var body2 = doc.createElement('body');
|
||||
var p = doc.createElement('p');
|
||||
p.appendChild(doc.createTextNode("this is an other body element"));
|
||||
body2.appendChild(p);
|
||||
var body = doc.getElementsByTagName('body')[0];
|
||||
body.appendChild(body2);
|
||||
|
||||
is(doc.getElementsByTagName('body').length, 2); // to be sure we have two body elements
|
||||
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak);
|
||||
encoder.setCharset("UTF-8");
|
||||
out = encoder.encodeToString();
|
||||
expected = loadFileContent("file_htmlserializer_1_nested_body.html");
|
||||
is(out, expected, "test with two nested body elements");
|
||||
|
||||
// ------------- two body elements
|
||||
body.parentNode.insertBefore(body2, body);
|
||||
|
||||
is(doc.getElementsByTagName('body').length, 2); // to be sure we have two body elements
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak);
|
||||
encoder.setCharset("UTF-8");
|
||||
out = encoder.encodeToString();
|
||||
expected = loadFileContent("file_htmlserializer_1_sibling_body.html");
|
||||
is(out, expected, "test with two body elements");
|
||||
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak | de.OutputBodyOnly);
|
||||
encoder.setCharset("UTF-8");
|
||||
out = encoder.encodeToString();
|
||||
expected = loadFileContent("file_htmlserializer_1_sibling_body_only_body.html");
|
||||
is(out, expected, "test with two body elements, and output body only");
|
||||
|
||||
// --------------- no body element
|
||||
doc.documentElement.removeChild(body);
|
||||
doc.documentElement.removeChild(body2);
|
||||
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak);
|
||||
encoder.setCharset("UTF-8");
|
||||
out = encoder.encodeToString();
|
||||
expected = loadFileContent("file_htmlserializer_1_no_body.html");
|
||||
is(out, expected, "test with no body element");
|
||||
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
addLoadEvent(testHtmlSerializer_1);
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
<!--<h1>1</h1><h2>result</h2><textarea id="t1" cols="80" rows="20"></textarea>
|
||||
<h2>expected</h2><textarea id="t1e" cols="80" rows="20"></textarea>-->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@ -1,96 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
-->
|
||||
<head>
|
||||
<title>Test HTML serializer with entities</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=424359">Mozilla Bug </a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<iframe id="testframe" src="file_htmlserializer_2.html">
|
||||
</iframe>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
|
||||
function loadFileContent(aFile, aCharset) {
|
||||
//if(aAsIso == undefined) aAsIso = false;
|
||||
if(aCharset == undefined)
|
||||
aCharset = 'UTF-8';
|
||||
|
||||
var baseUri = Components.classes['@mozilla.org/network/standard-url;1']
|
||||
.createInstance(Components.interfaces.nsIURI);
|
||||
baseUri.spec = window.location.href;
|
||||
|
||||
var ios = Components.classes['@mozilla.org/network/io-service;1']
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var chann = ios.newChannel(aFile, aCharset, baseUri);
|
||||
|
||||
var cis = Components.interfaces.nsIConverterInputStream;
|
||||
|
||||
var inputStream = Components.classes["@mozilla.org/intl/converter-input-stream;1"]
|
||||
.createInstance(cis);
|
||||
inputStream.init(chann.open(), aCharset, 1024, cis.DEFAULT_REPLACEMENT_CHARACTER);
|
||||
var str = {}, content = '';
|
||||
while (inputStream.readString(4096, str) != 0) {
|
||||
content += str.value;
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
|
||||
function testHtmlSerializer_1 () {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
const de = Components.interfaces.nsIDocumentEncoder
|
||||
var encoder = Components.classes["@mozilla.org/layout/documentEncoder;1?type=text/html"]
|
||||
.createInstance(Components.interfaces.nsIDocumentEncoder);
|
||||
|
||||
var doc = $("testframe").contentDocument;
|
||||
var out, expected;
|
||||
|
||||
// in the following tests, we must use the OutputLFLineBreak flag, to avoid
|
||||
// to have the default line break of the platform in the result, so the test
|
||||
// can pass on all platform
|
||||
|
||||
//------------ OutputEncodeW3CEntities
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak | de.OutputEncodeW3CEntities);
|
||||
out = encoder.encodeToString();
|
||||
expected = loadFileContent("file_htmlserializer_2_entw3c.html");
|
||||
is(out, expected, "test OutputEncodeW3CEntities");
|
||||
|
||||
//------------ OutputEncodeBasicEntities
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak | de.OutputEncodeBasicEntities);
|
||||
out = encoder.encodeToString();
|
||||
expected = loadFileContent("file_htmlserializer_2_basic.html");
|
||||
is(out, expected, "test OutputEncodeBasicEntities");
|
||||
|
||||
//------------ OutputEncodeLatin1Entities
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak | de.OutputEncodeLatin1Entities);
|
||||
out = encoder.encodeToString();
|
||||
expected = loadFileContent("file_htmlserializer_2_latin1.html");
|
||||
is(out, expected, "test OutputEncodeLatin1Entities");
|
||||
|
||||
//------------ OutputEncodeHTMLEntities
|
||||
encoder.init(doc, "text/html", de.OutputLFLineBreak | de.OutputEncodeHTMLEntities);
|
||||
out = encoder.encodeToString();
|
||||
expected = loadFileContent("file_htmlserializer_2_enthtml.html");
|
||||
is(out, expected, "test OutputEncodeHTMLEntities");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
addLoadEvent(testHtmlSerializer_1);
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -1,3 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<foo /> <!-- é -->
|
@ -1,3 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<foo/>
|
||||
<!-- é -->
|
@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE whatever PUBLIC
|
||||
"-//MOZ//WHATEVER//EN"
|
||||
"http://mozilla.org/ns/foo">
|
||||
<foo xmln="htp://mozilla.org/ns">
|
||||
<baz /> <!-- a comment -->
|
||||
<bar> <robots> & <aliens>
|
||||
<mozilla> a a a a a éèàùûî</mozilla>
|
||||
<firefox>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Nam tellus massa, fringilla aliquam, fermentum sit amet, posuere ac, est. Duis tristique egestas ligula. Mauris quis felis. Fusce a ipsum non lacus posuere aliquet. Sed fermentum posuere nulla. Donec tempor. Donec sollicitudin tortor lacinia libero ullamcorper laoreet. Cras quis nisi at odio consectetuer molestie.</firefox>
|
||||
<?xml-foo "hey" ?>
|
||||
</bar>
|
||||
<!-- a comment
|
||||
on several lines-->
|
||||
<?xml-foo "another pi on two lines"
|
||||
example="hello"?>
|
||||
</foo>
|
@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE whatever PUBLIC "-//MOZ//WHATEVER//EN" "http://mozilla.org/ns/foo">
|
||||
<foo xmln="htp://mozilla.org/ns">
|
||||
<baz/> <!-- a comment -->
|
||||
<bar> <robots> & <aliens>
|
||||
<mozilla> a a a a a éèàùûî</mozilla>
|
||||
<firefox>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Nam tellus massa, fringilla aliquam, fermentum sit amet, posuere ac, est. Duis tristique egestas ligula. Mauris quis felis. Fusce a ipsum non lacus posuere aliquet. Sed fermentum posuere nulla. Donec tempor. Donec sollicitudin tortor lacinia libero ullamcorper laoreet. Cras quis nisi at odio consectetuer molestie.</firefox>
|
||||
<?xml-foo "hey" ?>
|
||||
</bar>
|
||||
<!-- a comment
|
||||
on several lines-->
|
||||
<?xml-foo "another pi on two lines"
|
||||
example="hello"?>
|
||||
</foo>
|
@ -1,68 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** 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
|
||||
*
|
||||
* The Initial Developer of the Original Code is Disruptive Innovations.
|
||||
*
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Laurent Jouanneau <laurent.jouanneau@disruptive-innovations.com>, Original author
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
const gBasePath = "content/base/test/unit/";
|
||||
const nsIDocumentEncoder = Components.interfaces.nsIDocumentEncoder;
|
||||
const replacementChar = Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER;
|
||||
|
||||
function loadContentFile(aFile, aCharset) {
|
||||
//if(aAsIso == undefined) aAsIso = false;
|
||||
if(aCharset == undefined)
|
||||
aCharset = 'UTF-8';
|
||||
|
||||
var file = do_get_file(gBasePath+aFile);
|
||||
var ios = Components.classes['@mozilla.org/network/io-service;1']
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var chann = ios.newChannelFromURI ( ios.newFileURI (file) );
|
||||
chann.contentCharset = aCharset;
|
||||
|
||||
/*var inputStream = Components.classes["@mozilla.org/scriptableinputstream;1"]
|
||||
.createInstance(Components.interfaces.nsIScriptableInputStream);
|
||||
inputStream.init(chann.open());
|
||||
return inputStream.read(file.fileSize);
|
||||
*/
|
||||
|
||||
var inputStream = Components.classes["@mozilla.org/intl/converter-input-stream;1"]
|
||||
.createInstance(Components.interfaces.nsIConverterInputStream);
|
||||
inputStream.init(chann.open(), aCharset, 1024, replacementChar);
|
||||
var str = {}, content = '';
|
||||
while (inputStream.readString(4096, str) != 0) {
|
||||
content += str.value;
|
||||
}
|
||||
return content;
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** 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.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Disruptive Innovations.
|
||||
*
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Laurent Jouanneau <laurent.jouanneau@disruptive-innovations.com>, Original author
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
function xmlEncode(aFile, aFlags, aCharset) {
|
||||
if(aFlags == undefined) aFlags = 0;
|
||||
if(aCharset == undefined) aCharset = "UTF-8";
|
||||
|
||||
var doc = do_parse_document(gBasePath+aFile, "text/xml");
|
||||
|
||||
var encoder = Components.classes["@mozilla.org/layout/documentEncoder;1?type=text/xml"]
|
||||
.createInstance(nsIDocumentEncoder);
|
||||
encoder.setCharset(aCharset);
|
||||
encoder.init(doc, "text/xml", aFlags);
|
||||
return encoder.encodeToString();
|
||||
}
|
||||
|
||||
function run_test()
|
||||
{
|
||||
var result, expected;
|
||||
const de = Components.interfaces.nsIDocumentEncoder;
|
||||
|
||||
result = xmlEncode("1_original.xml", de.OutputLFLineBreak);
|
||||
expected =loadContentFile("1_result.xml");
|
||||
do_check_eq(expected, result);
|
||||
|
||||
result = xmlEncode("2_original.xml", de.OutputLFLineBreak);
|
||||
expected = loadContentFile("2_result_1.xml");
|
||||
do_check_eq(expected, result);
|
||||
|
||||
result = xmlEncode("2_original.xml", de.OutputLFLineBreak);
|
||||
do_check_eq(expected, result);
|
||||
|
||||
result = xmlEncode("2_original.xml", de.OutputCRLineBreak);
|
||||
expected = expected.replace(/\n/g, "\r");
|
||||
do_check_eq(expected, result);
|
||||
|
||||
result = xmlEncode("2_original.xml", de.OutputLFLineBreak | de.OutputCRLineBreak);
|
||||
expected = expected.replace(/\r/mg, "\r\n");
|
||||
do_check_eq(expected, result);
|
||||
}
|
Loading…
Reference in New Issue
Block a user