@@ -157,6 +157,57 @@ describe('BlockScrollStrategy', () => {
157157 } ) ,
158158 ) ;
159159
160+ it (
161+ `should't do anything if the page isn't scrollable while zoomed out` ,
162+ skipIOS ( ( ) => {
163+ if ( platform . FIREFOX ) {
164+ // style.zoom is only supported from Firefox 126
165+ return ;
166+ }
167+
168+ forceScrollElement . style . display = 'none' ;
169+ document . body . style . zoom = '75%' ;
170+ overlayRef . attach ( componentPortal ) ;
171+ expect ( document . body . scrollWidth ) . toBeGreaterThan ( window . innerWidth ) ;
172+ expect ( documentElement . classList ) . not . toContain ( 'cdk-global-scrollblock' ) ;
173+ overlayRef . detach ( ) ;
174+ document . body . style . zoom = '100%' ;
175+
176+ document . documentElement . style . zoom = '75%' ;
177+ overlayRef . attach ( componentPortal ) ;
178+ expect ( document . body . scrollWidth ) . toBeGreaterThan ( window . innerWidth ) ;
179+ expect ( documentElement . classList ) . not . toContain ( 'cdk-global-scrollblock' ) ;
180+ document . documentElement . style . zoom = '100%' ;
181+ } ) ,
182+ ) ;
183+
184+ it (
185+ `should add cdk-global-scrollblock while zoomed in` ,
186+ skipIOS ( ( ) => {
187+ if ( platform . FIREFOX ) {
188+ // style.zoom is only supported from Firefox 126
189+ return ;
190+ }
191+
192+ forceScrollElement . style . width = window . innerWidth - 20 + 'px' ;
193+ forceScrollElement . style . height = window . innerHeight - 20 + 'px' ;
194+ overlayRef . attach ( componentPortal ) ;
195+ expect ( documentElement . classList ) . not . toContain ( 'cdk-global-scrollblock' ) ;
196+ overlayRef . detach ( ) ;
197+
198+ document . body . style . zoom = '200%' ;
199+ overlayRef . attach ( componentPortal ) ;
200+ expect ( documentElement . classList ) . toContain ( 'cdk-global-scrollblock' ) ;
201+ document . body . style . zoom = '100%' ;
202+ overlayRef . detach ( ) ;
203+
204+ document . documentElement . style . zoom = '200%' ;
205+ overlayRef . attach ( componentPortal ) ;
206+ expect ( documentElement . classList ) . toContain ( 'cdk-global-scrollblock' ) ;
207+ document . documentElement . style . zoom = '100%' ;
208+ } ) ,
209+ ) ;
210+
160211 it ( 'should keep the content width' , ( ) => {
161212 forceScrollElement . style . width = '100px' ;
162213
0 commit comments