Implement getComputedStyle() for font-family (#3614)#3615
Closed
danon wants to merge 1 commit intojsdom:mainfrom
Closed
Implement getComputedStyle() for font-family (#3614)#3615danon wants to merge 1 commit intojsdom:mainfrom
danon wants to merge 1 commit intojsdom:mainfrom
Conversation
domenic
requested changes
Dec 27, 2023
| // https://drafts.csswg.org/css-fonts-4/#font-family-prop | ||
| "font-family": { | ||
| inherited: true, | ||
| initial: "", |
Member
There was a problem hiding this comment.
It looks like this needs to be set to something like "serif". Can you do that, and then update the test? https://jsbin.com/tulemoreka/edit?html,output
| "font-family": { | ||
| inherited: true, | ||
| initial: "", | ||
| computedValue: "as-specified" |
Member
There was a problem hiding this comment.
This doesn't appear correct. Per spec it's
The appropriate test to add is something like
<div style="font-family: serif,sans-serif, 'Times New Roman',Arial"></div>and then testing that the computed style is serif, sans-serif, "Times New Roman", Arial (with the right quotes and spacing).
Making that work correctly would involve introducing some new infrastructure, probably around here?
jsdom/lib/jsdom/living/helpers/style-rules.js
Lines 214 to 237 in 907daec
asamuzaK
added a commit
to asamuzaK/jsdom
that referenced
this pull request
Apr 4, 2026
asamuzaK
added a commit
to asamuzaK/jsdom
that referenced
this pull request
Apr 4, 2026
asamuzaK
added a commit
to asamuzaK/jsdom
that referenced
this pull request
Apr 4, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is my first PR to jsdom.
I tried to follow example in a8b03af. @domenic let me know if I did it correctly?