Skip to content

Commit

Permalink
Update StyleManager specs to address deprecated ::shadow selectors
Browse files Browse the repository at this point in the history
As of Chromium 63, ::shadow CSS selectors have been fully removed:

https://developers.google.com/web/updates/2017/10/remove-shadow-piercing

As a result, any usage of ::shadow in a stylesheet seems to get removed as soon
as the stylesheet is applied to an HTMLStyleElement.  Since we have a couple of tests
that expect ::shadow selectors to be present, we must remove those expectations
since those selectors do not appear any longer.
  • Loading branch information
daviwil authored and rafeca committed May 6, 2019
1 parent 614d3e1 commit 78f354a
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions spec/style-manager-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ describe('StyleManager', () => {
atom-text-editor::shadow .class-1, atom-text-editor::shadow .class-2 { color: red }
atom-text-editor::shadow > .class-3 { color: yellow }
atom-text-editor .class-4 { color: blue }
another-element::shadow .class-5 { color: white }
atom-text-editor[data-grammar*=\"js\"]::shadow .class-6 { color: green; }
atom-text-editor[mini].is-focused::shadow .class-7 { color: green; }
`)
Expand All @@ -69,7 +68,6 @@ describe('StyleManager', () => {
'atom-text-editor.editor .class-1, atom-text-editor.editor .class-2',
'atom-text-editor.editor > .class-3',
'atom-text-editor .class-4',
'another-element::shadow .class-5',
'atom-text-editor[data-grammar*="js"].editor .class-6',
'atom-text-editor[mini].is-focused.editor .class-7'
])
Expand Down Expand Up @@ -136,13 +134,6 @@ describe('StyleManager', () => {
).toEqual(['atom-text-editor .class-1, atom-text-editor .class-2'])
})

it('does not transform CSS rules with invalid syntax', () => {
styleManager.addStyleSheet("atom-text-editor::shadow .class-1 { font-family: inval'id }")
expect(Array.from(styleManager.getStyleElements()[0].sheet.cssRules).map((r) => r.selectorText)).toEqual([
'atom-text-editor::shadow .class-1'
])
})

it('does not throw exceptions on rules with no selectors', () => {
styleManager.addStyleSheet('@media screen {font-size: 10px}', {
context: 'atom-text-editor'
Expand Down

0 comments on commit 78f354a

Please sign in to comment.