Hi Morten -

Appreciate the response. I spent some time looking at https://github.com/search?q=%22instanceof+CSSGroupingRule%22+language%3AJavaScript&type=code&l=JavaScript as well as "instanceof CSSRule" earlier, but didn't see anything immediately worrying (granted, it's hard to predict perfectly how the tooling-related scripts might handle sites in the wild that might ship the problematic patterns).

LGTM1 to ship.

On 5/9/24 6:16 AM, Morten Stenshorne wrote:
On Wed, 8 May 2024 at 17:18, Mike Taylor <miketa...@chromium.org> wrote:

    On 5/8/24 3:37 AM, Morten Stenshorne wrote:


            Interoperability and Compatibility

    Low risk. The one possible issue is if an author uses "instanceof
    CSSGroupingRule" or "instanceof CSSRule" with a page rule object
    and makes incorrect assumptions based on that. However, given
    that this is already shipping in Firefox (and also that in
    Firefox, even CSSStyleRule inherits from CSSGroupingRule, as the
    spec says - whereas Blink still doesn't), the risk should be very
    low.

    I agree the risk is likely very low, or contained to just a few
    sites/applications - have you done any investigation to try to
    find any problematic code examples that you mention (via GitHub
    search or HTTPArchive)?


There's a use counter - https://chromestatus.com/metrics/feature/timeline/popularity/4862 - for CSSPageRule, but I'm not sure how useful it is, since it will count as long as someone e.g. iterates over the rules in a style sheet and there happens to be an @page rule in there. The use is currently at 0.07, but the number isn't that useful, apart from being an absolute worst-case number.

Here's a constructed problematic case if CSSPageRule suddenly inherits from CSSGroupingRule:

```
<style>
  @media screen {
    div {
      color: hotpink;
    }
  }
  @page {
    margin: 1in;
    @top-center {
      content: "Header";
    }
  }
</style>
<script>
  for (const rule of document.styleSheets[0].cssRules) {
    if (rule instanceof CSSGroupingRule) {
      // Aha! You're a media rule! (d'oh!)
      // ...
    }
  }
</script>
```

How likely is that, though?

    /Gecko/: Shipped/Shipping
    (https://bugzilla.mozilla.org/show_bug.cgi?id=1868215)
    Noting that the patch should ship to Firefox release channel (126)
    in about a week, per https://whattrainisitnow.com/calendar/.


Ah, right. Pretty recent change.

On that note, earlier (some time in 2023), Firefox changed CSSStyleRule to inherit from CSSGroupingRule - https://github.com/w3c/csswg-drafts/issues/8940#issuecomment-1747351690 That sounds like a much riskyisher change, but allegedly it went just fine.


    /WebKit/: No signal
    Can we request a signal? Or do we have any other indications about
    their intentions here?


Done. https://github.com/WebKit/standards-positions/issues/346

--
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to blink-dev+unsubscr...@chromium.org.
To view this discussion on the web visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/ee67bf7d-78f9-4309-b831-00942ae69936%40chromium.org.

Reply via email to