Bug Tracker

Opened 9 years ago

Closed 8 years ago

#6843 closed bug (fixed)

computed Style bug when filtering over text nodes

Reported by: lathan Owned by: lathan
Priority: high Milestone: 1.4.3
Component: css Version: 1.4.2
Keywords: css contents style computed getComputedStyle defaultView Cc:
Blocked by: Blocking:

Description

line 4697 (of jquery1.4.2) var computedStyle = defaultView.getComputedStyle( elem, null );

This throws an exception when you do contents(':hidden') on an element that has child text nodes. (uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsIDOMViewCSS.getComputedStyle]" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: /jquery.js :: anonymous :: line 4697" data: no])

This defaultView.getComputedStyle function does not work on text nodes.

example page attached.

I believe this bug is similiar to #4343 and #6647 both of which were marked invalid due to lack of example.

Attachments (1)

test-case.html (426 bytes) - added by lathan 9 years ago.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by lathan

Attachment: test-case.html added

comment:1 Changed 9 years ago by dmethvin

Thanks for taking the time to track this one down! The NS_ERROR_XPC_BAD_CONVERT_JS error has shown up in a few tickets, but without a clear and simple test case.

comment:2 Changed 8 years ago by Rick Waldron

Owner: set to lathan
Priority: undecided
Status: newpending

Please provide a reduced jsFiddle test case using jQuery 0 GIT, thanks!

comment:3 Changed 8 years ago by jitter

Priority: undecidedhigh
Status: pendingopen

comment:4 Changed 8 years ago by jitter

Resolution: fixed
Status: openclosed

Ported the test case from the attachment to jsfiddle http://jsfiddle.net/jitter/8ZEcY/

Fails to work in 1.4.2. If you switch to 1.4.3/1.4.4 the error doesn't happen anymore.

Note: See TracTickets for help on using tickets.