mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
a060e95983
This code is super-hairy, but I think this is the minimum amount of changes that we need. nsPlainTextSerializer::IsInPre() before this patch is completely broken, and I changed it to maintain a stack of bools representing whether the elements that we saw as we were traversing the tree are preformatted or not. nsXHTMLContentSerializer maintains this information using a counter, which is broken in case pre and non-preformatted elements are stacked underneath each other, but I'm not sure why this code is using a counter and I didn't want to change it drastically, so for now I'm just making it look at the element's style first as opposed to its tag name. Follow-up work may include exploring whether nsXHTMLContentSerializer should use a stack similar to nsPlainTextSerializer, and also audit this code for more places where things are hardcoded based on tag names where we should be really looking at the style.
73 lines
2.7 KiB
HTML
73 lines
2.7 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<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 id="script" type="text/javascript"></script>
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
// 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";
|
|
}
|
|
var a=3, b=4, c=7;
|
|
// here we test the non-serialization of xml character into javascript content
|
|
var d = a < b && a > c;
|
|
//]]>
|
|
</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 <br />leo ut libero
|
|
<!-- empty element: end tag should be generated for backward compatibility with HTML -->
|
|
<p></p>
|
|
<noscript>
|
|
<p>Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
|
|
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
|
|
aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
|
|
<pre xmlns="http://mozilla.org/ns/foo">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>
|
|
</body>
|
|
</html> |