aesthetic-suite / framework

🎨 Aesthetic is an end-to-end multi-platform styling framework that offers a strict design system, robust atomic CSS-in-JS engine, a structural style sheet specification (SSS), a low-runtime solution, and much more!
https://aestheticsuite.dev
MIT License
203 stars 5 forks source link

Vendor pseudos crash in other vendors #109

Closed milesj closed 3 years ago

milesj commented 3 years ago

Describe the bug

When inserting vendor pseudos into a different vendor, they can crash.

index.js:985 Uncaught DOMException: Failed to execute 'insertRule' on 'CSSStyleSheet': Failed to parse the rule '.m::-moz-focus-inner { border:0; }'.
    at StandardStyleSheet.BaseStyleSheet.injectRule (webpack:///./node_modules/@aesthetic/style/esm/index.js?:985:19)
    at eval (webpack:///./node_modules/@aesthetic/style/esm/index.js?:994:15)
    at Array.forEach (<anonymous>)
    at BaseStyleSheet.flushRules (webpack:///./node_modules/@aesthetic/style/esm/index.js?:993:24)

Steps to reproduce

Insert a pseudo that starts with -moz in Chrome/WebKit.

Expected behavior

Not to crash. We will most likely have to skip over these in unsupported browsers.

Screenshots

Environment

Platform: Web

  System:
    OS: macOS 10.15.5
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 207.37 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.18.3 - ~/.nvm/versions/node/v12.18.3/bin/node
    Yarn: 1.22.4 - ~/.nvm/versions/node/v12.18.3/bin/yarn
    npm: 6.14.6 - ~/.nvm/versions/node/v12.18.3/bin/npm
  SDKs:
    iOS SDK:
      Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
  Browsers:
    Chrome: 85.0.4183.83
    Firefox: 79.0
    Safari: 13.1.1
  npmPackages:
    @milesj/build-tools: ^2.11.0 => 2.11.0 
    @rollup/plugin-babel: ^5.2.0 => 5.2.0 
    @rollup/plugin-node-resolve: ^9.0.0 => 9.0.0 
    @types/hoist-non-react-statics: ^3.3.1 => 3.3.1 
    @types/react: ^16.9.49 => 16.9.49 
    @types/react-dom: ^16.9.8 => 16.9.8 
    babel-loader: ^8.1.0 => 8.1.0 
    builtin-modules: ^3.1.0 => 3.1.0 
    conventional-changelog-beemo: ^2.0.0 => 2.0.0 
    eslint-plugin-rut: ^1.1.0 => 1.1.0 
    jest-rut: ^1.0.2 => 1.0.2 
    lerna: ^3.22.1 => 3.22.1 
    react: ^16.13.1 => 16.13.1 
    react-docgen-typescript: ^1.20.4 => 1.20.4 
    react-dom: ^16.13.1 => 16.13.1 
    react-styleguidist: ^11.0.11 => 11.0.11 
    rollup: ^2.26.11 => 2.26.11 
    rollup-plugin-node-externals: ^2.2.0 => 2.2.0 
    rut-dom: ^1.0.2 => 1.0.2 
    webpack: ^4.44.1 => 4.44.1 

Additional context