Bug 1119276 - Show all native anon content in browser toolbox with devtools.inspector.showAllAnonymousContent pref. r=pbrosset
This commit is contained in:
@@ -34,6 +34,7 @@ support-files =
|
||||
[browser_markupview_anonymous_02.js]
|
||||
skip-if = e10s # scratchpad.xul is not loading in e10s window
|
||||
[browser_markupview_anonymous_03.js]
|
||||
[browser_markupview_anonymous_04.js]
|
||||
[browser_markupview_copy_image_data.js]
|
||||
[browser_markupview_css_completion_style_attribute.js]
|
||||
[browser_markupview_events.js]
|
||||
|
||||
@@ -27,4 +27,18 @@ add_task(function*() {
|
||||
info ("Checking the ::after pseudo element");
|
||||
let after = children.nodes[2];
|
||||
yield isEditingMenuDisabled(after, inspector);
|
||||
|
||||
let native = yield getNodeFront("#native", inspector);
|
||||
|
||||
// Markup looks like: <div><video controls /></div>
|
||||
let nativeChildren = yield inspector.walker.children(native);
|
||||
is (nativeChildren.nodes.length, 1, "Children returned from walker");
|
||||
|
||||
info ("Checking the video element");
|
||||
let video = nativeChildren.nodes[0];
|
||||
ok (!video.isAnonymous, "<video> is not anonymous");
|
||||
|
||||
let videoChildren = yield inspector.walker.children(video);
|
||||
is (videoChildren.nodes.length, 0,
|
||||
"No native children returned from walker for <video> by default");
|
||||
});
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Test native anonymous content in the markupview with devtools.inspector.showAllAnonymousContent
|
||||
// set to true
|
||||
const TEST_URL = TEST_URL_ROOT + "doc_markup_anonymous.html";
|
||||
|
||||
add_task(function*() {
|
||||
Services.prefs.setBoolPref("devtools.inspector.showAllAnonymousContent", true);
|
||||
|
||||
let {inspector} = yield addTab(TEST_URL).then(openInspector);
|
||||
|
||||
let native = yield getNodeFront("#native", inspector);
|
||||
|
||||
// Markup looks like: <div><video controls /></div>
|
||||
let nativeChildren = yield inspector.walker.children(native);
|
||||
is (nativeChildren.nodes.length, 1, "Children returned from walker");
|
||||
|
||||
info ("Checking the video element");
|
||||
let video = nativeChildren.nodes[0];
|
||||
ok (!video.isAnonymous, "<video> is not anonymous");
|
||||
|
||||
let videoChildren = yield inspector.walker.children(video);
|
||||
is (videoChildren.nodes.length, 3, "<video> has native anonymous children");
|
||||
|
||||
for (let node of videoChildren.nodes) {
|
||||
ok (node.isAnonymous, "Child is anonymous");
|
||||
ok (!node._form.isXBLAnonymous, "Child is not XBL anonymous");
|
||||
ok (!node._form.isShadowAnonymous, "Child is not shadow anonymous");
|
||||
ok (node._form.isNativeAnonymous, "Child is native anonymous");
|
||||
yield isEditingMenuDisabled(node, inspector);
|
||||
}
|
||||
});
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
<div id="shadow">light dom</div>
|
||||
|
||||
<div id="native"><video controls></video></div>
|
||||
|
||||
<script>
|
||||
var host = document.querySelector('#shadow');
|
||||
if (host.createShadowRoot) {
|
||||
|
||||
@@ -32,6 +32,7 @@ registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("devtools.dump.emit");
|
||||
Services.prefs.clearUserPref("devtools.markup.pagesize");
|
||||
Services.prefs.clearUserPref("dom.webcomponents.enabled");
|
||||
Services.prefs.clearUserPref("devtools.inspector.showAllAnonymousContent");
|
||||
});
|
||||
|
||||
// Auto close the toolbox and close the test tabs when the test ends
|
||||
|
||||
Reference in New Issue
Block a user