Skip to content

Commit 5fb76a8

Browse files
authored
Add patch for cssom-view-1 scroll events (#1690)
The `scroll` and `scrollend` events fire on `Document`, `Element`, `VisualViewport` but only bubble on `Document`. The crawler fails to capture that nuance. The update also drops a previous event patch for the spec that is no longer necessary.
1 parent 5646853 commit 5fb76a8

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

tools/amend-event-data.js

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,32 @@ const patches = {
104104
change: { interface: "CookieChangeEvent" }
105105
}
106106
],
107-
// pending https://github.com/w3c/csswg-drafts/pull/7466/files
107+
// Scroll events bubble or not, depending on target, crawl does not
108+
// capture that nuance given how the algorithm is currently written
108109
'cssom-view-1': [
109110
{
110-
pattern: { type: "change" },
111-
matched: 1,
112-
change: { interface: 'MediaQueryListEvent' }
111+
pattern: { type: /^scroll(end)?$/ },
112+
matched: 2,
113+
change: {
114+
targets: [ "VisualViewport", "Element" ],
115+
bubbles: false
116+
}
117+
},
118+
{
119+
add: {
120+
type: "scroll",
121+
interface: "Event",
122+
bubbles: true,
123+
targets: [ "Document" ]
124+
}
125+
},
126+
{
127+
add: {
128+
type: "scrollend",
129+
interface: "Event",
130+
bubbles: true,
131+
targets: [ "Document" ]
132+
}
113133
}
114134
],
115135
// pending resolution of https://github.com/w3c/csswg-drafts/issues/7603

0 commit comments

Comments
 (0)