-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add inheritance for pointer-events to getComputedStyle()
- Loading branch information
Showing
2 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
test/web-platform-tests/to-upstream/cssom/getComputedStyle-pointerEvents.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>Computed pointerEvents is inherited</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<style> | ||
#parent { | ||
pointer-events: none; | ||
} | ||
</style> | ||
|
||
<body> | ||
<div id="parent"> | ||
<div id="child">Hello, Jarda!</div> | ||
</div> | ||
</body> | ||
|
||
<script> | ||
"use strict"; | ||
|
||
test(() => { | ||
const element = document.querySelector("body"); | ||
assert_equals(getComputedStyle(element).pointerEvents, "auto"); | ||
}, "Body element has the initial value for pointerEvents"); | ||
|
||
test(() => { | ||
const element = document.querySelector("#parent"); | ||
assert_equals(getComputedStyle(element).pointerEvents, "none"); | ||
}, "Parent element returns the directly specified value for pointerEvents"); | ||
|
||
test(() => { | ||
const element = document.querySelector("#child"); | ||
assert_equals(getComputedStyle(element).pointerEvents, "none"); | ||
}, "Child element inherits the pointerEvents value from its parent"); | ||
</script> |