mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 22:05:44 +00:00
bug 1442980
, add basic test for print previewed shadow DOM, r=bdahl
--HG-- extra : rebase_source : 66d28f5566710346022ef9a8f8d3459579edb546
This commit is contained in:
parent
c8b02be077
commit
8b14d4d61a
@ -259,6 +259,28 @@ function runTest6end() {
|
||||
printpreview();
|
||||
exitprintpreview();
|
||||
|
||||
requestAnimationFrame(function() { setTimeout(runTest7); } );
|
||||
}
|
||||
|
||||
function runTest7() {
|
||||
var contentText = "<a href='#'>mozilla</a><input>test<select><option>option1</option></select>";
|
||||
// Create normal content
|
||||
window.frames[0].document.body.innerHTML =
|
||||
"<div>" + contentText + "</div>";
|
||||
window.frames[0].document.body.firstChild.value =
|
||||
window.frames[0].document.body.firstChild.getAttribute('value');
|
||||
printpreview();
|
||||
ctx1.drawWindow(window.frames[1], 0, 0, 400, 400, "rgb(255,255,255)");
|
||||
exitprintpreview();
|
||||
|
||||
window.frames[0].document.body.innerHTML = "<div></div>";
|
||||
var sr = window.frames[0].document.body.firstChild.attachShadow({mode: "open"});
|
||||
sr.innerHTML = contentText;
|
||||
printpreview();
|
||||
ctx2.drawWindow(window.frames[1], 0, 0, 400, 400, "rgb(255,255,255)");
|
||||
exitprintpreview();
|
||||
ok(compareCanvases(), "Printing light DOM and shadow DOM should create same output");
|
||||
|
||||
finish();
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,8 @@
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("printpreview_helper.xul", "printpreview", "chrome,width=100,height=100");
|
||||
SpecialPowers.pushPrefEnv({"set":[["dom.webcomponents.shadowdom.enabled", true]]}, function() {
|
||||
window.open("printpreview_helper.xul", "printpreview", "chrome,width=100,height=100");
|
||||
});
|
||||
]]></script>
|
||||
</window>
|
||||
|
Loading…
Reference in New Issue
Block a user