Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jan 12, 2022
1 parent 66d66cb commit 251b6c9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/block-editor/src/components/editor-styles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,22 @@ function PrefixedStyle( { tagName, href, id, rel, media, textContent } ) {
const TagName = tagName.toLowerCase();

function onLoad( event ) {
const { sheet } = event.target;
const { sheet, ownerDocument } = event.target;
const { defaultView } = ownerDocument;
const { CSSStyleRule } = defaultView;
const { cssRules } = sheet;

let index = 0;

for ( const rule of cssRules ) {
const { type, STYLE_RULE, selectorText, cssText } = rule;
const { selectorText, cssText } = rule;

if ( type !== STYLE_RULE ) {
if ( ! ( rule instanceof CSSStyleRule ) ) {
continue;
}

if ( selectorText.includes( EDITOR_STYLES_SELECTOR ) ) {
return;
continue;
}

sheet.deleteRule( index );
Expand Down

0 comments on commit 251b6c9

Please sign in to comment.