81295[BUGFIX] Apply CKEditor5 CSS scoping client-side
Commit message
Review
-
Code review CR +2 Done
- Benjamin Franzke +2
- Oliver Hader +1
- Benjamin Kott +1
-
Verified V +2 Done
- Benjamin Franzke +2
- Oliver Hader +1
- Benjamin Kott +1
- core-ci +1 CI
Issues 3
Files 23
- Build/Sources/TypeScript/rte_ckeditor/tests/css-prefixer-test.tsnew+266 −0
- Build/Sources/TypeScript/rte_ckeditor/ckeditor5.ts3+40 −4
- Build/Sources/TypeScript/rte_ckeditor/css-prefixer.ts3new+92 −0
- Build/Gruntfile.js+1 −0
- Build/package-lock.json+51 −9
- Build/package.json+2 −0
- Build/web-test-runner.config.mjs+1 −0
- typo3/sysext/core/Configuration/JavaScriptModules.php+1 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/css-tree.jsnew+11 −0
- typo3/sysext/core/composer.json+0 −1
- typo3/sysext/rte_ckeditor/Classes/Controller/ResourceController.phpdeleted+0 −87
- typo3/sysext/rte_ckeditor/Classes/Form/Element/RichTextElement.php+0 −20
- typo3/sysext/rte_ckeditor/Classes/Service/ScssProcessor.phpdeleted+0 −67
- typo3/sysext/rte_ckeditor/Configuration/Backend/Routes.php+0 −5
- typo3/sysext/rte_ckeditor/Configuration/Services.yaml+0 −12
- typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/ckeditor5.js+2 −2
- typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/css-prefixer.jsnew+13 −0
- typo3/sysext/rte_ckeditor/Tests/Unit/Fixtures/compiled.cssdeleted+0 −114
- typo3/sysext/rte_ckeditor/Tests/Unit/Fixtures/fixed.scssdeleted+0 −95
- typo3/sysext/rte_ckeditor/Tests/Unit/Fixtures/origin.scssdeleted+0 −92
Review log 2227
Show 12 earlier messages
-
Benjamin Franzke uploaded patch set 1 09/28/23, 12:49
-
core-ci voted on patch set 1 V +1 09/28/23, 12:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47284
-
Benjamin Franzke uploaded patch set 2
V +109/28/23, 13:36 -
Benjamin Franzke commented on patch set 2 09/28/23, 13:38
We could probably leave the dependency in place in the v12 backport, in case some classic mode extensions rely on it being shipped. Thoughts? -
core-ci voted on patch set 2 V +1 09/28/23, 13:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47285
-
Andreas Kienast voted on patch set 2 V +1 CR +1 09/28/23, 13:51
-
Benjamin Franzke commented on patch set 2 09/28/23, 14:21
Reply
Just did some scraping and found an example for such an extension: https://extensions.typo3.org/extension/ws_scss I leave this comment "open" until merge, so we do not forget to keep the dependency in the v12 backport.Decided against that: CSSStyleSheet parsing would still require selectors to be parsed manually and relocation via `new CSSStyleSheet({baseURL: url})` did not work for me. -
Oliver Hader commented on patch set 2 09/29/23, 10:18
ckeditor5.ts:187I'm just leaving a reference to an earlier discussion on adopted styles in the light DOM here (https://review.typo3.org/c/Packages/TYPO3.CMS/+/80664/comment/d76fcea0_80f1e8ad/ ): > Benjamin Franzke: > Do you see a possibility to not leak the registered styles forever? > I mean, if an element is removed from the DOM, it's style would never be removed right now. > Rough idea: > keep a reference to the constructed stylesheets of the component, then array_filter document.adoptedStyleSheetrs in disconnectedCallback() to filter out own style objects. -
Benjamin Franzke uploaded patch set 3
CR +1V +109/29/23, 14:45 -
Benjamin Franzke commented on patch set 3 09/29/23, 14:45
ckeditor5.ts:187ReplyYup, right. I somehow made a difference here, because I thought our ckeditor element isn't used temporarily on a "long-living" document anyway (so disconnectedCallback won't fire right now), but that may change so better be non-leaking right away. Done in patchset 3 (can be tested by removing `<typo3-rte-ckeditor-ckeditor5>` from the dome and asserting that `document.adoptedStyleSheets.length` equals `0` afterwards.) -
Benjamin Franzke commented on patch set 3 09/29/23, 14:46
ckeditor5.ts:187ReplyI meant "from the DOM" ;) -
core-ci voted on patch set 3 V +1 09/29/23, 14:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47308
-
Georg Ringer commented on patch set 3 09/30/23, 08:31
should we really use the wording frontend, until now in typo3 world this is the rendered website -
Benjamin Franzke uploaded patch set 4
V +109/30/23, 10:52 -
Benjamin Franzke commented on patch set 4 09/30/23, 10:52
Reply
Ack, updated. -
core-ci voted on patch set 4 V +1 09/30/23, 10:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47317
-
Benjamin Kott voted on patch set 4 V +1 CR +1 10/02/23, 07:35
-
Oli Bartsch voted on patch set 4 CR +1 10/02/23, 08:25
-
Oliver Hader commented on patch set 4 10/02/23, 08:37
css-prefixer.ts:26What about `data:` URIs? e.g. `background: url(data:image/png;base64,...)` -
Oliver Hader uploaded patch set 5
CR +1V +110/02/23, 08:59 -
Oliver Hader voted on patch set 5 V +1 CR +1 10/02/23, 08:59
-
Oliver Hader commented on patch set 5 10/02/23, 09:00
css-prefixer.ts:26ReplyDone -
core-ci voted on patch set 5 V +1 10/02/23, 09:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47339
-
Benjamin Kott voted on patch set 5 V +1 CR +1 10/02/23, 10:18
-
Benjamin Franzke commented on patch set 5 V +2 CR +2 10/02/23, 10:38
Reply
Done -
Benjamin Franzke commented on patch set 5 10/02/23, 10:44
css-prefixer.ts:26ReplyThanks! -
Benjamin Franzke merged patch set 6 10/02/23, 10:44