Skip to content

Choose a tag to compare

@byteface byteface released this 26 Nov 23:13

domonic 1.9.0

Fixes as results of WPT conformance in Chromonic

Highlights

  • Forms and links navigate. In a Window, form.submit(), requestSubmit() and a.click() load the next page. document.cookie and cookieStore share the window's cookie jar, and window.fetch is the page's fetch.
  • await works. await win.fetch(url), or await any Promise.
  • Requests look like a browser's. The window sends navigator.userAgent, Accept and Accept-Language (from navigator.languages). Set navigator.userAgent to change it.
  • setHTML() and the Sanitizer are fixed. They use the real HTML parser, so Tom & Jerry stays Tom & Jerry, and their output can't run script when a browser re-reads it. Tested against known sanitizer bypasses.
  • innerText is the rendered text, as in a browser, and it's now a property.
  • More of the HTML APIs:
    • attributes as typed properties (img.alt, input.required, td.colSpan, ...);
    • the table API (rows, tBodies, insertRow, cells);
    • form controls (valueAsNumber, stepUp, the selection API, labels, <output>, <progress>, <meter>);
    • <audio>/<video> playback state;
    • <dialog> modal state and returnValue;
    • ElementInternals, moveBefore, checkVisibility;
    • document.location.
  • CSS:
    • nesting, revert and revert-layer, and logical properties;
    • min(), max(), clamp(), nested calc() and viewport units;
    • hwb(), light-dark() and system colours;
    • Media Queries 4;
    • the grid, border-image and all shorthands;
    • many computed-value fixes.
  • Selectors:
    • :is(), :where() and :not() take complex selectors, and :has() takes any relative selector;
    • :scope works;
    • the attribute i flag works;
    • pseudo-classes can come before a class (li:nth-child(2).x).
  • Deeply nested pages no longer crash. Cloning, innerHTML, textContent, innerText, TreeWalker and XPath work thousands of levels deep.
  • One dependency fewer: cssselect is gone.

Changes you may notice

  • innerHTML and outerHTML escape < and > inside attribute values, as Chrome 138+ and Firefox 140+ do. <noscript> text is escaped too.
  • str() writes only real boolean attributes without a value: value="" now prints as value="".
  • A Window's requests send navigator.userAgent, not python-requests/....
  • localStorage and sessionStorage are kept per site.
  • A new Window starts on about:blank.
  • Reading element.style no longer rewrites the style attribute.
  • Date(ms) takes milliseconds, and Date() has no time-zone offset.
  • querySelectorAll(":contains(...)") no longer matches. It came from cssselect, and browsers reject it. Use BeautifulSlop's select(":-soup-contains(...)") instead.

BeautifulSlop

  • select() supports :-soup-contains(), :-soup-contains-own() and :contains().
  • find("html"), select("html") and find_all(True) include the page's <html>. A soup made from one top-level element can find that element.
  • limit=0 means no limit, as in Beautiful Soup.

Full Changelog: 1.8.5...1.9.0