Bug Tracker

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#14150 closed bug (fixed)

IE9-10 curCSS => "Interface not supported" in for popups (and probably frames)

Reported by: price.c@… Owned by:
Priority: low Milestone: 1.11/2.1
Component: css Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:


The fix for bug #10373 in commit f7ee1f6e59f0b465f5f64bf6ac52108e445efaac broke the getComputedStyle functionality for elements residing in popups or frames accessed from the main document.

The following jsfiddle demonstrates the problem, choose jQuery 1.7.2 and the problem disappears.


This was also reported by a comment on #10373 http://bugs.jquery.com/ticket/10373#comment:7.

Change History (10)

comment:1 Changed 4 years ago by gibson042

Status: newopen

Seems like a reasonable one-line change to me, though I wish we had better non-browser testing to be sure.

comment:2 Changed 4 years ago by anonymous

I've patched it on the 1.8-stable branch on my fork on GitHub (chrisprice) but I'm not sure how to add tests. It doesn't seem to be reproducible in an iframe.

comment:3 Changed 4 years ago by dmethvin

On the general need, since we've talked about requiring a browser-like window object for environments like node.js it does seem rather annoying. However, is there any browser-like simulator for node that could handle $(elem).width() anyway? In the cases where I've used jQuery I've just wanted selection and traversing, perhaps you could add manipulation to that but the rest seems too browser specific to be used.

It sounds like the crash only happens in a window.open window, I'm not sure we want to add a test that requires calling it. Ensuring that document.defaultView works may be enough?

The currently active branches are 1.x-master and master (which is 2.x). The PR should be against one of those, ideally both but if it's easy to cherry pick there should be no problem with just having one PR for now.

comment:5 Changed 4 years ago by gibson042

@dmethvin That's fair, but we probably don't want to crash on .css( property ). As for reproducibility, I can confirm that the error does not manifest in iframes: http://jsfiddle.net/VYNj9/2/

As for testing... man, that's tough. If we don't put in a window.open, we're likely to see a regression at some point, but if we do, we're likely to have other problems with it.

comment:6 Changed 4 years ago by gibson042

#12235 is the original reason for window.getComputedStyle( elem, null ), but we never questioned the reporter about what ey was doing with CSS on jsdom to run afoul of the bug.

comment:7 Changed 4 years ago by timmywil

Component: unfiledcss
Milestone: None1.10.3/2.0.4
Priority: undecidedlow

comment:8 Changed 4 years ago by Chris Price

Resolution: fixed
Status: openclosed

Fix #14150: revert to ownerDocument.defaultView.getComputedStyle. Close gh-1311.

Changeset: 3e3680c2cdc524ee9194ef27fdce318cf301144c

comment:9 Changed 4 years ago by dmethvin

Milestone: 1.10.3/

Bulk update for new milestone

comment:10 Changed 3 years ago by Oleg Gaidarenko

CSS: Do not throw on frame elements in FF

IE9-10 throws on elements created in popups (see #14150), FF meanwhile throws on frame elements through "defaultView.getComputedStyle" (see #15098)

Use "defaultView" if in the popup which would fix IE issue, use "window.getComputedStyle" which would fix FF issue.

And everybody wins, except performance, but who cares right?

Fixes #15098 Closes gh-1583

Changeset: e488d985cfb10ab8c684bbc6a9b8ff3eae23bf83

Note: See TracTickets for help on using tickets.