Page MenuHomePhabricator

Absolutely positioned content can leak out of the real-time preview area
Closed, ResolvedPublic

Assigned To
Authored By
matmarex
Aug 11 2022, 10:45 PM
Referenced Files
F35427660: image.png
Aug 11 2022, 10:45 PM
F35427658: image.png
Aug 11 2022, 10:45 PM
F35427669: scroll.webm
Aug 11 2022, 10:45 PM
F35427612: image.png
Aug 11 2022, 10:45 PM
F35427606: image.png
Aug 11 2022, 10:45 PM
F35427598: image.png
Aug 11 2022, 10:45 PM
F35427593: image.png
Aug 11 2022, 10:45 PM

Description

Absolutely positioned content can leak out of the real-time preview area.

For example:

The leaking content also stays in place while scrolling the preview area:

@Ryasmeen originally noticed this problem affecting DiscussionTools's comment highlights while testing T309423:

https://en.wikipedia.beta.wmflabs.org/wiki/Talk:Polar_bear

image.png (2Γ—3 px, 529 KB)
image.png (2Γ—3 px, 499 KB)

Event Timeline

It seems that adding position: relative; to .ext-WikiEditor-realtimepreview-preview fixes the issue, by making the position of all these elements be computed relative to that element (it becomes the containing block).

Change 825371 had a related patch set uploaded (by Samtar; author: Samtar):

[mediawiki/extensions/WikiEditor@master] RealtimePreview.less: Add position: relative to preview class

https://gerrit.wikimedia.org/r/825371

Found T315894: Realtime preview "reload" button overlays the "expand" on a right aligned collapse link while attempting to replicate this β€” how did you resolve that @matmarex?

Used keyboard navigation to toggle the navbox (pressed Tab / Shift+Tab until I reached the button, then Enter to toggle it).

Change 825371 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@master] RealtimePreview.less: Add position: relative to preview class

https://gerrit.wikimedia.org/r/825371

dom_walden added subscribers: GMikesell-WMF, dom_walden.

I cannot reproduce the bug anymore on the two articles from the description.

@GMikesell-WMF and I have tested various articles on cawiki, enwiki, frwiki, dewiki, arwiki, jawiki, zhwiki and a few more. We did not notice any significant styling bugs in the Preview pane.

Moreover, to check that adding position: relative didn't change anything else, I used the browser tools to remove it and see if anything changes.

There can still be leaking of content which has a fixed position (see https://en.wikipedia.beta.wmflabs.org/w/index.php?title=User:IL7Soulhunter/Archive_1&action=edit). Is there anything we can do about this, @TheresNoTime?

We have also changed the behaviour of T310064 (but not completely fixed it). See T310064#8210708.

Test environment: Various production wikis (see above) WikiEditor 0.5.3 (eb9a889) 07:16, 29 August 2022.
Test browser: Firefox 91.

β€’ NRodriguez subscribed.

We have also changed the behaviour of T310064 (but not completely fixed it). See T310064#8210708.

We can disclose/resolve that one separately

There can still be leaking of content which has a fixed position (see https://en.wikipedia.beta.wmflabs.org/w/index.php?title=User:IL7Soulhunter/Archive_1&action=edit). Is there anything we can do about this, @TheresNoTime?

If needed, let's cut a separate task for fixed since the scope of this one is about absolute
Resolving for now!