Skip to main content

Bug Tracker

Side navigation

#9500 closed bug (duplicate)

Opened June 02, 2011 06:32PM UTC

Closed June 29, 2011 06:50PM UTC

Last modified March 09, 2012 06:36AM UTC

$('html, body').removeAttr('style') fails in Webkit browsers.

Reported by: waynepurtonsmith@hotmail.co.uk Owned by:
Priority: low Milestone: 1.next
Component: attributes Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:
Description

While doing

$('html, body').css('overflow', 'hidden');

It works, but until this part (in Webkit browsers) it fails to do this:

$('html, body').removeAttr('style');

jsFiddle test: http://jsfiddle.net/9CLfd/

Attachments (0)
Change History (4)

Changed June 02, 2011 06:52PM UTC by timmywil comment:1

component: unfiledattributes
priority: undecidedlow
status: newopen

This is legit, but it's a quirk in webkit: http://jsfiddle.net/timmywil/9CLfd/2/

overflow is automatically converted asynchronously to overflow-x/overflow-y, which happens after the removeAttr call. We can fix by adding a call to attr to set the style tag to empty string before removal, but I'd hate to add another function call to every removeAttr.

Changed June 02, 2011 07:11PM UTC by anonymous comment:2

Ah I see now. Thanks for that fix. Surely this "bug" can be fixed in the jQuery core that remove asynchronous styles?

Changed June 29, 2011 06:50PM UTC by timmywil comment:3

resolution: → duplicate
status: openclosed

removeAttribute('style') even without this overflow conversion has problems, so I'll close this ticket as a dup of the more enveloping issue.

Changed June 29, 2011 06:50PM UTC by timmywil comment:4

Duplicate of #9699.