mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 02:25:34 +00:00
a68a0e6e0e
When we do the initial reflow, we remove nodes from the document if we're printing the selection. If these operations cause one iframe to be removed, for example, then we may get hit with an nsIWebProgress notification synchronously, which may cause us to go through MaybeResumePrintAfterResourcesLoaded too early (and thus twice), which messes up our state. The ideal solution would be to add us as a listener a bit later, but we can't because we need to know whether we did load anything during the initial reflow. So instead of that, just avoid resuming print while we're doing the reflow. We'll call MaybeResumePrintAfterResourcesLoaded a few lines below. Differential Revision: https://phabricator.services.mozilla.com/D94586
21 lines
557 B
HTML
21 lines
557 B
HTML
<!DOCTYPE html>
|
|
<html reftest-print-range="selection">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<link href="print.css" rel="stylesheet">
|
|
<script>
|
|
function selectNodeById(id) {
|
|
var node = document.getElementById(id);
|
|
var rng = document.createRange();
|
|
rng.selectNode(node);
|
|
window.getSelection().addRange(rng);
|
|
}
|
|
</script>
|
|
</head>
|
|
<body onload="selectNodeById('selection')">
|
|
<p>This text should not be there</p>
|
|
<p id="selection">This text should appear on page 1</p>
|
|
<iframe src="data:text/html,"></iframe>
|
|
</body>
|
|
</html>
|