blob: 8617def08b1cf7a0efc6b759b6e7f28ad956bb31 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that a flex container is not shown as a flex item of its grandparent flex
// container.
const TEST_URI = `
<style>
.flex {
display: flex;
}
</style>
<div class="flex">
<div>
<div id="grandchild" class="flex">
This is a flex item of a flex container.
Its parent isn't a flex container, but its grandparent is.
</div>
</div>
</div>
`;
add_task(async function () {
await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
const { inspector, flexboxInspector } = await openLayoutView();
const { document: doc } = flexboxInspector;
info("Select the flex container's grandchild.");
const onFlexContainerHeaderRendered = waitForDOM(
doc,
".flex-header-container-label"
);
await selectNode("#grandchild", inspector);
await onFlexContainerHeaderRendered;
info("Check that only the Flex Container accordion item is showing.");
const flexPanes = doc.querySelectorAll(".flex-accordion");
is(
flexPanes.length,
1,
"There should only be one flex accordion item showing."
);
info("Check that the container header shows Flex Container.");
const flexAccordionHeader = flexPanes[0].querySelector(
".accordion-header-label"
);
is(
flexAccordionHeader.textContent,
"Flex Container",
"The flexbox pane shows a flex container accordion item."
);
});
|