Skip to content

Commit 2aa7251

Browse files
Add more complete tests for DOM attribute serialization
1 parent 88a5f23 commit 2aa7251

File tree

2 files changed

+472
-1
lines changed

2 files changed

+472
-1
lines changed

packages/rum/src/domain/record/serialization/serialization.types.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,31 @@ export type ParentNodePrivacyLevel =
88
| typeof NodePrivacyLevel.MASK
99
| typeof NodePrivacyLevel.MASK_USER_INPUT
1010
| typeof NodePrivacyLevel.MASK_UNLESS_ALLOWLISTED
11+
12+
/**
13+
* Virtual attributes. These attributes appear in the serialized attribute map of
14+
* elements, but they're not actually derived from the DOM; they're used to represent
15+
* metadata about the element they're attached to.
16+
*/
17+
export interface VirtualAttributes {
18+
/**
19+
* For <style> and <link> elements, the rules in the element's stylesheet, extracted
20+
* from the CSSOM.
21+
*/
22+
_cssText?: string
23+
24+
/** For <audio> and <video> elements, the playback state of the element's media. */
25+
rr_mediaState?: 'paused' | 'played'
26+
27+
/** For elements which are scroll containers, the element's X scroll position, if non-zero. */
28+
rr_scrollLeft?: number
29+
30+
/** For elements which are scroll containers, the element's Y scroll position, if non-zero. */
31+
rr_scrollTop?: number
32+
33+
/** For HIDDEN elements, the width of the element's bounding client rect. */
34+
rr_width?: string
35+
36+
/** For HIDDEN elements, the height of the element's bounding client rect. */
37+
rr_height?: string
38+
}

0 commit comments

Comments
 (0)