Add observers for stylesheet mutations (#177)
* hack together stylesheet observer * Add test coverage for insertRule/deleteRule on stylesheets * Add new observers * update patch based on changes to master * Functioning event recording * Remove print statements * Fix ID usage and mark add vs remove * Correct type Co-authored-by: Jon Perl <perl.jonathan@gmail.com>
This commit is contained in:
@@ -82,9 +82,11 @@ function record(options: recordOptions = {}): listenerHandler | undefined {
|
||||
inlineStylesheet,
|
||||
maskAllInputs,
|
||||
);
|
||||
|
||||
if (!node) {
|
||||
return console.warn('Failed to snapshot the document');
|
||||
}
|
||||
|
||||
mirror.map = idNodeMap;
|
||||
wrappedEmit(
|
||||
wrapEvent({
|
||||
@@ -188,6 +190,16 @@ function record(options: recordOptions = {}): listenerHandler | undefined {
|
||||
},
|
||||
}),
|
||||
),
|
||||
styleSheetRuleCb: r =>
|
||||
wrappedEmit(
|
||||
wrapEvent({
|
||||
type: EventType.IncrementalSnapshot,
|
||||
data: {
|
||||
source: IncrementalSource.StyleSheetRule,
|
||||
...r,
|
||||
},
|
||||
}),
|
||||
),
|
||||
blockClass,
|
||||
ignoreClass,
|
||||
maskAllInputs,
|
||||
|
||||
Reference in New Issue
Block a user