Bug 13103

Summary: REGRESSION (r15069): getPropertyValue() returns null when element has display: none (affects Technorati.com)
Product: WebKit Reporter: Stef Pause <stef.pause>
Component: DOMAssignee: Dave Hyatt <hyatt>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, dev+webkit, hyatt, mepard, mitz, mrowe
Priority: P1 Keywords: HasReduction, InRadar, Regression
Version: 523.x (Safari 3)   
Hardware: Mac (PowerPC)   
OS: OS X 10.4   
URL: http://technorati.com/
Attachments:
Description Flags
Reduction
none
Honor display property when we have no renderer. mitz: review+

Description Stef Pause 2007-03-17 16:31:24 PDT
Go to Technorati.com and click the "Sign In" link at the top-right.  This onclick JavaScript should cause the div id="signin" to change its style (via a slide effect) to "display: block;" which it does correctly in Safari v2.0.4, Firefox, Camino, etc.  However, in the latest Webkit nightly it slides down then immediately changes back to "display: none;".  This obviously makes it somewhat difficult to sign in ;)

The relevant JavaScript is:
onclick="if(document.all) $('select').hide();if($e('signin').style.display=='block') {$('#signin').slideUp('fast'); } else { $('#signin').slideDown('fast');$e('username').focus()};return false"

I'm not entirely sure if it's a Javascript bug or a DOM bug, I suspect the former, so I've filed it under "New Bugs".
Comment 1 Matt Lilek 2007-03-18 22:20:36 PDT
Created attachment 13701 [details]
Reduction

The heart of this bug is that when an element has display: none, getPropertyValue() returns null instead of 'none' like Firefox/Opera.

This works in Safari 2.0.4 because jQuery (Technorati's JS framework of choice) checks if the getComputedStye() returns null, which Safari 2.0.4 does when an element has display: none.  In that case they then check if they're looking for the display property and return 'none'.

The reason this disappears in ToT after the animation is because we don't return 'none', jQuery's animation gizmo never gets sets the display as block permanently when it's finished, presuming we're handling that ourselves (ie: we want it to be display: inline) and removes the temporary display: block it added during animation.
Comment 2 Maciej Stachowiak 2007-03-19 11:51:34 PDT
<rdar://problem/5072345>
Comment 3 mitz 2007-03-26 12:55:11 PDT
*** Bug 13193 has been marked as a duplicate of this bug. ***
Comment 4 mitz 2007-03-26 13:48:47 PDT
Regressed in <http://trac.webkit.org/projects/webkit/changeset/15069>. Safari 2 returns null from getComputedStyle() if the element doesn't have a renderer. r15069 and later return a CSSStyleDeclaration (which subsequently return null for all properties, see bug 12384).
Comment 5 Dave Hyatt 2007-03-29 01:27:07 PDT
Created attachment 13859 [details]
Honor display property when we have no renderer.
Comment 6 mitz 2007-03-29 01:27:46 PDT
*** Bug 13223 has been marked as a duplicate of this bug. ***
Comment 7 mitz 2007-03-29 01:40:34 PDT
Comment on attachment 13859 [details]
Honor display property when we have no renderer.

Needs a change log and a layout test. Also make sure that existing tests pass or are updated as needed. r=me
Comment 8 Dave Hyatt 2007-03-29 01:58:34 PDT
Fixed in r20570.