Source code

Revision control

Copy as Markdown

Other Tools

<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Permission Element: invalid if parent has mask</title>
<link
rel="help"
/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
async_test((t) => {
const parent = document.createElement("div");
const element = document.createElement("permission");
element.setAttribute("type", "camera");
parent.appendChild(element);
parent.style.mask = "linear-gradient(black, transparent)";
element.onvalidationstatuschange = t.step_func(() => {
// These two invalid reasons are expected when the permission element was just created.
if (
element.invalidReason == "unsuccessful_registration" ||
element.invalidReason == "intersection_changed"
) {
return;
}
assert_equals(
element.invalidReason,
"style_invalid",
`Parent with mask should be invalid`,
);
t.done();
});
document.body.appendChild(parent);
}, "Permission element is invalid if it has a parent with a mask.");
</script>
</body>
</html>