Bug 1658469 - When cloning a shadow root for printing, also copy the UA-widget-ness. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D86952
This commit is contained in:
Emilio Cobos Álvarez 2020-08-13 13:06:38 +00:00
parent 7ff5ba6276
commit 6368b296b2
2 changed files with 11 additions and 2 deletions

View File

@ -95,6 +95,10 @@ JSObject* ShadowRoot::WrapNode(JSContext* aCx,
}
void ShadowRoot::CloneInternalDataFrom(ShadowRoot* aOther) {
if (aOther->IsUAWidget()) {
SetIsUAWidget();
}
size_t sheetCount = aOther->SheetCount();
for (size_t i = 0; i < sheetCount; ++i) {
StyleSheet* sheet = aOther->SheetAt(i);

View File

@ -424,7 +424,7 @@ async function compareFiles(src1, src2, options = {}) {
await new Promise((resolve) => {
iframeElement.addEventListener("load", resolve, { capture: true, once: true });
iframeElement.setAttribute("src", BASE + src1);
iframeElement.setAttribute("src", new URL(src1, BASE).href);
});
if (messagePromise) {
@ -438,7 +438,7 @@ async function compareFiles(src1, src2, options = {}) {
await new Promise((resolve) => {
iframeElement.addEventListener("load", resolve, { capture: true, once: true });
iframeElement.setAttribute("src", BASE + src2);
iframeElement.setAttribute("src", new URL(src2, BASE).href);
});
await printpreview(options.ref || options);
@ -551,6 +551,11 @@ async function runTest20() {
exitprintpreview();
requestAnimationFrame(() => setTimeout(runTest21));
}
async function runTest21() {
await compareFiles("data:text/html,<audio controls>", "data:text/html,<audio controls>"); // Shouldn't crash.
finish();
}