Skip to content

[cssom] getComputedStyle and shorthands. #2529

Closed
@emilio

Description

Currently https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle says:

declarations: 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.

Which means that getComputedStyle(document.documentElement).font shouldn't be present, since it's a shorthand.

This is inconsistent with https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-getpropertyvalue, though which handles shorthands.

Should ComputedStyle.getPropertyValue handle shorthands? If so, should they be exposed as a property in the declaration object?

Right now answers from browsers to "does getPropertyValue handle shorthands?", and "are shorthands exposed as a property?" are:

  • Firefox: no, no
  • WebKit / Blink: yes, yes
  • Edge: no, no

What should happen here?

Note that both FF and Edge have a special-case for overflow, which used to be a longhand.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions