mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-11-02 03:09:09 +08:00
A CSSStyleSheet imported as a CSS module script has the constructed flag set (https://wicg.github.io/construct-stylesheets/#cssstylesheet-constructed-flag). This is because it is useful to treat imported CSSStyleSheets the same way as stylesheets created via `new`. For example we want to be able to add both to document.adoptedStyleSheets, and we want both to treat @import rules the same way. Up to this point DevTools didn't show sources for constructed stylesheets because they were all assumed to be sheets created with `new`. But, we do want to show sources for constructed sheets created for CSS module script imports. So, this change checks for an empty sourceURL when deciding whether or not to show source for a constructed stylesheet. This requires the Blink change [1], which starts passing an empty sourceURL for `new`ed stylesheets. [1] Blink change: https://chromium-review.googlesource.com/c/chromium/src/+/2964539 Bug: 1125357 Change-Id: I7163966c66c990647e40a72d0ef9d6ba30f41cfb Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2964580 Reviewed-by: Alex Rudenko <alexrudenko@chromium.org> Reviewed-by: Mathias Bynens <mathias@chromium.org> Commit-Queue: Dan Clark <daniec@microsoft.com>