Skip to content

[CSSOM] Can window.getComputedStyle be extended to match ::placeholder? #2112

@marcysutton

Description

@marcysutton

Hello, I'm wondering if window.getComputedStyle could be extended to match the :placeholder pseudo element. The spec explicitly mentions :before and :after: https://www.w3.org/TR/cssom-1/#extensions-to-the-window-interface

The result of testing live code shows that only Firefox matches :placeholder. An issue in the Chromium bug tracker indicates they consider this to be a bug in Firefox, so I thought I'd pose the question here.

It would be helpful to clarify this for browsers so that accessibility testing tools can audit the color contrast of placeholder text (included by WCAG success criteria 1.4.3).

Update: It looks like :first-letter does get returned by getComputedStyle in most major browsers, so further specification around pseudo-elements would be good. https://codepen.io/AmeliaBR/pen/VyvPoN?editors=1111

Metadata

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