Commit f435d250 authored by Mason Freed's avatar Mason Freed Committed by Chromium LUCI CQ

Fix duplicate id in declarative Shadow DOM test

The same id was used twice, whereas they should have been unique.

No behavior changes, just a cleanup, so TBR:
TBR=masonfreed@chromium.org

Bug: 1042130
Change-Id: I58e4acc00acabbb728c730fe3910aea65c4c11e1
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2601052Reviewed-by: default avatarMason Freed <masonfreed@chromium.org>
Commit-Queue: Mason Freed <masonfreed@chromium.org>
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#839198}
parent 730dc724
......@@ -137,14 +137,16 @@ test(() => {
}, 'insertAdjacentHTML on element - not supported');
test(() => {
document.write(`<div id=doc-write-1 style="display:none">${content}</div>`);
assert_dsd(document.getElementById('doc-write-1'),true);
const id = 'doc-write-1';
document.write(`<div id=${id} style="display:none">${content}</div>`);
assert_dsd(document.getElementById(id),true);
}, 'document.write allowed from synchronous script loaded from main document');
test(() => {
const id = 'doc-write-2';
const doc = document.implementation.createHTMLDocument('');
doc.write(`<div id=doc-write-1>${content}</div>`);
assert_dsd(doc.getElementById('doc-write-1'),false);
doc.write(`<div id=${id}>${content}</div>`);
assert_dsd(doc.getElementById(id),false);
}, 'document.write disallowed on fresh document');
......
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