w3c / w3c/csswg-drafts

[cssom-1] Should `CSSStyleSheetInit.baseURL` be validated?

Open
#12,974 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cssom-1
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

baseURL is a CSSStyleSheet.constructor() argument that allows setting the style sheet base URL, which is:

The base URL to use when resolving relative URLs in the stylesheet. Null by default. Only non-null for stylesheets that have constructed flag set.

Chrome always ignores it (WPT). Firefox seems to handle an absolute URL or a relative URL ending with /, eg. /css/, ./css/, css/, but /css, ./css, css, are ignored.

Besides, WPT expects CSSStyleSheet.constructor() to throw NotAllowedError for an invalid base URL, which seems unspecified, noting that the style sheet base URL is used to compute a style resource base URL, while this procedure presumably expects an absolute URL. Should it be absolutized?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the CSSOM-1 definition of CSSStyleSheetInit.baseURL and the linked CSSStyleSheet-constructable-baseURL.html WPT. Compare the specification's URL handling with the browser behavior and test expectation. Done means the specification clearly resolves validation and absolutization, with the WPT expectation aligned.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.