Bug 36066 - Visibility fails to render correctly on dynamic page
Summary: Visibility fails to render correctly on dynamic page
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Nobody
URL: http://bugs.matthewrconsultancy.co.uk...
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-12 11:25 PST by Matthew
Modified: 2013-10-01 12:40 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew 2010-03-12 11:25:42 PST
On a page where there are elements which are set to display none as the DOMContentLoaded event occurs. Child elements with visibility:visible of a sufficiently distanced (child of child in DOM tree) parent element with visibility:hidden do not display when their display is set to block.

I have made this demo to easily demonstrate the problem.

Toggling the visibility of the root parent from hidden to visible and back to hidden again makes these child elements appear correctly, but only if one or more were set to display block before this toggle. Doing this toggle again after setting them both to display none again breaks the rendering again.

This works fine in all other major rendering engines. It only affects webkit. (Note that in order to simplify the demo code I replaced jQuery (which made the demo work in IE) with minimal javascript, this javascript is incompatible with trident/IE as it uses a DOMContentLoaded event.)

The design that made me boil down a demo page behaves a bit differently, for some reason it allows only one of the two popups to display at any one time. I have created a work around to make it work properly which works by forcing a re-evaluation of visibility. I can demo that slightly different problem if required.

I have tried this on (and got consistent results with):
Webkit Nightly Build for Windows (4.0.5 531.22.7)
Safari for Windows (4.0.4)
Latest Google Chrome Dev for Windows (5.0.342.3)
Latest Google Chrome Stable for Windows (4.0.249.89)
Latest Google Chrome Dev for Ubuntu Linux (5.0.342.1)

I have got working and expected behaviour from:
Firefox 3.6
Opera 10.5
Internet Explorer 8* (with jQuery doing toggle instead of Demo javascript)
Comment 1 Matthew 2013-10-01 10:02:51 PDT
After receiving an update on this bug via email (having forgotten about it for a long time) I can confirm that the latest versions of Chrome do not show this bug and work properly.
Comment 2 Alexey Proskuryakov 2013-10-01 12:40:36 PDT
This appears to work in WebKit too now (Chrome forked WebKit, so testing it is not relevant for bugs.webkit.org bugs any more).