Skip to content

[cssom-1] CSSStyleDeclaration.getPropertyPriority() for resolved values #9421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cdoublev opened this issue Sep 28, 2023 · 4 comments
Closed
Labels
cssom-1 Current Work

Comments

@cdoublev
Copy link
Collaborator

https://drafts.csswg.org/cssom-1/#dom-cssstyledeclaration-getpropertypriority

Should it return empty string when the computed flag is set, like in Chrome/FF (at least)?

<style>#target { color: red !important }</style>
<script>
  getComputedStyle(target).getPropertyPriority('color') // ''
</script>
@cdoublev cdoublev added the cssom-1 Current Work label Sep 28, 2023
@emilio
Copy link
Collaborator

emilio commented Sep 28, 2023

I think this is how it should work per spec, because https://drafts.csswg.org/cssom-1/#dom-window-getcomputedstyle doesn't set the important flag anywhere:

decls to a list of all longhand properties that are supported CSS properties, in lexicographical order, with the value being the resolved value computed for obj using the style rules associated with doc. Additionally, append to decls all the custom properties whose computed value for obj is not the guaranteed-invalid value.

Let me know / reopen if that's somehow not your read as well, or if any further clarification is needed.

@emilio emilio closed this as completed Sep 28, 2023
@cdoublev
Copy link
Collaborator Author

Sorry for not being explicit. Would you accept a PR adding this step?

  1. If the computed flag is set, then return the empty string

@Loirooriol
Copy link
Contributor

What would this solve? The current steps already produce empty string.

@cdoublev
Copy link
Collaborator Author

cdoublev commented Oct 1, 2023

Nothing (I guess), I suggest it for consistency with getPropertyValue() and for the same reason as in #6144.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cssom-1 Current Work
Projects
None yet
Development

No branches or pull requests

3 participants