Skip to content

Fix offsetWidth and scroll bindings #13

Open

Description

@thomashoneyman

Found four existing bugs while checking the Spago migration. They reproduce on both the original code and the migrated code; the migration does not change these bindings.

  • HTMLElement.offsetWidth reads offsetWodth, so it returns undefined. A 180px-wide element with a 3px border on each side should return 186.
  • Window.scroll calls scrollBy instead of scroll.
  • Window.scrollTo also calls scrollBy. For both window methods, start at (31, 67), then request (13, 29) with instant scrolling. They move to (44, 96) instead of (13, 29).
  • Element.scroll calls scrollIntoView instead of scroll. On an overflowing element starting at (43, 79), requesting (13, 29) leaves its own scroll position at (43, 79).

The bindings are in HTMLElement.js, Window.js, and Element.js.

Checked in Chromium using the compiled PureScript modules. For the scroll cases, use a page/element large enough to scroll in both directions and start at nonzero coordinates. Starting at zero hides the window bug. Firefox and Safari have not been checked.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions