@@ -55,6 +55,7 @@ export class Highlight {
55
55
const document = injectedScript . document ;
56
56
this . _isUnderTest = injectedScript . isUnderTest ;
57
57
this . _glassPaneElement = document . createElement ( 'x-pw-glass' ) ;
58
+ this . _glassPaneElement . popover = 'manual' ;
58
59
this . _glassPaneElement . style . position = 'fixed' ;
59
60
this . _glassPaneElement . style . top = '0' ;
60
61
this . _glassPaneElement . style . right = '0' ;
@@ -64,6 +65,12 @@ export class Highlight {
64
65
this . _glassPaneElement . style . pointerEvents = 'none' ;
65
66
this . _glassPaneElement . style . display = 'flex' ;
66
67
this . _glassPaneElement . style . backgroundColor = 'transparent' ;
68
+ this . _glassPaneElement . style . width = 'inherit' ;
69
+ this . _glassPaneElement . style . height = 'inherit' ;
70
+ this . _glassPaneElement . style . padding = '0' ;
71
+ this . _glassPaneElement . style . margin = '0' ;
72
+ this . _glassPaneElement . style . border = 'none' ;
73
+ this . _glassPaneElement . style . overflow = 'hidden' ;
67
74
for ( const eventName of [ 'click' , 'auxclick' , 'dragstart' , 'input' , 'keydown' , 'keyup' , 'pointerdown' , 'pointerup' , 'mousedown' , 'mouseup' , 'mouseleave' , 'focus' , 'scroll' ] ) {
68
75
this . _glassPaneElement . addEventListener ( eventName , e => {
69
76
e . stopPropagation ( ) ;
@@ -83,6 +90,8 @@ export class Highlight {
83
90
84
91
install ( ) {
85
92
this . _injectedScript . document . documentElement . appendChild ( this . _glassPaneElement ) ;
93
+ // Popover is not supported in WebKit-macOS < 14.0
94
+ this . _glassPaneElement . showPopover ?.( ) ;
86
95
}
87
96
88
97
setLanguage ( language : Language ) {
@@ -99,6 +108,8 @@ export class Highlight {
99
108
uninstall ( ) {
100
109
if ( this . _rafRequest )
101
110
cancelAnimationFrame ( this . _rafRequest ) ;
111
+ // Popover is not supported in WebKit-macOS < 14.0
112
+ this . _glassPaneElement . hidePopover ?.( ) ;
102
113
this . _glassPaneElement . remove ( ) ;
103
114
}
104
115
0 commit comments