1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
6 // Test native anonymous content in the markupview with
7 // devtools.inspector.showAllAnonymousContent set to true
8 const TEST_URL = URL_ROOT + "doc_markup_anonymous.html";
9 const PREF = "devtools.inspector.showAllAnonymousContent";
11 add_task(async function() {
12 Services.prefs.setBoolPref(PREF, true);
14 const { inspector } = await openInspectorForURL(TEST_URL);
16 const native = await getNodeFront("#native", inspector);
18 // Markup looks like: <div><input type="file"></div>
19 const nativeChildren = await inspector.walker.children(native);
20 is(nativeChildren.nodes.length, 1, "Children returned from walker");
22 info("Checking the input element");
23 const child = nativeChildren.nodes[0];
24 ok(!child.isAnonymous, "<input type=file> is not anonymous");
26 const grandchildren = await inspector.walker.children(child);
28 grandchildren.nodes.length,
30 "<input type=file> has native anonymous children"
33 for (const node of grandchildren.nodes) {
34 ok(node.isAnonymous, "Child is anonymous");
35 ok(!node._form.isShadowAnonymous, "Child is not shadow anonymous");
36 ok(node._form.isNativeAnonymous, "Child is native anonymous");
37 await isEditingMenuDisabled(node, inspector);