Bug 1828235 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I investigated different values inside of [`nsLayoutUtils::GetContentViewerSize`](https://searchfox.org/mozilla-central/source/layout/base/nsLayoutUtils.cpp#8301).

The most interesting finding being the `DynamicToolbarHeight` being `0` in the overlap case, after tapping into the input field, minimizing the keyboard, then scrolling down a bit to minimize the dynamic toolbar and then tapping to bring the toolbar back up.

### Overlap

`aPresContext->HasDynamicToolbar()` always returns true, because `GetDynamicToolbarMaxHeight()` always returns `158`.
When the toolbar is shown, with or without keyboard, `GetDynamicToolbarHeight()` reports `158` as well.
After clicking into the input field, the keyboard and the toolbar are shown. When scrolling down a little, the toolbar
disappears and `GetDynamicToolbarHeight()` reports `0`.
Then minimizing the keyboard again, the toolbar is shown and `GetDynamicToolbarHeight()` reports `158` again.

#### Before - keyboard collapsed, toolbar shown
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 158
	DynamicToolbarHeight MAX = 158
	bounds height total = 2218
	bounds height w/o toolbar = 2060
	aSubtractDynamicToolbar = Yes
```

#### After - keyboard shown, toolbar shown
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 158
	DynamicToolbarHeight MAX = 158
	aSubtractDynamicToolbar = No
	bounds height total = 1252
	bounds height w/o toolbar = 1094
```

#### After - keyboard shown, toolbar collapsed (after scroll)
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 0
	DynamicToolbarHeight MAX = 158
	bounds height total = 1252
	bounds height w/o toolbar = 1094
	aSubtractDynamicToolbar = No
```

#### After - keyboard collapsed, toolbar scrolled away, then shown again through tap
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 0
	DynamicToolbarHeight MAX = 158
	bounds height total = 2218
	bounds height w/o toolbar = 2060
	aSubtractDynamicToolbar = No
```

### High

`aPresContext->HasDynamicToolbar()` always returns true, because `GetDynamicToolbarMaxHeight()` always returns `158`.
The toolbar is always shown, therefore `GetDynamicToolbarHeight()` reports `158` as well.
Scrolling is not possible.

#### Before - keyboard collapsed, toolbar shown
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 158
	DynamicToolbarHeight MAX = 158
	bounds height total = 2218
	bounds height w/o toolbar = 2060
	aSubtractDynamicToolbar = Yes
```

#### After - keyboard shown, toolbar shown
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 158
	DynamicToolbarHeight MAX = 158
	bounds height total = 1252
	bounds height w/o toolbar = 1094
	aSubtractDynamicToolbar = Yes
```

### Low

Mixture of "Overlap" and "High" case: `GetDynamicToolbarMaxHeight()` always returns `158` because the toolbar is shown.
Unless you scroll down a bit after the keyboard appears, because the dynamic toolbar disappears and `GetDynamicToolbarHeight()` reports `0`.

#### Before - keyboard collapsed, toolbar shown
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 158
	DynamicToolbarHeight MAX = 158
	bounds height total = 2218
	bounds height w/o toolbar = 2060
	aSubtractDynamicToolbar = Yes
```

#### After - keyboard shown, toolbar shown
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 158
	DynamicToolbarHeight MAX = 158
	bounds height total = 1252
	bounds height w/o toolbar = 1094
	aSubtractDynamicToolbar = No
```

#### After - keyboard shown, toolbar collapsed (after scroll)
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 0
	DynamicToolbarHeight MAX = 158
	bounds height total = 1252
	bounds height w/o toolbar = 1094
	aSubtractDynamicToolbar = No
```
I investigated different values inside of [`nsLayoutUtils::GetContentViewerSize`](https://searchfox.org/mozilla-central/source/layout/base/nsLayoutUtils.cpp#8301).

The use cases _Overlap_, _High_ and _Low_ refer to the input field placement.
**Overlap** places the input field such that the dynamic toolbar will overlap with the input field when activated.  
**High** will keep the input field visible and above the dynamic toolbar  
**Low** the input field is placed so low such that it is placed under the dynamic toolbar and hidden by the keyboard.

I have used [these pages](https://denvercoder21.github.io/firefox-debugging/bugs/1828235.html) to reproduce on a Samsung Galaxy A54 5G phone. You might have to adjust the input field placement according to your device.

The most interesting finding being the `DynamicToolbarHeight` being `0` in the overlap case, after tapping into the input field, minimizing the keyboard, then scrolling down a bit to minimize the dynamic toolbar and then tapping to bring the toolbar back up.

### Overlap

`aPresContext->HasDynamicToolbar()` always returns true, because `GetDynamicToolbarMaxHeight()` always returns `158`.
When the toolbar is shown, with or without keyboard, `GetDynamicToolbarHeight()` reports `158` as well.
After clicking into the input field, the keyboard and the toolbar are shown. When scrolling down a little, the toolbar
disappears and `GetDynamicToolbarHeight()` reports `0`.
Then minimizing the keyboard again, the toolbar is shown and `GetDynamicToolbarHeight()` reports `158` again.

#### Before - keyboard collapsed, toolbar shown
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 158
	DynamicToolbarHeight MAX = 158
	bounds height total = 2218
	bounds height w/o toolbar = 2060
	aSubtractDynamicToolbar = Yes
```

#### After - keyboard shown, toolbar shown
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 158
	DynamicToolbarHeight MAX = 158
	aSubtractDynamicToolbar = No
	bounds height total = 1252
	bounds height w/o toolbar = 1094
```

#### After - keyboard shown, toolbar collapsed (after scroll)
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 0
	DynamicToolbarHeight MAX = 158
	bounds height total = 1252
	bounds height w/o toolbar = 1094
	aSubtractDynamicToolbar = No
```

#### After - keyboard collapsed, toolbar scrolled away, then shown again through tap
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 0
	DynamicToolbarHeight MAX = 158
	bounds height total = 2218
	bounds height w/o toolbar = 2060
	aSubtractDynamicToolbar = No
```

### High

`aPresContext->HasDynamicToolbar()` always returns true, because `GetDynamicToolbarMaxHeight()` always returns `158`.
The toolbar is always shown, therefore `GetDynamicToolbarHeight()` reports `158` as well.
Scrolling is not possible.

#### Before - keyboard collapsed, toolbar shown
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 158
	DynamicToolbarHeight MAX = 158
	bounds height total = 2218
	bounds height w/o toolbar = 2060
	aSubtractDynamicToolbar = Yes
```

#### After - keyboard shown, toolbar shown
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 158
	DynamicToolbarHeight MAX = 158
	bounds height total = 1252
	bounds height w/o toolbar = 1094
	aSubtractDynamicToolbar = Yes
```

### Low

Mixture of "Overlap" and "High" case: `GetDynamicToolbarMaxHeight()` always returns `158` because the toolbar is shown.
Unless you scroll down a bit after the keyboard appears, because the dynamic toolbar disappears and `GetDynamicToolbarHeight()` reports `0`.

#### Before - keyboard collapsed, toolbar shown
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 158
	DynamicToolbarHeight MAX = 158
	bounds height total = 2218
	bounds height w/o toolbar = 2060
	aSubtractDynamicToolbar = Yes
```

#### After - keyboard shown, toolbar shown
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 158
	DynamicToolbarHeight MAX = 158
	bounds height total = 1252
	bounds height w/o toolbar = 1094
	aSubtractDynamicToolbar = No
```

#### After - keyboard shown, toolbar collapsed (after scroll)
```bash
RootContentDocumentCrossProcess = true
	HasDynamicToolbar = true
	DynamicToolbarHeight = 0
	DynamicToolbarHeight MAX = 158
	bounds height total = 1252
	bounds height w/o toolbar = 1094
	aSubtractDynamicToolbar = No
```

## ICBSize.height

Logged from [`nsHTMLScrollFrame::UpdateMinimumScaleSize`](https://searchfox.org/mozilla-central/source/layout/generic/nsGfxScrollFrame.cpp#6078).

Value were the same across all three use cases (Overlap, High, Low).
**No keyboard**: `43260`
**Keyboard**: `22974`

Back to Bug 1828235 Comment 3