-
Notifications
You must be signed in to change notification settings - Fork 795
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(mock-doc): add missing ShadowRoot window primitive (#6011)
* fix(mock-doc): add missing ShadowRoot window primitive * prettier
- Loading branch information
1 parent
86a36b4
commit 2f944e2
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { MockDocumentFragment } from './document-fragment'; | ||
|
||
export class MockShadowRoot extends MockDocumentFragment { | ||
get activeElement(): HTMLElement | null { | ||
return null; | ||
} | ||
|
||
set adoptedStyleSheets(_adoptedStyleSheets: StyleSheet[]) { | ||
throw new Error('Unimplemented'); | ||
} | ||
|
||
get adoptedStyleSheets(): StyleSheet[] { | ||
return []; | ||
} | ||
|
||
get cloneable(): boolean { | ||
return false; | ||
} | ||
|
||
get delegatesFocus(): boolean { | ||
return false; | ||
} | ||
|
||
get fullscreenElement(): HTMLElement | null { | ||
return null; | ||
} | ||
|
||
get host(): HTMLElement | null { | ||
let parent = this.parentElement(); | ||
while (parent) { | ||
if (parent.nodeType === 11) { | ||
return parent; | ||
} | ||
parent = parent.parentElement(); | ||
} | ||
return null; | ||
} | ||
|
||
get mode(): 'open' | 'closed' { | ||
return 'open'; | ||
} | ||
|
||
get pictureInPictureElement(): HTMLElement | null { | ||
return null; | ||
} | ||
|
||
get pointerLockElement(): HTMLElement | null { | ||
return null; | ||
} | ||
|
||
get serializable(): boolean { | ||
return false; | ||
} | ||
|
||
get slotAssignment(): 'named' | 'manual' { | ||
return 'named'; | ||
} | ||
|
||
get styleSheets(): StyleSheet[] { | ||
return []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters