Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scroll bubbling monkeypatches #71

Merged
merged 15 commits into from
Jul 31, 2023
26 changes: 26 additions & 0 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ spec: RFC8941; urlPrefix: https://www.rfc-editor.org/rfc/rfc8941.html
text: structured header; url: #section-1
for: structured header
text: token; url: name-tokens
spec: CSS; urlPrefix: https://www.w3.org/TR/cssom-view-1/
type: dfn
text: scroll a target into view; url: #scroll-an-element-into-view
blu25 marked this conversation as resolved.
Show resolved Hide resolved
text: run the scroll steps; url: document-run-the-scroll-steps
blu25 marked this conversation as resolved.
Show resolved Hide resolved
spec: permissions-policy; urlPrefix: https://w3c.github.io/webappsec-permissions-policy
type: dfn
text: ASCII-serialized policy directive; url: serialized-policy-directive
Expand Down Expand Up @@ -2239,3 +2243,25 @@ achieve the outcomes described in the above explanatory content.
/fenced-frame/permission-geolocation.https.html
/fenced-frame/permission-notification.https.html
</wpt>

<h3 id=cssom-monkeypatch>CSSOM View</h3>
blu25 marked this conversation as resolved.
Show resolved Hide resolved

The <a href=https://www.w3.org/TR/cssom-view-1>CSSOM View Module</a> defines scroll bubbling behavior
through the [=scroll a target into view=] algorithm. Our specification modifies it to not allow
scrolling a target into view if it is inside of a fenced frame.

Modify the [=scroll a target into view=] algorithm to add 2 steps after step 1 that reads:

2. If the <var ignore=''>target</var>-associated {{Document}}'s [=node navigable=]'s
[=navigable/traversable navigable=] is a [=fenced navigable container/fenced navigable=], terminate these steps.
3. If the <var ignore=''>target</var>-associated {{Document}}'s [=Document/ancestor navigables=] contains
a [=navigable=] whose [=navigable/traversable navigable=] is a [=fenced navigable container/fenced navigable=],
terminate these steps.

Modify the [=run the scroll steps=] algorithm to add a check after step 1.1 that reads:

2. If <var ignore=''>target</var> is a {{Document}} whose [=node navigable=]'s
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This matches the impl behavior that doesn't propagate scroll events into a fenced frame. Is this the expected behavior? I wrote this just to match what we currently have in impl, but if this isn't what the behavior is supposed to be, we should file a crbug to fix.

[=navigable/traversable navigable=] is a [=fenced navigable container/fenced navigable=],
continue.
blu25 marked this conversation as resolved.
Show resolved Hide resolved

Note: This ensures that scroll events do not affect fenced frames.
blu25 marked this conversation as resolved.
Show resolved Hide resolved