Page MenuHomePhabricator

Use DOM append instead of z-index to position lightbox
Open, LowPublic

Description

Krinkle says z-index isn't as reliable and that position: absolute should be enough if we're the last thing in the <body> element.


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=60405

Details

Reference
bz56403

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:24 AM
bzimport added a project: MediaViewer.
bzimport set Reference to bz56403.
bzimport added a subscriber: Unknown Object (MLST).

I don't think so - anything with a z-index would still be above the lightbox.

Also, AFAIK z-index is reliable enough as long as you are using it on direct children of the <body> - the IE6 bug is related to z-indexed elements having non-static parents.

The z-index on .mlb-fullscreen-div is pointless, however - its parent also has a z-index so that one will determine how it is placed.

I guess the idea here is that we should *all* be using the append-to-DOM method as opposed to the z-index method, because the z-index method is DUMB.

What else is using z-index right now, that would prevent us from moving to append? Isn't it risky to bet on the fact that all other extensions will play nice and not use z-index?

The backdrop, wrapper, and maybe the file usage dialog(s) are all using various values for z-index. Apparently the buttons are, too.

It shouldn'

...t be too hard to fix this, though, it's just a matter of making sure everything works well.

Honestly we could probably display:none the rest of the DOM while the lightbox is open.

...oh, we do already. We don't need z-index for that, then.

We are appending to the end of the body (maybe that was different when this bug was opened), but I see no good reason not to have a z-index as well. Any administrator on any wiki can put a z-index rule into MediaWiki:Common.css and cause us problems. Is there ever a valid reason to position something above the lightbox? (Notifications, maybe?)

...although display:none works as well.

Yep, display: none is being applied already (could be taken a little bit further, though, by hiding all children except the mmv elements, currently it uses a whitelist). I think we can safely get rid of z-index. Any objections?

Mass-removing the Multimedia tag from MediaViewer tasks, as this is now being worked on by the Reading department, not Editing's Multimedia team.

See T158468: CentralNotice buttons appear over media viewer panel on mobile for an example of why you should not rely on the assumption that no one else uses z-index.