@@ -412,7 +412,6 @@ export var PanelMultiView = class extends AssociatedToNode {
412
412
this . openViews = [ ] ;
413
413
414
414
this . _panel . addEventListener ( "popupshowing" , this ) ;
415
- this . _panel . addEventListener ( "popuppositioned" , this ) ;
416
415
this . _panel . addEventListener ( "popuphidden" , this ) ;
417
416
this . _panel . addEventListener ( "popupshown" , this ) ;
418
417
@@ -434,7 +433,6 @@ export var PanelMultiView = class extends AssociatedToNode {
434
433
435
434
this . _panel . removeEventListener ( "mousemove" , this ) ;
436
435
this . _panel . removeEventListener ( "popupshowing" , this ) ;
437
- this . _panel . removeEventListener ( "popuppositioned" , this ) ;
438
436
this . _panel . removeEventListener ( "popupshown" , this ) ;
439
437
this . _panel . removeEventListener ( "popuphidden" , this ) ;
440
438
this . document . documentElement . removeEventListener ( "keydown" , this , true ) ;
@@ -1181,47 +1179,6 @@ export var PanelMultiView = class extends AssociatedToNode {
1181
1179
}
1182
1180
}
1183
1181
1184
- _calculateMaxHeight ( aEvent ) {
1185
- // While opening the panel, we have to limit the maximum height of any
1186
- // view based on the space that will be available. We cannot just use
1187
- // window.screen.availTop and availHeight because these may return an
1188
- // incorrect value when the window spans multiple screens.
1189
- let anchor = this . _panel . anchorNode ;
1190
- let anchorRect = anchor . getBoundingClientRect ( ) ;
1191
- let screen = anchor . screen ;
1192
-
1193
- // GetAvailRect returns screen-device pixels, which we can convert to CSS
1194
- // pixels here.
1195
- let availTop = { } ,
1196
- availHeight = { } ;
1197
- screen . GetAvailRect ( { } , availTop , { } , availHeight ) ;
1198
- let cssAvailTop = availTop . value / screen . defaultCSSScaleFactor ;
1199
-
1200
- // The distance from the anchor to the available margin of the screen is
1201
- // based on whether the panel will open towards the top or the bottom.
1202
- let maxHeight ;
1203
- if ( aEvent . alignmentPosition . startsWith ( "before_" ) ) {
1204
- maxHeight = anchor . screenY - cssAvailTop ;
1205
- } else {
1206
- let anchorScreenBottom = anchor . screenY + anchorRect . height ;
1207
- let cssAvailHeight = availHeight . value / screen . defaultCSSScaleFactor ;
1208
- maxHeight = cssAvailTop + cssAvailHeight - anchorScreenBottom ;
1209
- }
1210
-
1211
- // To go from the maximum height of the panel to the maximum height of
1212
- // the view stack, we need to subtract the height of the arrow and the
1213
- // height of the opposite margin, but we cannot get their actual values
1214
- // because the panel is not visible yet. However, we know that this is
1215
- // currently 11px on Mac, 13px on Windows, and 13px on Linux. We also
1216
- // want an extra margin, both for visual reasons and to prevent glitches
1217
- // due to small rounding errors. So, we just use a value that makes
1218
- // sense for all platforms. If the arrow visuals change significantly,
1219
- // this value will be easy to adjust.
1220
- const EXTRA_MARGIN_PX = 20 ;
1221
- maxHeight -= EXTRA_MARGIN_PX ;
1222
- return maxHeight ;
1223
- }
1224
-
1225
1182
handleEvent ( aEvent ) {
1226
1183
// Only process actual popup events from the panel or events we generate
1227
1184
// ourselves, but not from menus being shown from within the panel.
@@ -1262,14 +1219,6 @@ export var PanelMultiView = class extends AssociatedToNode {
1262
1219
}
1263
1220
break ;
1264
1221
}
1265
- case "popuppositioned" : {
1266
- if ( this . _panel . state == "showing" ) {
1267
- let maxHeight = this . _calculateMaxHeight ( aEvent ) ;
1268
- this . _viewStack . style . maxHeight = maxHeight + "px" ;
1269
- this . _offscreenViewStack . style . maxHeight = maxHeight + "px" ;
1270
- }
1271
- break ;
1272
- }
1273
1222
case "popupshown" :
1274
1223
// The main view is always open and visible when the panel is first
1275
1224
// shown, so we can check the height of the description elements it
0 commit comments