Skip to content

JS: matchMedia / MediaQueryList must evaluate real viewport media queries #342

Description

@mplsllc

Status

Current QuickJS capability auditing says matchMedia() answers false to every query. The API exists, but the returned answer is not connected to MacSurf's real media-query evaluator or viewport state.

Scope

  • Parse/evaluate a media query through the same media-feature semantics used by author CSS where possible.
  • Return a MediaQueryList with correct media and matches.
  • Support change notification (change event / listener compatibility) when viewport-relevant state changes.
  • Keep JS and CSS media-query answers consistent for width/height/orientation and other features MacSurf actually supports.

Do not fabricate support for media features the CSS engine itself cannot evaluate.

Acceptance

For a known viewport, (min-width: 500px) and (max-width: 500px) return opposite correct values; resizing across the threshold updates matches and fires one change notification; CSS and JS agree on the same query. Focused harness assertions and G3 verification.

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

    area: cssCSS engine, libcss, cascade, layoutarea: js-engineDuktape, ES5 evaluator, JS bindingsenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions