Граф коммитов

23751 Коммитов

Автор SHA1 Сообщение Дата
Timothy Nikkel a64e3a50db Bug 1872002. Don't descend into popups in MaybeCreateDisplayPortInFirstScrollFrameEncountered. r=layout-reviewers,emilio
When building the display list for popup frames we hit this early return

https://searchfox.org/mozilla-central/rev/08899071a2c8a573ac47ac632869bb92269b3ec3/layout/generic/nsIFrame.cpp#4089

because menupopups are given top layer style here

https://searchfox.org/mozilla-central/rev/08899071a2c8a573ac47ac632869bb92269b3ec3/toolkit/content/xul.css#370

The place where top layer items would get added to the display list is

https://searchfox.org/mozilla-central/rev/08899071a2c8a573ac47ac632869bb92269b3ec3/layout/generic/ViewportFrame.cpp#163

However that iterates the toplayer list from the document which does not contain menupopups; it contains things like popover, fullscreen, dialog.

However, if not culled by that toplayer early return, popups would be culled by this popup specific early return a few lines later

https://searchfox.org/mozilla-central/rev/08899071a2c8a573ac47ac632869bb92269b3ec3/layout/generic/nsIFrame.cpp#4110

So I think using a popup check here is the right way to go.

Differential Revision: https://phabricator.services.mozilla.com/D197313
2023-12-30 04:47:11 +00:00
Robert Longson 0e8866544c Bug 1872241 - Remove svgFloatSize and use gfx::Size instead r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D197371
2023-12-28 12:59:10 +00:00
Masayuki Nakano cd53d5600e Bug 1816581 - part 6: Move the static methods used for moving caret or considering caret geometry into new utility class r=emilio
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
2023-12-27 04:42:12 +00:00
Masayuki Nakano ac6767faae Bug 1816581 - part 2: Make `nsCaret::GetCaretFrameForNodeOffset` static r=emilio
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
2023-12-27 04:42:10 +00:00
Masayuki Nakano fe9fef936b Bug 1816581 - part 1: Make `CaretAssociationHint` an enum class r=emilio
For forward-decl-able.

Differential Revision: https://phabricator.services.mozilla.com/D197283
2023-12-27 04:42:09 +00:00
Emilio Cobos Álvarez 64f95e649a Bug 1871412 - Fix scroll container checks for automatic minimum size and grid stretching checks. r=dholbert
The spec says scroll container, so overflow: visible and clip shouldn't
be different.

Note that the spec here is pending some edits from
https://github.com/w3c/csswg-drafts/issues/7714 tho.

Differential Revision: https://phabricator.services.mozilla.com/D197052
2023-12-26 20:49:16 +00:00
Butkovits Atila 41b6ca07bc Backed out changeset 2feca7f78d58 (bug 1871751) for causing failures at DisplayPortUtils.cpp. CLOSED TREE 2023-12-26 14:12:45 +02:00
Timothy Nikkel 4a9339c873 Bug 1871751. Avoid AsyncPanZoomEnabled call in MaybeCreateDisplayPortInFirstScrollFrameEncountered. r=layout-reviewers,emilio
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
2023-12-26 11:39:54 +00:00
Masayuki Nakano a558378375 Bug 779684 - part 3: Make `nsFrameIterator` non-refcountable r=emilio
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
2023-12-24 06:01:19 +00:00
Masayuki Nakano 76826c766a Bug 779684 - part 2: Get rid of `nsFrameTraversal` and `nsIFrameTraversal` r=emilio
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
2023-12-24 06:01:19 +00:00
Masayuki Nakano 32c9d4f8e7 Bug 779684 - part 1: Get rid of `nsIFrameEnumerator` interface r=emilio
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
2023-12-24 06:01:19 +00:00
Stanca Serban e07cea7e9d Backed out 3 changesets (bug 779684) for causing nsFrameIterator related mochitests failures.
Backed out changeset 8b92fb4e3f41 (bug 779684)
Backed out changeset f357b2287591 (bug 779684)
Backed out changeset 738fe6bbf913 (bug 779684)
2023-12-23 10:32:48 +02:00
Masayuki Nakano 5518ab835e Bug 779684 - part 3: Make `nsFrameIterator` non-refcountable r=emilio
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
2023-12-23 05:39:39 +00:00
Masayuki Nakano c889543d50 Bug 779684 - part 2: Get rid of `nsFrameTraversal` and `nsIFrameTraversal` r=emilio
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
2023-12-23 05:39:38 +00:00
Masayuki Nakano d04f4666eb Bug 779684 - part 1: Get rid of `nsIFrameEnumerator` interface r=emilio
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
2023-12-23 05:39:38 +00:00
Emilio Cobos Álvarez 644a6bc997 Bug 1870512 - Simplify ShouldAttachToTopLevel(), and revert patch for bug 1869891. r=tnikkel
Definitely not for 122, but I think we should try this. Note that this
doesn't affect nsMenuPopupFrames, which create the widget on their own
here:

  https://searchfox.org/mozilla-central/rev/07937a5d00e0f65611d8b3bd2992c7603aeaa70d/layout/xul/nsMenuPopupFrame.cpp#266

It only affects windows with popup=yes, which right now are only the
nsXULAlerts windows.

I'll look into trying to unify the macOS set-up, which right now
unconditionally uses this (presumably to get an nsChildView for each
top-level nsCocoaWindow). Maybe that can be handled internally by the
widget layer, we'll see.

Differential Revision: https://phabricator.services.mozilla.com/D196664
2023-12-20 18:32:38 +00:00
Masayuki Nakano 87da8e59cd Bug 1612076 - Make `AdjustCaretFrameForLineEnd` stop scanning text node if first node is editable but reached non-editable one r=emilio
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
2023-12-19 01:58:07 +00:00
Norisz Fay 12d5bd6705 Backed out 3 changesets (bug 1870512) as part of previous backout since issues are still present CLOSED TREE
Backed out changeset c909d207f316 (bug 1870512)
Backed out changeset cf0bda3b4253 (bug 1870512)
Backed out changeset 39cc9d155c12 (bug 1870512)
2023-12-18 23:37:42 +02:00
Ting-Yu Lin db975b21a8 Bug 1870572 - Use constexpr variables instead of macro to define layout constants. r=layout-reviewers,emilio
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
2023-12-18 18:18:28 +00:00
Emilio Cobos Álvarez 33c17b43f6 Bug 1870512 - Simplify ShouldAttachToTopLevel(), and revert patch for bug 1869891. r=tnikkel
Definitely not for 122, but I think we should try this. Note that this
doesn't affect nsMenuPopupFrames, which create the widget on their own
here:

  https://searchfox.org/mozilla-central/rev/07937a5d00e0f65611d8b3bd2992c7603aeaa70d/layout/xul/nsMenuPopupFrame.cpp#266

It only affects windows with popup=yes, which right now are only the
nsXULAlerts windows.

I'll look into trying to unify the macOS set-up, which right now
unconditionally uses this (presumably to get an nsChildView for each
top-level nsCocoaWindow). Maybe that can be handled internally by the
widget layer, we'll see.

Differential Revision: https://phabricator.services.mozilla.com/D196664
2023-12-18 17:56:41 +00:00
Olli Pettay 7acd483571 Bug 1870008 - make high rate mode handling dynamic, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D196591
2023-12-18 15:40:09 +00:00
Zach Hoffman cd5747dfbf Bug 1846516 - [css-properties-values-api] Introduce AnimatedPropertyID/AnimatedPropertIDSet. r=firefox-animation-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio,hiro
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
2023-12-18 09:24:08 +00:00
Emilio Cobos Álvarez 894a09c9c2 Bug 1869891 - Hack around for 122. r=tnikkel
Co-authored-by: Vsevolod Buzinov <vsevolod.buzinov@4dpipeline.com>

Differential Revision: https://phabricator.services.mozilla.com/D196669
2023-12-17 16:05:17 +00:00
Ting-Yu Lin 8931f376fa Bug 1869722 Part 2 - Remove the special case adding ShrinkWrap flag for flex items. r=dholbert
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
2023-12-13 22:50:36 +00:00
Masayuki Nakano 90b77204fb Bug 1868283 - part 3: Make `PresShell::HandleEvent` ignore `eMouseExitFromWidget` and `eMouseEnterIntoWidget` events which are synthesized in the parent process accidentally r=smaug
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
2023-12-13 07:13:04 +00:00
Sean Feng 290a5f22de Bug 1867152 - Fix the assertion in nsPresContext::UserInputEventsAllowed r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D196106
2023-12-12 22:49:38 +00:00
Cosmin Sabou 386b505e01 Backed out changeset 496886cb30a5 (bug 1867152) for bc failures on browser_user_input_handling_delay.js. CLOSED TREE 2023-12-12 21:48:27 +02:00
Sean Feng d1aa4ad7e6 Bug 1867152 - Fix the assertion in nsPresContext::UserInputEventsAllowed r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D196106
2023-12-12 15:17:53 +00:00
Magnus Melin aac78f7939 Bug 1869195 - Fix crash in [@ mozilla::PresShell::GetRootScrollFrame]. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D196021
2023-12-11 10:45:19 +00:00
Olli Pettay 8c3ede533c Bug 1869112 - don't try to access StyleSet if mPresShell is null, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D195956
2023-12-09 18:01:51 +00:00
Dão Gottwald 27bac7a37a Bug 1868931 - Repaint XUL checkbox and radio for active state too. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D195851
2023-12-08 09:49:12 +00:00
Olli Pettay 62da5887eb Bug 1868746 - Drop styleset from Document sooner, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D195771
2023-12-07 20:50:14 +00:00
Jonathan Kew 630dcfd972 Bug 1863574 - patch 2 - Create an RFPTarget option to control whether the resolution of CSS generics is subject to font-visibility restrictions. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D195426
2023-12-07 10:29:34 +00:00
Cristian Tuns 95afdf2e8f Backed out changeset a69c40accbf0 (bug 1860328) for causing mochitest failures in nsDisplayList.cpp CLOSED TREE 2023-12-06 13:05:13 -05:00
Sean Feng c52c227f53 Bug 1860328 - Fix a bug where caret misses when dragging and dropping r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D192377
2023-12-06 16:29:18 +00:00
Cathie Chen e88b28e248 Bug 1866566 - If there is change in over-all relevancy, update HiddenByContentVisibility for animations, r=emilio,hiro
Differential Revision: https://phabricator.services.mozilla.com/D195009
2023-12-06 13:36:59 +00:00
Robert Longson fe6c97d4ee Bug 1836831 - don't try to resolve ray with StrokeBox when non-scaling-stroke is in effect r=boris
Differential Revision: https://phabricator.services.mozilla.com/D195552
2023-12-06 09:19:01 +00:00
Daniel Holbert 16526d690c Bug 1868456: Improve ManagedPostRefreshObserver invariants. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D195607
2023-12-06 02:09:29 +00:00
Cosmin Sabou 5c95548994 Backed out changeset d9e8e468a2f2 (bug 1866566) for wpt failures on content-visibility-animation-with-scroll-timeline-in-hidden-subtree.html. 2023-12-05 18:59:19 +02:00
Cathie Chen 4395752c23 Bug 1866566 - If there is change in over-all relevancy, update HiddenByContentVisibility for animations, r=emilio,hiro
Differential Revision: https://phabricator.services.mozilla.com/D195009
2023-12-05 15:57:51 +00:00
Hiroyuki Ikezoe 7f283c3839 Bug 1715179 - Propagate transform matrix and relevant zoom values to convert CSSRect/CSSPoint in OOPIF to top level content document cooords. r=botond
Depends on D186324

Differential Revision: https://phabricator.services.mozilla.com/D186325
2023-12-04 09:31:23 +00:00
Emilio Cobos Álvarez 09079239a4 Bug 1867769 - Remove custom checkbox and radio styling. r=dao,desktop-theme-reviewers
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
2023-12-02 18:52:47 +00:00
Vsevolod Buzinov 637c5339ea Bug 1865494: Implement see-through video player mode r=emilio,mstange,desktop-theme-reviewers,pip-reviewers,mhowell
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
2023-11-30 18:33:41 +00:00
Emilio Cobos Álvarez d407a74502 Bug 1866738 - Make initial about:blank docs always transparent, even in content docshells. r=jwatt
This implements the proposed fix to
https://github.com/w3c/csswg-drafts/issues/9624, and adds a tentative
test for it.

Differential Revision: https://phabricator.services.mozilla.com/D194751
2023-11-29 12:09:46 +00:00
Frederic Wang 850e093dc8 Bug 1867090 - Don't deliver resize loop error notification for internal Last Remembered Size observer. r=emilio
This fixes regression from bug 1866894.
Also revert some code used to worked these undesired errors.

Differential Revision: https://phabricator.services.mozilla.com/D194876
2023-11-29 09:06:49 +00:00
Emilio Cobos Álvarez 6d7d4024d9 Bug 1867042 - Don't force PresShell initialization from ResizeObserver handling. r=fredw
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
2023-11-28 22:27:59 +00:00
Norisz Fay 1488e83e44 Backed out 2 changesets (bug 1858984) for causing dt failures on browser_markup_dragdrop_reorder.js
Backed out changeset 03881cb508be (bug 1858984)
Backed out changeset 0aad09d9cd3f (bug 1858984)
2023-11-29 01:04:25 +02:00
Dan Robertson e698949a0b Bug 1858984 - Fix ComputeNeedToScroll with large line sizes. r=emilio
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
2023-11-28 18:27:33 +00:00
Stanca Serban 2b58cc84d0 Backed out 5 changesets (bug 1715179) for causing mochitests failures in test_group_double_tap_zoom-2.html. CLOSED TREE
Backed out changeset 600afc2dc0ca (bug 1715179)
Backed out changeset 75c2c7f6230e (bug 1715179)
Backed out changeset b851e0aff383 (bug 1715179)
Backed out changeset 0acfcbbdf460 (bug 1715179)
Backed out changeset b0c83c964ccf (bug 1715179)
2023-11-28 18:45:32 +02:00
Hiroyuki Ikezoe ed4976ed3c Bug 1715179 - Propagate transform matrix and relevant zoom values to convert CSSRect/CSSPoint in OOPIF to top level content document cooords. r=botond
Depends on D186324

Differential Revision: https://phabricator.services.mozilla.com/D186325
2023-11-28 09:42:22 +00:00