Commit e57fd155 authored by darin's avatar darin

New layout tests for the bugs I just fixed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f0d73263
layer at (0,0) size 800x600
RenderCanvas at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock {H1} at (0,0) size 784x37
RenderText {TEXT} at (0,0) size 195x37
text run at (0,0) width 195: "Cloning nodes"
RenderBlock {DIV} at (0,58) size 784x76 [bgcolor=#FFFF00] [border: (2px ridge #000000)]
RenderInline {SPAN} at (0,0) size 768x72
RenderText {TEXT} at (2,2) size 60x36
text run at (2,2) width 60: "Bold"
RenderInline {SPAN} at (0,0) size 708x36
RenderText {TEXT} at (62,2) size 205x36
text run at (62,2) width 205: "Bold+Underline"
RenderInline {SPAN} at (0,0) size 281x36
RenderText {TEXT} at (267,2) size 281x36
text run at (267,2) width 281: "Bold+Underline+Italic"
RenderText {TEXT} at (548,2) size 222x36
text run at (548,2) width 222: "Bold+Uunderline"
RenderText {TEXT} at (2,38) size 60x36
text run at (2,38) width 60: "Bold"
RenderText {TEXT} at (0,0) size 0x0
RenderBlock (anonymous) at (0,134) size 784x18
RenderText {TEXT} at (0,0) size 189x18
text run at (0,0) width 189: "Cloned Node with deep=false"
RenderBlock {DIV} at (0,152) size 784x40 [bgcolor=#FFFF00] [border: (2px ridge #000000)]
RenderBR {BR} at (2,2) size 0x36
RenderBlock (anonymous) at (0,192) size 784x18
RenderText {TEXT} at (0,0) size 184x18
text run at (0,0) width 184: "Cloned Node with deep=true"
RenderBlock {DIV} at (0,210) size 784x76 [bgcolor=#FFFF00] [border: (2px ridge #000000)]
RenderInline {SPAN} at (0,0) size 768x72
RenderText {TEXT} at (2,2) size 60x36
text run at (2,2) width 60: "Bold"
RenderInline {SPAN} at (0,0) size 708x36
RenderText {TEXT} at (62,2) size 205x36
text run at (62,2) width 205: "Bold+Underline"
RenderInline {SPAN} at (0,0) size 281x36
RenderText {TEXT} at (267,2) size 281x36
text run at (267,2) width 281: "Bold+Underline+Italic"
RenderText {TEXT} at (548,2) size 222x36
text run at (548,2) width 222: "Bold+Uunderline"
RenderText {TEXT} at (2,38) size 60x36
text run at (2,38) width 60: "Bold"
RenderText {TEXT} at (0,0) size 0x0
<html>
<head>
<title>Test CloneNode</title>
<script type="text/javascript">
<!--
function init() {
var brNode = document.createElement("br");
var myDiv = document.getElementById("myDiv");
myDiv.style["fontSize"] = "30";
myDiv.style["borderWidth"] = "2";
myDiv.style["borderStyle"] = "ridge";
myDiv.style["backgroundColor"] = "yellow";
var myClonedDiv = myDiv.cloneNode(false);
myClonedDiv.id = "myClonedDiv";
myClonedDiv.appendChild(brNode);
myDiv.parentNode.appendChild(document.createTextNode("Cloned Node with deep=false"));
myDiv.parentNode.appendChild(myClonedDiv);
var myDeepClonedDiv = myDiv.cloneNode(true);
myDeepClonedDiv.id = "myDeepClonedDiv";
myDiv.parentNode.appendChild(document.createTextNode("Cloned Node with deep=true"));
myDiv.parentNode.appendChild(myDeepClonedDiv);
}
//-->
</script>
</head>
<body onload="init()">
<h1>Cloning nodes</h1>
<div id="myDiv">
<span style="font-weight:bold">Bold<span style="text-decoration:underline">Bold+Underline<span style="font-style:italic">Bold+Underline+Italic</span>Bold+Uunderline</span>Bold</span>
</div>
</body>
</html>
This diff is collapsed.
<script>
function test() {
var undefined;
var features = [
["Core", undefined],
["HTML", undefined],
["XML", undefined],
["Views", undefined],
["StyleSheets", undefined],
["CSS", undefined],
["CSS2", undefined],
["CSS3", undefined],
["Events", undefined],
["UIEvents", undefined],
["MouseEvents", undefined],
["HTMLEvents", undefined],
["MutationEvents", undefined],
["Range", undefined],
["Traversal", undefined],
["Core", null],
["HTML", null],
["XML", null],
["Views", null],
["StyleSheets", null],
["CSS", null],
["CSS2", null],
["CSS3", null],
["Events", null],
["UIEvents", null],
["MouseEvents", null],
["HTMLEvents", null],
["MutationEvents", null],
["Range", null],
["Traversal", null],
["Core", ""],
["HTML", ""],
["XML", ""],
["Views", ""],
["StyleSheets", ""],
["CSS", ""],
["CSS2", ""],
["CSS3", ""],
["Events", ""],
["UIEvents", ""],
["MouseEvents", ""],
["HTMLEvents", ""],
["MutationEvents", ""],
["Range", ""],
["Traversal", ""],
["Core", "1.0"],
["HTML", "1.0"],
["XML", "1.0"],
["Views", "1.0"],
["StyleSheets", "1.0"],
["CSS", "1.0"],
["CSS2", "1.0"],
["CSS3", "1.0"],
["Events", "1.0"],
["UIEvents", "1.0"],
["MouseEvents", "1.0"],
["HTMLEvents", "1.0"],
["MutationEvents", "1.0"],
["Range", "1.0"],
["Traversal", "1.0"],
["Core", "2.0"],
["HTML", "2.0"],
["XML", "2.0"],
["Views", "2.0"],
["StyleSheets", "2.0"],
["CSS", "2.0"],
["CSS2", "2.0"],
["CSS3", "2.0"],
["Events", "2.0"],
["UIEvents", "2.0"],
["MouseEvents", "2.0"],
["HTMLEvents", "2.0"],
["MutationEvents", "2.0"],
["Range", "2.0"],
["Traversal", "2.0"],
["Core", "3.0"],
["HTML", "3.0"],
["XML", "3.0"],
["Views", "3.0"],
["StyleSheets", "3.0"],
["CSS", "3.0"],
["CSS2", "3.0"],
["CSS3", "3.0"],
["Events", "3.0"],
["UIEvents", "3.0"],
["MouseEvents", "3.0"],
["HTMLEvents", "3.0"],
["MutationEvents", "3.0"],
["Range", "3.0"],
["Traversal", "3.0"],
["Core", "nonsense"],
["HTML", "nonsense"],
["XML", "nonsense"],
["Views", "nonsense"],
["StyleSheets", "nonsense"],
["CSS", "nonsense"],
["CSS2", "nonsense"],
["CSS3", "nonsense"],
["Events", "nonsense"],
["UIEvents", "nonsense"],
["MouseEvents", "nonsense"],
["HTMLEvents", "nonsense"],
["MutationEvents", "nonsense"],
["Range", "nonsense"],
["Traversal", "nonsense"],
[undefined, ""],
[undefined, "1.0"],
[undefined, "2.0"],
[undefined, "3.0"],
[undefined, "nonsense"],
[undefined, undefined],
[undefined, null],
[null, ""],
[null, "1.0"],
[null, "2.0"],
[null, "3.0"],
[null, "nonsense"],
[null, undefined],
[null, null],
["nonsense", ""],
["nonsense", "1.0"],
["nonsense", "2.0"],
["nonsense", "3.0"],
["nonsense", "nonsense"],
["nonsense", undefined],
["nonsense", null],
];
for (var i = 0; i < features.length; ++i)
{
var item = features[i];
if (item[1] == "omitted") {
var hasFeature = document.implementation.hasFeature(item[0]);
var isSupported = document.body.isSupported(item[0]);
} else {
var hasFeature = document.implementation.hasFeature(item[0], item[1]);
var isSupported = document.body.isSupported(item[0], item[1]);
}
var item0String = item[0];
if (typeof item0String == "string")
item0String = '"' + item0String + '"';
var item1String = item[1];
if (typeof item1String == "string" && item[1] != "omitted")
item1String = '"' + item1String + '"';
var message = item0String + ', ' + item1String + ': ' + hasFeature + ', ' + isSupported;
var div = document.createElement('div');
div.innerHTML = message;
document.body.appendChild(div);
}
}
</script>
<body onload="test()">
</body>
layer at (0,0) size 800x600
RenderCanvas at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x579
RenderTable {TABLE} at (0,0) size 178x26 [border: (1px outset #808080)]
RenderTableSection {TBODY} at (1,1) size 0x24
RenderTableRow {TR} at (0,0) size 0x0
RenderTableCell {TH} at (1,1) size 34x22 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
RenderText {TEXT} at (2,2) size 30x18
text run at (2,2) width 30: "(1,1)"
RenderTableCell {TH} at (36,1) size 34x22 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
RenderText {TEXT} at (2,2) size 30x18
text run at (2,2) width 30: "(1,2)"
RenderTableCell {TH} at (71,1) size 34x22 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1]
RenderText {TEXT} at (2,2) size 30x18
text run at (2,2) width 30: "(1,3)"
RenderTableCell {TH} at (106,1) size 34x22 [border: (1px inset #808080)] [r=0 c=3 rs=1 cs=1]
RenderText {TEXT} at (2,2) size 30x18
text run at (2,2) width 30: "(1,4)"
RenderTableCell {TH} at (141,1) size 34x22 [border: (1px inset #808080)] [r=0 c=4 rs=1 cs=1]
RenderText {TEXT} at (2,2) size 30x18
text run at (2,2) width 30: "(1,5)"
RenderBlock {PRE} at (0,39) size 784x15
RenderText {TEXT} at (0,0) size 408x15
text run at (0,0) width 408: "xxx(1,1)[tab](1,2)[tab](1,3)[tab](1,4)[tab](1,5)xxx"
<TABLE ID="tbl" CELLSPACING="1" CELLPADDING="1" BORDER="1">
<TR id="r">
<TH>(1,1)
</TH>
<TH>(1,2)
</TH>
<TH>(1,3)
</TH>
<TH>(1,4)
</TH>
<TH>(1,5)
</TH>
</TR>
</TABLE>
<script>
var text = document.getElementById("r").innerText.replace(/\t/g, "[tab]");
document.write("<pre>xxx" + text + "xxx</pre>");
</script>
layer at (0,0) size 800x718
RenderCanvas at (0,0) size 800x600
layer at (0,0) size 800x718
RenderBlock {HTML} at (0,0) size 800x718
RenderBody {BODY} at (8,8) size 784x702
RenderBlock {DIV} at (0,0) size 784x18
RenderText {TEXT} at (0,0) size 130x18
text run at (0,0) width 130: "\"\", omitted: \"\", NaN"
RenderBlock {DIV} at (0,18) size 784x18
RenderText {TEXT} at (0,0) size 146x18
text run at (0,0) width 146: "\"\", undefined: \"\", NaN"
RenderBlock {DIV} at (0,36) size 784x18
RenderText {TEXT} at (0,0) size 91x18
text run at (0,0) width 91: "\"\", 0: \"\", NaN"
RenderBlock {DIV} at (0,54) size 784x18
RenderText {TEXT} at (0,0) size 107x18
text run at (0,0) width 107: "\"\", null: \"\", NaN"
RenderBlock {DIV} at (0,72) size 784x18
RenderText {TEXT} at (0,0) size 112x18
text run at (0,0) width 112: "\"\", false: \"\", NaN"
RenderBlock {DIV} at (0,90) size 784x18
RenderText {TEXT} at (0,0) size 107x18
text run at (0,0) width 107: "\"\", true: \"\", NaN"
RenderBlock {DIV} at (0,108) size 784x18
RenderText {TEXT} at (0,0) size 91x18
text run at (0,0) width 91: "\"\", 0: \"\", NaN"
RenderBlock {DIV} at (0,126) size 784x18
RenderText {TEXT} at (0,0) size 103x18
text run at (0,0) width 103: "\"\", 0.1: \"\", NaN"
RenderBlock {DIV} at (0,144) size 784x18
RenderText {TEXT} at (0,0) size 107x18
text run at (0,0) width 107: "\"\", 999: \"\", NaN"
RenderBlock {DIV} at (0,162) size 784x18
RenderText {TEXT} at (0,0) size 129x18
text run at (0,0) width 129: "\"\", Infinity: \"\", NaN"
RenderBlock {DIV} at (0,180) size 784x18
RenderText {TEXT} at (0,0) size 96x18
text run at (0,0) width 96: "\"\", -1: \"\", NaN"
RenderBlock {DIV} at (0,198) size 784x18
RenderText {TEXT} at (0,0) size 134x18
text run at (0,0) width 134: "\"\", -Infinity: \"\", NaN"
RenderBlock {DIV} at (0,216) size 784x18
RenderText {TEXT} at (0,0) size 114x18
text run at (0,0) width 114: "\"\", NaN: \"\", NaN"
RenderBlock {DIV} at (0,234) size 784x18
RenderText {TEXT} at (0,0) size 139x18
text run at (0,0) width 139: "\"x\", omitted: \"x\", 120"
RenderBlock {DIV} at (0,252) size 784x18
RenderText {TEXT} at (0,0) size 155x18
text run at (0,0) width 155: "\"x\", undefined: \"x\", 120"
RenderBlock {DIV} at (0,270) size 784x18
RenderText {TEXT} at (0,0) size 100x18
text run at (0,0) width 100: "\"x\", 0: \"x\", 120"
RenderBlock {DIV} at (0,288) size 784x18
RenderText {TEXT} at (0,0) size 116x18
text run at (0,0) width 116: "\"x\", null: \"x\", 120"
RenderBlock {DIV} at (0,306) size 784x18
RenderText {TEXT} at (0,0) size 121x18
text run at (0,0) width 121: "\"x\", false: \"x\", 120"
RenderBlock {DIV} at (0,324) size 784x18
RenderText {TEXT} at (0,0) size 115x18
text run at (0,0) width 115: "\"x\", true: \"\", NaN"
RenderBlock {DIV} at (0,342) size 784x18
RenderText {TEXT} at (0,0) size 100x18
text run at (0,0) width 100: "\"x\", 0: \"x\", 120"
RenderBlock {DIV} at (0,360) size 784x18
RenderText {TEXT} at (0,0) size 112x18
text run at (0,0) width 112: "\"x\", 0.1: \"x\", 120"
RenderBlock {DIV} at (0,378) size 784x18
RenderText {TEXT} at (0,0) size 115x18
text run at (0,0) width 115: "\"x\", 999: \"\", NaN"
RenderBlock {DIV} at (0,396) size 784x18
RenderText {TEXT} at (0,0) size 137x18
text run at (0,0) width 137: "\"x\", Infinity: \"\", NaN"
RenderBlock {DIV} at (0,414) size 784x18
RenderText {TEXT} at (0,0) size 104x18
text run at (0,0) width 104: "\"x\", -1: \"\", NaN"
RenderBlock {DIV} at (0,432) size 784x18
RenderText {TEXT} at (0,0) size 142x18
text run at (0,0) width 142: "\"x\", -Infinity: \"\", NaN"
RenderBlock {DIV} at (0,450) size 784x18
RenderText {TEXT} at (0,0) size 122x18
text run at (0,0) width 122: "\"x\", NaN: \"\", NaN"
RenderBlock {DIV} at (0,468) size 784x18
RenderText {TEXT} at (0,0) size 147x18
text run at (0,0) width 147: "\"xy\", omitted: \"x\", 120"
RenderBlock {DIV} at (0,486) size 784x18
RenderText {TEXT} at (0,0) size 163x18
text run at (0,0) width 163: "\"xy\", undefined: \"x\", 120"
RenderBlock {DIV} at (0,504) size 784x18
RenderText {TEXT} at (0,0) size 108x18
text run at (0,0) width 108: "\"xy\", 0: \"x\", 120"
RenderBlock {DIV} at (0,522) size 784x18
RenderText {TEXT} at (0,0) size 124x18
text run at (0,0) width 124: "\"xy\", null: \"x\", 120"
RenderBlock {DIV} at (0,540) size 784x18
RenderText {TEXT} at (0,0) size 129x18
text run at (0,0) width 129: "\"xy\", false: \"x\", 120"
RenderBlock {DIV} at (0,558) size 784x18
RenderText {TEXT} at (0,0) size 124x18
text run at (0,0) width 124: "\"xy\", true: \"y\", 121"
RenderBlock {DIV} at (0,576) size 784x18
RenderText {TEXT} at (0,0) size 108x18
text run at (0,0) width 108: "\"xy\", 0: \"x\", 120"
RenderBlock {DIV} at (0,594) size 784x18
RenderText {TEXT} at (0,0) size 120x18
text run at (0,0) width 120: "\"xy\", 0.1: \"x\", 120"
RenderBlock {DIV} at (0,612) size 784x18
RenderText {TEXT} at (0,0) size 123x18
text run at (0,0) width 123: "\"xy\", 999: \"\", NaN"
RenderBlock {DIV} at (0,630) size 784x18
RenderText {TEXT} at (0,0) size 145x18
text run at (0,0) width 145: "\"xy\", Infinity: \"\", NaN"
RenderBlock {DIV} at (0,648) size 784x18
RenderText {TEXT} at (0,0) size 112x18
text run at (0,0) width 112: "\"xy\", -1: \"\", NaN"
RenderBlock {DIV} at (0,666) size 784x18
RenderText {TEXT} at (0,0) size 150x18
text run at (0,0) width 150: "\"xy\", -Infinity: \"\", NaN"
RenderBlock {DIV} at (0,684) size 784x18
RenderText {TEXT} at (0,0) size 130x18
text run at (0,0) width 130: "\"xy\", NaN: \"\", NaN"
<script>
function test() {
var undefined;
var cases = [
["", "omitted"],
["", undefined],
["", 0],
["", null],
["", false],
["", true],
["", 0.0],
["", 0.1],
["", 999],
["", 1/0],
["", -1],
["", -1/0],
["", 0/0],
["x", "omitted"],
["x", undefined],
["x", 0],
["x", null],
["x", false],
["x", true],
["x", 0.0],
["x", 0.1],
["x", 999],
["x", 1/0],
["x", -1],
["x", -1/0],
["x", 0/0],
["xy", "omitted"],
["xy", undefined],
["xy", 0],
["xy", null],
["xy", false],
["xy", true],
["xy", 0.0],
["xy", 0.1],
["xy", 999],
["xy", 1/0],
["xy", -1],
["xy", -1/0],
["xy", 0/0],
];
for (var i = 0; i < cases.length; ++i)
{
var item = cases[i];
if (item[1] == "omitted") {
var string = item[0].charAt();
var code = item[0].charCodeAt();
} else {
var string = item[0].charAt(item[1]);
var code = item[0].charCodeAt(item[1]);
}
var item0String = item[0];
if (typeof item0String == "string")
item0String = '"' + item0String + '"';
var item1String = item[1];
if (typeof item1String == "string" && item[1] != "omitted")
item1String = '"' + item1String + '"';
var message = item0String + ', ' + item1String + ': "' + string + '", ' + code;
var div = document.createElement('div');
div.innerHTML = message;
document.body.appendChild(div);
}
}
</script>
<body onload="test()">
</body>
layer at (0,0) size 800x600
RenderCanvas at (0,0) size 800x600
layer at (0,0) size 800x34
RenderBlock {HTML} at (0,0) size 800x34
RenderBody {BODY} at (8,8) size 784x18
RenderText {TEXT} at (0,0) size 60x18
text run at (0,0) width 60: "all is well"
<script>
if (0) { var b; }
var a = b;
document.write("all is well");
</script>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment