-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix inline link elements bug #995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,8 +1,9 @@ | ||||||||||||||||
| import type { Mirror, serializedNodeWithId } from 'rrweb-snapshot'; | ||||||||||||||||
| import type { elementNode, serializedNodeWithId } from 'rrweb-snapshot'; | ||||||||||||||||
| import { getCssRuleString } from 'rrweb-snapshot'; | ||||||||||||||||
| import type { | ||||||||||||||||
| adoptedStyleSheetCallback, | ||||||||||||||||
| adoptedStyleSheetParam, | ||||||||||||||||
| attributeMutation, | ||||||||||||||||
| mutationCallBack, | ||||||||||||||||
| } from '../types'; | ||||||||||||||||
| import { StyleSheetMirror } from '../utils'; | ||||||||||||||||
|
|
@@ -24,20 +25,20 @@ export class StylesheetManager { | |||||||||||||||
| public attachLinkElement( | ||||||||||||||||
| linkEl: HTMLLinkElement, | ||||||||||||||||
| childSn: serializedNodeWithId, | ||||||||||||||||
| mirror: Mirror, | ||||||||||||||||
| ) { | ||||||||||||||||
| this.mutationCb({ | ||||||||||||||||
| adds: [ | ||||||||||||||||
| { | ||||||||||||||||
| parentId: mirror.getId(linkEl), | ||||||||||||||||
| nextId: null, | ||||||||||||||||
| node: childSn, | ||||||||||||||||
| }, | ||||||||||||||||
| ], | ||||||||||||||||
| removes: [], | ||||||||||||||||
| texts: [], | ||||||||||||||||
| attributes: [], | ||||||||||||||||
| }); | ||||||||||||||||
| if ('_cssText' in (childSn as elementNode).attributes) | ||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According the code below rrweb/packages/rrweb-snapshot/src/snapshot.ts Lines 653 to 659 in 08ab7ab
I think it will set _cssText when the link has been loaded. Otherwise, recorder will only keep its original attributes. |
||||||||||||||||
| this.mutationCb({ | ||||||||||||||||
| adds: [], | ||||||||||||||||
| removes: [], | ||||||||||||||||
| texts: [], | ||||||||||||||||
| attributes: [ | ||||||||||||||||
| { | ||||||||||||||||
| id: childSn.id, | ||||||||||||||||
| attributes: (childSn as elementNode) | ||||||||||||||||
| .attributes as attributeMutation['attributes'], | ||||||||||||||||
| }, | ||||||||||||||||
| ], | ||||||||||||||||
| }); | ||||||||||||||||
|
|
||||||||||||||||
| this.trackLinkElement(linkEl); | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.