@@ -101,7 +101,7 @@ export default class CSSStyleSheetImpl extends StyleSheetImpl {
101101 */
102102 get cssRules ( ) {
103103 if ( ! this . _originClean ) {
104- throw error ( ACCESS_THIRD_PARTY_STYLESHEET_ERROR )
104+ throw error ( ACCESS_THIRD_PARTY_STYLESHEET_ERROR , this . _globalObject )
105105 }
106106 return this . _cssRules
107107 }
@@ -122,12 +122,12 @@ export default class CSSStyleSheetImpl extends StyleSheetImpl {
122122 */
123123 insertRule ( rule , index ) {
124124 if ( ! this . _originClean ) {
125- throw error ( ACCESS_THIRD_PARTY_STYLESHEET_ERROR )
125+ throw error ( ACCESS_THIRD_PARTY_STYLESHEET_ERROR , this . _globalObject )
126126 }
127127 if ( this . _disallowModification ) {
128- throw error ( UPDATE_LOCKED_STYLESHEET_ERROR )
128+ throw error ( UPDATE_LOCKED_STYLESHEET_ERROR , this . _globalObject )
129129 }
130- return insertRule ( this . _rules , rule , index , this , ! this . _constructed )
130+ return insertRule ( this . cssRules , rule , index , this , ! this . _constructed )
131131 }
132132
133133 /**
@@ -137,8 +137,8 @@ export default class CSSStyleSheetImpl extends StyleSheetImpl {
137137 * @see {@link https://drafts.csswg.org/cssom-1/#dom-cssstylesheet-addrule }
138138 */
139139 addRule ( selector , contents , index ) {
140- const { _constructed, _rules } = this
141- insertRule ( _rules , `${ selector } { ${ contents } }` , index ?? _rules . length , this , ! _constructed )
140+ const { _constructed, cssRules } = this
141+ insertRule ( cssRules , `${ selector } { ${ contents } }` , index ?? cssRules . length , this , ! _constructed )
142142 return - 1
143143 }
144144
@@ -148,12 +148,12 @@ export default class CSSStyleSheetImpl extends StyleSheetImpl {
148148 */
149149 deleteRule ( index ) {
150150 if ( ! this . _originClean ) {
151- throw error ( ACCESS_THIRD_PARTY_STYLESHEET_ERROR )
151+ throw error ( ACCESS_THIRD_PARTY_STYLESHEET_ERROR , this . _globalObject )
152152 }
153153 if ( this . _disallowModification ) {
154- throw error ( UPDATE_LOCKED_STYLESHEET_ERROR )
154+ throw error ( UPDATE_LOCKED_STYLESHEET_ERROR , this . _globalObject )
155155 }
156- removeRule ( this . _rules , index )
156+ removeRule ( this . cssRules , index )
157157 }
158158
159159 /**
@@ -171,7 +171,7 @@ export default class CSSStyleSheetImpl extends StyleSheetImpl {
171171 */
172172 async replace ( text ) {
173173 if ( ! this . _constructed || this . _disallowModification ) {
174- return Promise . reject ( error ( UPDATE_LOCKED_STYLESHEET_ERROR ) )
174+ return Promise . reject ( error ( UPDATE_LOCKED_STYLESHEET_ERROR , this . _globalObject ) )
175175 }
176176 this . _disallowModification = true
177177 await Promise . resolve ( )
@@ -194,7 +194,7 @@ export default class CSSStyleSheetImpl extends StyleSheetImpl {
194194 */
195195 replaceSync ( text ) {
196196 if ( ! this . _constructed || this . _disallowModification ) {
197- throw error ( UPDATE_LOCKED_STYLESHEET_ERROR )
197+ throw error ( UPDATE_LOCKED_STYLESHEET_ERROR , this . _globalObject )
198198 }
199199 this . _rules . splice ( 0 )
200200 const rules = parseGrammar ( text , root . value , this ) . filter ( rule => {
0 commit comments