-
-
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.
Implement getComputedStyle() for font-family (#3614)
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 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
31 changes: 31 additions & 0 deletions
31
test/web-platform-tests/to-upstream/cssom/getComputedStyle-fontFamily.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,31 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>Computed fontFamily 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" style="font-family: Arial;"> | ||
<div id="child">Child</div> | ||
</div> | ||
</body> | ||
|
||
<script> | ||
"use strict"; | ||
|
||
test(() => { | ||
const parent = window.document.querySelector("#parent"); | ||
assert_equals(getComputedStyle(parent).fontFamily, "Arial"); | ||
}, "Parent element returns the directly specified value for fontFamily"); | ||
|
||
test(() => { | ||
const child = document.querySelector("#child"); | ||
assert_equals(getComputedStyle(child).fontFamily, "Arial"); | ||
}, "Child element inherits the fontFamily value from its parent"); | ||
</script> |