Closed Bug 1494440 Opened Last year Closed 11 months ago

Overscroll-behavior does not apply to document inside iframe unless overflow:auto is also present

Categories

(Core :: Panning and Zooming, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox63 --- wontfix
firefox64 --- fixed
firefox65 --- fixed

People

(Reporter: botond, Assigned: botond)

References

Details

Attachments

(4 files)

Attached file Testcase
In the attached testcase, there is an iframe with scrollable contents, on a page that's itself scrollable.

The iframe's <html> element is styled overscroll-behavior:none.

This should mean that scrolling does not get handed off from the iframe to the page, but it does.

If we also add overflow:auto to the iframe's <html> element's style, it now works as expected.
Attachment #9012340 - Attachment mime type: text/plain → text/html
Priority: -- → P3
We appear to be missing a check for overscroll-behavior in CheckOverflow() [1].

I have a vague recollection of looking at CheckOverflow() when writing the implementation of overscroll-behavior, and deciding that we didn't want overscroll-behavior there, but I can't remember why, and thinking about it again it seems clear that we do want it there.

[1] https://searchfox.org/mozilla-central/rev/b096dcf0ea226af628fe03f7e7acb56a25853533/layout/base/nsPresContext.cpp#1335
Assignee: nobody → botond
Depends on: 1496864
Depends on D11268
Pushed by bballo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3c79925fd980
Include overscroll-behavior in the styles propagated to the viewport. r=mstange
https://hg.mozilla.org/integration/autoland/rev/7d6b8cc1052f
Upgrade more apz_test_native_event_utils functions to accept a window as an argument. r=kats
https://hg.mozilla.org/integration/autoland/rev/8f22b0cb6d43
Add a mochitest. r=kats
https://hg.mozilla.org/mozilla-central/rev/3c79925fd980
https://hg.mozilla.org/mozilla-central/rev/7d6b8cc1052f
https://hg.mozilla.org/mozilla-central/rev/8f22b0cb6d43
Status: NEW → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Flags: in-testsuite+
I actually think we could uplift this fix to 64, it's trivially simple. (Not the test though, as that depends on bug 1496864.) Approval request coming up.
Comment on attachment 9023487 [details]
Bug 1494440 - Include overscroll-behavior in the styles propagated to the viewport. r=mstange

[Beta/Release Uplift Approval Request]

Feature/Bug causing the regression: Bug 951793

User impact if declined: (Not really a regression, but a bug in the implementation of overscroll-behavior.)
Iframes with overscroll-behavior:none or :contain still allow handing off scrolling to the parent page in many cases.

Is this code covered by automated tests?: Yes

Has the fix been verified in Nightly?: Yes

Needs manual test from QE?: No

If yes, steps to reproduce: 

List of other uplifts needed: None

Risk to taking this patch: Low

Why is the change risky/not risky? (and alternatives if risky): Very simple 2-line fix.

String changes made/needed: none
Attachment #9023487 - Flags: approval-mozilla-beta?
^ The above approval request applies to the first patch only. (The other patches are to test code and they depend on bug 1496864 which was not uplifted.)
Comment on attachment 9023487 [details]
Bug 1494440 - Include overscroll-behavior in the styles propagated to the viewport. r=mstange

fix an issue with overscroll-behavior, approved for 64.0b10
Attachment #9023487 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.