Open Bug 1603794 Opened 6 years ago Updated 2 years ago

Layout difference between Firefox and Chrome on https://ereader.learning.amplify.com

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

People

(Reporter: miketaylr, Unassigned)

References

()

Details

Attachments

(3 files)

Sorry I don't have a better title for this, please update it.

Originally filed at https://github.com/webcompat/web-bugs/issues/46408

The original bug describes a redirect that requires Chrome, but if you spoof as Chrome in Firefox, you end up with a busted layout (which maybe explains the redirect?).

https://codepen.io/miketaylr/pen/MWYjaEQ shows the issue: in Firefox, the "Student / Educator" buttons are below the viewport, but in Chrome they're visible and to the right.

The weird thing about https://bug1603794.bmoattachments.org/attachment.cgi?id=9115808 is if I shrink the viewport in Firefox until the media query kicks in, if I expand it again, I get the same results as Chrome.

Furthermore, in https://bug1603794.bmoattachments.org/attachment.cgi?id=9115809, Chrome and Firefox are consistent and the only difference is a margin: 0 style missing from the first.

Attached file 46408.html
Webcompat Priority: --- → ?

Hmm, viewport units and scrollbars, fun. So this depends on whether the browser initially assumes there are going to be scrollbars for the viewport or not.

Viewport units don't account for scrollbars per spec, so if you start layout assuming there is a scrollbar, then the right box overflows, and creates a scrollbar. If you start without a scrollbar, then the right box just fits, and there's no need to create one.

This can be fixed trivially with :root { overflow: hidden } (or scrollbar-width: none)...

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

This can be fixed trivially with :root { overflow: hidden } (or scrollbar-width: none)...

(Good to know, I've attempted outreach for this site to understand why they block us in the first place. Assuming they respond I'll pass this along)

Seems chrome agrees with us here... I think this is probably a Chrome bug then.

Oh, it does show the difference, nvm.

This seems to be because we guess that there's going to be a vertical scrollbar for the root here, which causes the content to overflow... InInitialReflow() returns false because we unconditionally return false if we're the root (that's a bit weird).

Boris, you seem familiar with that bunch of conditions... Does it seem reasonable to get rid of it assuming there's no performance regression?

Flags: needinfo?(bzbarsky)
Priority: -- → P3

Sure; it's a performance optimization, so if there is no performance impact...

Do we still have the "get the state from global history" thing going on? Because if we do, it might affect repeated loads (like Talos), so we'd need to be a bit careful with testing this.

Flags: needinfo?(bzbarsky)
Webcompat Priority: ? → P3
Severity: normal → S3

Note: this requires non-overlay scrollbars to reproduce.

Two linked webcompat issues no longer showing unsupported message, unsetting webcompat priority

Webcompat Priority: P3 → ---
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: