The methods are in `nsCaret`, `nsFrameSelection` and `dom::Selection`. That
makes harder to read, and they are called each other, so, they are reused for
different purpose. Therefore, it must be better to move them into a new class.
Then, the name differences may become more unclear. If you think so, feel free
to request renaming some methods of them.
Differential Revision: https://phabricator.services.mozilla.com/D197288
Oddly, it updates `nsFrameSelection` instance and some root callers may depend
on that. Therefore, this patch keep updating `nsFrameSelection` in the callers.
Differential Revision: https://phabricator.services.mozilla.com/D197284
The return value of nsLayoutUtils::AsyncPanZoomEnabled only changes if we descend into a frame whose display root widget is different. But that is not possible, we do not descend into any frames that are in different widgets.
Differential Revision: https://phabricator.services.mozilla.com/D197237
Nobody shares an instance of `nsFrameIterator`. Therefore, we can make it
non-refcountable. Additionally, `nsVisualIterator` is not required because
it overrides only 4 methods which are really simple. So, once we merge it
into `nsFrameIterator`, we can allocate it in the stack.
Differential Revision: https://phabricator.services.mozilla.com/D197144
The class is used only for creating `nsFrameIterator`, but it's unnecessary
so that we can get rid of it and its interface.
Differential Revision: https://phabricator.services.mozilla.com/D197143
It's inherited only by `nsFrameIterator`, and `nsFrameIterator` can be declared
in a header file. So, the interface is not required and removing it can avoid
virtual calls.
Differential Revision: https://phabricator.services.mozilla.com/D197142
Nobody shares an instance of `nsFrameIterator`. Therefore, we can make it
non-refcountable. Additionally, `nsVisualIterator` is not required because
it overrides only 4 methods which are really simple. So, once we merge it
into `nsFrameIterator`, we can allocate it in the stack.
Differential Revision: https://phabricator.services.mozilla.com/D197144
The class is used only for creating `nsFrameIterator`, but it's unnecessary
so that we can get rid of it and its interface.
Differential Revision: https://phabricator.services.mozilla.com/D197143
It's inherited only by `nsFrameIterator`, and `nsFrameIterator` can be declared
in a header file. So, the interface is not required and removing it can avoid
virtual calls.
Differential Revision: https://phabricator.services.mozilla.com/D197142
When pressing `ArrowLeft` key at:
```
<p>abc</p><p><span contenteditable=false>def</span>{}<br></p>
```
, caret is moved into the non-editable text because
`nsCaret::GetCaretFrameForNodeOffset` looks for a preceding text node from
the `BRFrame`. This is required if the preceding text node ends with a
collapsible white-space but followed by a `<br>` because the text frame
should not contain the white-space rect and `BRFrame` frame should be next
to it, i.e., the white-space looks like a overflown content.
So, for rendering a caret, the method needs to return non-editable text frame
even in the case, but for considering new caret position in the DOM tree, it
should not return non-editable text frame.
Therefore, this patch adds a param to `nsCaret::GetCaretFrameForNodeOffset()`
which forcibly return editable content frame or not and makes
`Selection::GetPrimaryOrCaretFrameForNodeOffset` call it with the new option
because its callers are the handler of caret navigation.
Differential Revision: https://phabricator.services.mozilla.com/D196259
Here are some benefits to define those constants in constexpr variables:
1. Better assertion messages. For example, without this patch, the assertion in
bug 1870103 looks like:
```
Assertion failure: cbSize.BSize(wm) == nscoord((1 << 30) - 1)
```
With this patch, it looks like:
```
Assertion failure: cbSize.BSize(wm) == NS_UNCONSTRAINEDSIZE
```
2. We can use those constants in a debugger.
This patch doesn't change behavior.
Differential Revision: https://phabricator.services.mozilla.com/D196708
This will make possible to animate custom properties on Gecko side. For now, the
animation code keeps only dealing with nsCSSPropertyID, so behavior is unchanged.
Co-authored-by: Frederic Wang <fred.wang@free.fr>
Depends on D190816
Differential Revision: https://phabricator.services.mozilla.com/D191059
We can pass `ComputeSizeFlag::ShrinkWrap` flag when creating the `ReflowInput`
for a flex item. It is maybe more verbose, but less of the magic flex logic
hidden in `ReflowInput`.
This patch doesn't change behavior.
Differential Revision: https://phabricator.services.mozilla.com/D196258
Currently, the method ignores synthesized `eMouseMove` events coming from the
parent process if
* the last mouse location was updated by a synthesized mouse event for tests
* the event comes from parent process
* the event is not marked as synthesized for tests
However, `eMouseExitFromWidget` is also handled as a synthesized `eMouseMove` [1].
Therefore, the method needs to ignore this event too in the same conditions.
Additionally, `eMouseEnterIntoWidget` may cause updating the `:hover` state
under the event position which may be different from the last cursor position
in the content process [2]. Therefore, the method needs to ignore this too.
On the other hand, if the event is caused by a test API synthesizing mouse
events, e.g., when `test.events.async.enabled` is set to `true`, the running
test must expect the events. Therefore, these events need to be marked as
synthesized for tests correctly. Therefore, this patch updates the
initializers of the events.
1. https://searchfox.org/mozilla-central/rev/78a2c17cc80680a5a82446e4ce7c45a73b935383/dom/events/EventStateManager.cpp#773,794-796,800-801
2. https://searchfox.org/mozilla-central/rev/78a2c17cc80680a5a82446e4ce7c45a73b935383/dom/events/EventStateManager.cpp#4063,4068
Differential Revision: https://phabricator.services.mozilla.com/D195638
Use the non-native styles instead. I needed a hack in RestyleManager to
deal with paint invalidation properly. It's a pre-existing issue for
native checkboxes / radio.
Differential Revision: https://phabricator.services.mozilla.com/D195229
Implement experimental transparent-on-hover behavior for the
picture-in-picture video player. This makes the popup player less of
a nuisance on smaller displays.
Tested on macOS, but should also work on Windows with small tweaks.
The behavior is hidden behind a pref:
media.videocontrols.picture-in-picture.seethrough-mode.enabled
Differential Revision: https://phabricator.services.mozilla.com/D193993
This is unfortunately somewhat hard to test, because paint suppression
is not really quite observable by the page.
This makes sure that we don't report resize observations etc until the
page has been laid out for other reasons.
Differential Revision: https://phabricator.services.mozilla.com/D194910
When the line scroll amount is larger than that of the rectangle to
scroll into view, do not use the line size to determine if we should
scroll.
Differential Revision: https://phabricator.services.mozilla.com/D192870