Skip to content

[cssom] Consider changing the definition of getComputedStyle when called from a different document to match reality. #2403

@emilio

Description

@emilio

Somewhat related to #1548 and #1964.

Right now the spec doesn't really match any implementations. Implementations usually return the style of the element styled as the document it's in (Firefox doesn't in some cases, I can try to explain if people are curious).

In any case, for a visible iframe and an element in the document, the behavior of all engines is definitely not the one required by the spec in https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle:

Note: This means that even if obj is in a different document (e.g. one fetched via XMLHttpRequest) it will still use the style rules associated with the document that is associated with the global object on which getComputedStyle() was invoked to compute the CSS declaration block.

And they just return the style of the element for the document they're in.

cc @lilles @FremyCompany @bzbarsky @dbaron

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions