Skip to content

JS/CSSOM: document.styleSheets and CSSStyleSheet rule mutation APIs #339

Description

@mplsllc

Status

MacSurf has real inline-style mutation and full-document recascade/reconvert support, but the JavaScript CSSOM stylesheet surface is not currently represented in the issue tracker. Repository search finds no current document.styleSheets / CSSStyleSheet.insertRule / deleteRule implementation.

This matters for libraries that inject or edit stylesheet rules rather than setting element.style or adding <style> text directly.

V1 scope

  • document.styleSheets collection for author stylesheets.
  • Basic CSSStyleSheet wrappers.
  • cssRules read access for ordinary style rules.
  • insertRule(rule, index).
  • deleteRule(index).
  • Trigger the existing style invalidation/reconvert pipeline after rule mutation.

Defer the complete CSSOM type hierarchy, constructable stylesheets, adoptedStyleSheets, and every specialized rule interface until driven by real pages.

Acceptance

A script can inspect a page stylesheet, insert a .probe { color: red } rule, see it affect an existing element, then delete that rule and see the style revert. Wrapper ownership survives navigation without leaking stale stylesheet objects. Focused QuickJS/libcss tests plus iMac 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