Add scroll/scrollend listeners and scrollTop/scrollLeft attributes#146
Open
mikesol wants to merge 1 commit into
Open
Add scroll/scrollend listeners and scrollTop/scrollLeft attributes#146mikesol wants to merge 1 commit into
mikesol wants to merge 1 commit into
Conversation
- Add cssom-view-1 events source to HTML codegen: generates `scroll`, `scrollend`, and de-duplicates `resize` from the CSSOM View spec - Add cssom-view-1 idlparsed source so interface resolution picks up Element extensions from that spec - Add fixHTML to Main.purs: manually adds scrollTop and scrollLeft as TypeNumber attributes (DOM properties, not HTML attributes) to the Element interface - Add special-case handling in DOMInterpret.setPropEffect for scrollTop and scrollLeft, using Web.DOM.Element.setScrollTop/setScrollLeft (DOM property assignment, not setAttribute) - Fix EventDef.src to be Maybe to handle cssom-view-1 events without src - Fix Parse.purs attribute deduplication: use nubBy index (generated identifier) instead of nubBy name (raw attribute name) to correctly deduplicate e.g. pathLength vs path-length - Fix fixSVG duplicate-check to compare by generated identifier, not raw name: this eliminates the duplicate pathLength_ definition that would otherwise arise in Deku.DOM.SVG.Attributes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scrollandscrollendevent listeners (from CSSOM View spec)scrollTopandscrollLeftasNumber-typed attributespathLengthandpath-lengthin SVG were generating duplicatepathLength_definitionsDetails
scroll/scrollend events — Added
cssom-view-1.jsonto the HTML event sources. The events are typed asEvent(same asresize,load, etc.).scrollTop/scrollLeft — These are DOM properties (not HTML attributes), so
setAttributedoesn't work on them. Two changes:Main.pursfixHTML: addsscrollTop/scrollLeftasTypeNumberattributes on theElementinterfaceDOMInterpret.purs: special-casesscrollTop/scrollLeftinsetPropEffectto callWeb.DOM.Element.setScrollTop/setScrollLeftdirectlyUsage:
Bug fix (bonus)
nubByinParse.purswas deduplicating attributes by raw name (e.g."path-length") rather than by generated identifier ("pathLength"). Combined withfixSVGchecking raw names against a generated-name list (svgPresentationMembersuses camelCase), this produced a duplicatepathLength_definition inDeku.DOM.SVG.Attributeswhen codegen was re-run against current webref data.Fixed by:
Parse.purs:nubBy indexinstead ofnubBy namefixSVG: check existence by generated identifier (afterunSnake), not raw name🤖 Generated with Claude Code