Permalink
Switch branches/tags
merge_pr_14150 merge_pr_14145 merge_pr_14144 merge_pr_14141 merge_pr_14140 merge_pr_14137 merge_pr_14136 merge_pr_14131 merge_pr_14130 merge_pr_14129 merge_pr_14128 merge_pr_14127 merge_pr_14126 merge_pr_14125 merge_pr_14124 merge_pr_14123 merge_pr_14121 merge_pr_14120 merge_pr_14119 merge_pr_14117 merge_pr_14116 merge_pr_14115 merge_pr_14113 merge_pr_14108 merge_pr_14106 merge_pr_14105 merge_pr_14104 merge_pr_14103 merge_pr_14102 merge_pr_14101 merge_pr_14098 merge_pr_14097 merge_pr_14096 merge_pr_14092 merge_pr_14090 merge_pr_14086 merge_pr_14085 merge_pr_14084 merge_pr_14080 merge_pr_14079 merge_pr_14078 merge_pr_14077 merge_pr_14076 merge_pr_14075 merge_pr_14071 merge_pr_14068 merge_pr_14067 merge_pr_14066 merge_pr_14065 merge_pr_14063 merge_pr_14062 merge_pr_14061 merge_pr_14058 merge_pr_14057 merge_pr_14056 merge_pr_14055 merge_pr_14054 merge_pr_14053 merge_pr_14052 merge_pr_14051 merge_pr_14050 merge_pr_14049 merge_pr_14048 merge_pr_14047 merge_pr_14046 merge_pr_14045 merge_pr_14043 merge_pr_14042 merge_pr_14040 merge_pr_14039 merge_pr_14038 merge_pr_14036 merge_pr_14035 merge_pr_14034 merge_pr_14032 merge_pr_14031 merge_pr_14030 merge_pr_14028 merge_pr_14027 merge_pr_14026 merge_pr_14024 merge_pr_14023 merge_pr_14022 merge_pr_14021 merge_pr_14020 merge_pr_14019 merge_pr_14018 merge_pr_14017 merge_pr_14016 merge_pr_14015 merge_pr_14012 merge_pr_14011 merge_pr_14010 merge_pr_14009 merge_pr_14008 merge_pr_14007 merge_pr_14006 merge_pr_14005 merge_pr_14004 merge_pr_14002
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
73 lines (67 sloc) 2.63 KB
<!doctype html>
<html>
<head>
<title>The table cell nowrap minimum width calculation quirk</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style> iframe { width:200px; height:20px; } </style>
</head>
<body>
<div id=log></div>
<iframe id=quirks></iframe>
<iframe id=almost></iframe>
<iframe id=standards></iframe>
<script>
setup({explicit_done:true});
var png = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==";
var preload = new Image();
preload.src = png;
onload = function() {
var html = "<style id=style></style>";
var a_doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
var s_doctype = '<!DOCTYPE HTML>';
var q = document.getElementById('quirks').contentWindow;
var a = document.getElementById('almost').contentWindow;
var s = document.getElementById('standards').contentWindow;
q.document.open();
q.document.write(html);
q.document.close();
a.document.open();
a.document.write(a_doctype + html);
a.document.close();
s.document.open();
s.document.write(s_doctype + html);
s.document.close();
[q, a, s].forEach(function(win) {
['style', 'test', 'ref', 's_ref'].forEach(function(id) {
win.__proto__.__defineGetter__(id, function() { return win.document.getElementById(id); });
});
});
q.title = 'quirks mode';
a.title = 'almost standards mode';
s.title = 'standards mode';
var tests = [
{desc:"basic",
style:'table { width:8px } #test { width:10px }',
body:'<table><tr><td id=test nowrap></table>'+
'<table><tr><td id=ref><img src="{png}" width=10></table>'+
'<table><tr><td id=s_ref></table>'},
];
tests.forEach(function(t) {
test(function() {
var style = t.style.replace(/\{png\}/g, png);
var body = t.body.replace(/\{png\}/g, png);
[q, a, s].forEach(function(win) {
win.style.textContent = style;
win.document.body.innerHTML = body;
assert_equals(win.getComputedStyle(win.test).width,
win.getComputedStyle(win == q ? win.ref : win.s_ref).width,
win.title);
});
}, document.title+', '+t.desc);
});
done();
}
</script>
</body>
</html>