diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-03-05 17:34:47 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-03-06 10:04:14 +0000 |
commit | eaf1da4d961fbbda9455f9af3b23d1af777f43fa (patch) | |
tree | 95970599ecee31c4f7f940bc97ac98c61a3d0cad /chromium/third_party/blink/renderer/core/html/forms/resources/pickerCommon.js | |
parent | 38a9a29f4f9436cace7f0e7abf9c586057df8a4e (diff) | |
download | qtwebengine-chromium-eaf1da4d961fbbda9455f9af3b23d1af777f43fa.tar.gz |
BASELINE: Update Chromium to 73.0.3683.64
Change-Id: I76517dc277ba4e16bfd7e098fda3d079656b3b9f
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/html/forms/resources/pickerCommon.js')
-rw-r--r-- | chromium/third_party/blink/renderer/core/html/forms/resources/pickerCommon.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/chromium/third_party/blink/renderer/core/html/forms/resources/pickerCommon.js b/chromium/third_party/blink/renderer/core/html/forms/resources/pickerCommon.js index d4b6856b22f..b5071055647 100644 --- a/chromium/third_party/blink/renderer/core/html/forms/resources/pickerCommon.js +++ b/chromium/third_party/blink/renderer/core/html/forms/resources/pickerCommon.js @@ -141,7 +141,14 @@ function _adjustWindowRectVertically(windowRect, availRect, anchorRect, minHeigh var availableSpaceBelow = availRect.maxY - anchorRect.maxY; availableSpaceBelow = Math.max(0, Math.min(availRect.height, availableSpaceBelow)); - if (windowRect.height > availableSpaceBelow && availableSpaceBelow < availableSpaceAbove) { + + // In some situations, there may be no space available. This can happen on + // Linux when using a buggy window manager (https://crbug.com/774232). When + // this happens, don't try to constrain the window at all. + if (availableSpaceAbove == 0 && availableSpaceBelow == 0) { + windowRect.height = Math.max(minHeight, windowRect.height); + windowRect.y = anchorRect.maxY; + } else if (windowRect.height > availableSpaceBelow && availableSpaceBelow < availableSpaceAbove) { windowRect.height = Math.min(windowRect.height, availableSpaceAbove); windowRect.height = Math.max(windowRect.height, minHeight); windowRect.y = anchorRect.y - windowRect.height; @@ -156,6 +163,11 @@ function _adjustWindowRectVertically(windowRect, availRect, anchorRect, minHeigh * Arguments are DIPs. */ function _adjustWindowRectHorizontally(windowRect, availRect, anchorRect, minWidth) { + if (anchorRect.maxX <= availRect.x || availRect.maxX <= anchorRect.x) { + windowRect.width = Math.max(minWidth, windowRect.width); + windowRect.x = anchorRect.x + return; + } windowRect.width = Math.min(windowRect.width, availRect.width); windowRect.width = Math.max(windowRect.width, minWidth); windowRect.x = anchorRect.x; |