Commit graph

885 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
6c32b964cd Bug 1807003 - Centralize animation data in slots. r=smaug,firefox-animation-reviewers,boris
This should both be faster and simpler. Also will allow us in the future
to animate more pseudos without having to add a gazillion properties.

I think we should try to clear more stuff (maybe the whole animation
data) on unbind, but that's a bit tangential.

Differential Revision: https://phabricator.services.mozilla.com/D169860
2023-02-15 14:12:33 +00:00
Olli Pettay
0c62f41091 Bug 1816242 - Optimize nsRange::ContentRemoved in some common cases, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D169549
2023-02-13 13:42:00 +00:00
Emilio Cobos Álvarez
19d036b807 Bug 1815430 - nsFocusManager::GetRedirectedFocus is dead code. r=smaug
No implementation of nsIDOMXULMenuListElement returns an input field
(this is menulist.js and autocomplete-input.js).

It seems autocomplete-input used to do this, but it got refactored to
extend HTMLInputElement instead, so this code can all go.

Differential Revision: https://phabricator.services.mozilla.com/D169066
2023-02-07 13:47:48 +00:00
Adam Vandolder
2e0b78ffc1 Bug 1418449 - Add translate attribute to HTMLElement. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D167081
2023-01-19 16:00:55 +00:00
Iulian Moraru
738b761bb2 Backed out changeset 62c51637951f (bug 1418449) for causing wpt failures on idlharness.https.html?include=HTML. CLOSED TREE 2023-01-19 07:57:43 +02:00
Makoto Kato
cd0caacae2 Bug 1744288 - Store pending full screen request when calling element.requestFullscreen immediately. r=edgar
When `element.requestFullscreen` is called, we dispatch small task via
`Document::AsyncRequestFullscreen`. But it doesn't append `FullscreenRequests`
to `PendingFullscreenChangeList` immediately. So if we want to check
whether we have pending full screen request, we have to run an event loop.

Although I would like to check whether we have pending full screen request for
`screen.orientation.lock` compatibility, since we don't append it to pending
list immediately, we don't have the easy way to detect it.

`RequestFullscreen` doesn't wait for the completion if it runs on content
process since `RequestFullscreenInContentProcess` doesn't wait for the result
of chrome event. If runs on chrome process, `RequestFullscreenInParentProcess`
is synchronous. So this change removes `AsyncRequestFullscreen` and simply
calls `RequestFullscreen`.

By not using AsyncRequestFullscreen, we will append `FullscreenRequests` to
pending list immediately, so we can check it without event loop.

Differential Revision: https://phabricator.services.mozilla.com/D163583
2023-01-19 02:15:30 +00:00
Adam Vandolder
be4a839cea Bug 1418449 - Add translate attribute to HTMLElement. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D167081
2023-01-19 01:45:35 +00:00
Tom Schuster
c980dd1f25 Bug 1784040 - Error handling during construction of the sanitizer. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D159146
2023-01-16 15:21:40 +00:00
Emilio Cobos Álvarez
113c1d0d8a Bug 1792057 - Make sure to focus inner text field when creating / rebuilding edit fields in datetime widget. r=smaug
The blur is a regression from bug 1740989, but it's really uncovering a
regression from bug 1729342, sorta. Before that, we used to focus the
inner text field on rebuild via focusInnerTextBox().

One could argue that the focus fixup rule should really deal with this,
but I guess since content can't really unattach shadow DOM, it's less of
a general issue and more of an implementation detail.

The test uncovers another pre-existing issue (switching from date ->
test was also broken, and we left a bogus ElementState::FOCUS state in
the element).

Differential Revision: https://phabricator.services.mozilla.com/D158167
2023-01-11 22:16:38 +00:00
Emilio Cobos Álvarez
4f1f5e7314 Bug 1805414 - Remove nsMenuFrame and nsMenuParent. r=smaug,Jamie,desktop-theme-reviewers,settings-reviewers,dao
Move most the event handling stuff to the DOM. I've left nsMenuBarFrame
for now, but I will be removing that in the future.

The basic set up is:

  * nsMenuParent becomes XULMenuParentElement (menubar or popup, manages
    the current active menu item)

  * nsMenuFrame -> XULButtonElements that return true for IsMenu().
    Can't use XULMenuElement because of <button type=menu>, which
    behaves like a, well, menu.

This makes the a11y events for menus (DOMMenuItem{Active,Inactive}) make
sense (before that we were firing duplicate Inactive events etc, and the
event order was rather suspicious).

Differential Revision: https://phabricator.services.mozilla.com/D164210
2023-01-04 19:01:13 +00:00
Boris Chiou
38556e307d Bug 1807685 - Rename scroll-linked (animations) to scroll-driven (excluding WPT tests). r=dholbert
The spec is still using `Scroll-linked`, so we exclude the change of WPT tests.
I believe WPT will get updates once the spec doc is renamed.

Differential Revision: https://phabricator.services.mozilla.com/D165914
2023-01-04 00:50:45 +00:00
Csoregi Natalia
9807a6e6e8 Backed out changeset f11c529b2407 (bug 1805414) for failures on test_submenuClose.xhtml and nsMenuPopupFrame.cpp. CLOSED TREE 2023-01-04 01:48:30 +02:00
Emilio Cobos Álvarez
3d82727505 Bug 1805414 - Remove nsMenuFrame and nsMenuParent. r=smaug,Jamie,desktop-theme-reviewers,settings-reviewers,dao
Move most the event handling stuff to the DOM. I've left nsMenuBarFrame
for now, but I will be removing that in the future.

The basic set up is:

  * nsMenuParent becomes XULMenuParentElement (menubar or popup, manages
    the current active menu item)

  * nsMenuFrame -> XULButtonElements that return true for IsMenu().
    Can't use XULMenuElement because of <button type=menu>, which
    behaves like a, well, menu.

This makes the a11y events for menus (DOMMenuItem{Active,Inactive}) make
sense (before that we were firing duplicate Inactive events etc, and the
event order was rather suspicious).

Differential Revision: https://phabricator.services.mozilla.com/D164210
2023-01-03 22:06:01 +00:00
Boris Chiou
f856c08cc3 Bug 1774505 - Preserve the progress of null timeline for print. r=hiro
We always use the document timeline of the cloned document, and clone the
paused animation with the preserved progress, even if the original
timeline is null.

Differential Revision: https://phabricator.services.mozilla.com/D164712
2022-12-16 02:28:02 +00:00
Martin Robinson
281ff8ade5 Bug 1791759 - Add support for content-visibility: auto r=emilio
This change adds support for `content-visibilty: auto` as well as
showing and hiding content based on the relevancy of the content as
defined in the specification. Changes to relevancy are handled by
triggering updates in a set of `content-visibility: auto` frames stored
in PresShell at the appropriate time in the document lifecycle.

Some tests are now failing due to this feature exposing the failures,
but they will be fixed in later changes.

This change is a reland of an earlier version that properly updates
intrinsic sizes and triggers an update of remembered size for the
purposes of contain-intrinsic-size when content relevancy changes.

Co-authored-by: Jihye Hong <jihye@igalia.com>

Differential Revision: https://phabricator.services.mozilla.com/D159693
2022-11-30 18:00:27 +00:00
Marian-Vasile Laza
f4d4ce0e21 Backed out changeset c428c3ad7725 (bug 1791759) for causing wpt failures on auto-012.html. CLOSED TREE 2022-11-28 13:31:05 +02:00
Martin Robinson
e26b2a32b9 Bug 1791759 - Add support for content-visibility: auto r=emilio
This change adds support for `content-visibilty: auto` as well as
showing and hiding content based on the relevancy of the content as
defined in the specification. Changes to relevancy are handled by
triggering updates in a set of `content-visibility: auto` frames stored
in PresShell at the appropriate time in the document lifecycle.

Some tests are now failing due to this feature exposing the failures,
but they will be fixed in later changes.

Co-authored-by: Jihye Hong <jihye@igalia.com>

Differential Revision: https://phabricator.services.mozilla.com/D159693
2022-11-28 09:53:06 +00:00
Emilio Cobos Álvarez
d38d7fc847 Bug 1801517 - Remove nsPresContext::IsRootContentDocument(). r=hiro
The Element caller only cares about avoiding a flush and can use the
observable parent layout stuff.

The scrollframe one clearly wants the cross-process version according to
the comment.

Differential Revision: https://phabricator.services.mozilla.com/D162477
2022-11-21 08:04:58 +00:00
Emilio Cobos Álvarez
486040e135 Bug 1801094 - Clean-up a bit WhereToScroll. r=layout-reviewers,credential-management-reviewers,sgalich,dshin
This doesn't change behavior, but clarifies a bit the naming to match
the scrollIntoView() API. Also makes the name generic (rather than
Top/Left/etc), since for scrollIntoView we want to make the axes be
logical.

That will be done in bug 1789464 (probably via an extra ScrollFlag).

Differential Revision: https://phabricator.services.mozilla.com/D162286
2022-11-18 10:02:23 +00:00
Olli Pettay
4aff70800a Bug 1799354 - MutationRecord missing for Element.replaceChildren, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D161548
2022-11-16 20:29:52 +00:00
Emilio Cobos Álvarez
44ef3b8685 Bug 1799435 - Make RFP checks faster. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D161447
2022-11-08 02:36:25 +00:00
Sandor Molnar
7a39c6eef3 Backed out changeset c7f5349824c4 (bug 1799435) for causing crashes in mozilla::dom::HTMLImageElement::LoadSelectedImage CLOSED TREE 2022-11-08 02:39:14 +02:00
Emilio Cobos Álvarez
68c342910f Bug 1799435 - Make RFP checks faster. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D161447
2022-11-07 22:23:50 +00:00
Iulian Moraru
2f0dd0e293 Backed out changeset 44cb21194dc0 (bug 1799435) for causing multiple resist fingerprint related failures. CLOSED TREE 2022-11-07 18:42:11 +02:00
Emilio Cobos Álvarez
bac0597c49 Bug 1799435 - Make RFP checks faster. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D161447
2022-11-07 14:40:57 +00:00
Razvan Cojocaru
1629218702 Bug 1060421 - Change the type of [Int]PointTyped::[x|y] back to [Int]CoordTyped. r=botond
[Int]CoordTyped no longer inherits Units because otherwise
instances of [Int]IntPointTyped may get one Base subobject because
it inherits Units, and others because of BasePoint's Coord members,
which end up increasing the [Int]CoordTyped's objects size (since
according to the ISO C++ standard, different Base subobject are
required to have different addresses).

Differential Revision: https://phabricator.services.mozilla.com/D160713
2022-11-04 18:29:35 +00:00
Emilio Cobos Álvarez
204a200802 Bug 1798218 - Ignore transitions for printing. r=hiro
Two tweaks:

 * Use nsPresContext::Medium to decide whether to start transitions.
   This catches both the print emulation and the before/afterprint event
   dispatching code too, which is desirable.

 * Don't clone transition effects for print docs. This seems to match
   other browsers (click "trigger transition", then Ctrl+P in Chromium
   for example).

Move our existing css-animations tests to WPT. They were written for
compat with other browsers so we want to know if other browsers behave
differently.

Differential Revision: https://phabricator.services.mozilla.com/D161086
2022-11-03 23:23:39 +00:00
Adam Vandolder
0be4513261 Bug 1665151 - Part 2: Expose custom element default accessibility attributes. r=edgar,Jamie,credential-management-reviewers,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D159237
2022-11-02 14:50:56 +00:00
Csoregi Natalia
510661b9f3 Backed out changeset 4edc81a94eaa (bug 1792057) for causing multiple failures. CLOSED TREE 2022-10-05 21:53:02 +03:00
Emilio Cobos Álvarez
5d6bc39dcf Bug 1792057 - Make sure to focus inner text field when creating / rebuilding edit fields in datetime widget. r=smaug
The blur is a regression from bug 1740989, but it's really uncovering a
regression from bug 1729342, sorta. Before that, we used to focus the
inner text field on rebuild via focusInnerTextBox().

One could argue that the focus fixup rule should really deal with this,
but I guess since content can't really unattach shadow DOM, it's less of
a general issue and more of an implementation detail.

The test uncovers another pre-existing issue (switching from date ->
test was also broken, and we left a bogus ElementState::FOCUS state in
the element).

Differential Revision: https://phabricator.services.mozilla.com/D158167
2022-10-05 17:31:51 +00:00
Hiroyuki Ikezoe
8d11692199 Bug 1783021 - Remove animation related properties before nulling out nsINode::mParent. r=smaug,jdescottes
Without this change we can't tell properly whether the element in question is the
shadow root or not in animation mutation observer, specifically at a
ShadowRoot::FromNote call in ForEachAncestorObserver [1].

The test case in this change is based on a test case created by Julian Descottes [2].

[1] https://searchfox.org/mozilla-central/rev/b1e5f2c7c96be36974262551978d54f457db2cae/dom/base/MutationObservers.cpp#67
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1783021#c9

Differential Revision: https://phabricator.services.mozilla.com/D157881
2022-10-04 04:41:52 +00:00
Noemi Erli
3e02ba3f69 Backed out changeset 1214807cfb19 (bug 1783021) for causing failures in test_animation_observers_sync.html CLOSED TREE 2022-09-23 05:25:07 +03:00
Hiroyuki Ikezoe
d007be468d Bug 1783021 - Remove animation related properties before nulling out nsINode::mParent. r=smaug,jdescottes
Without this change we can't tell properly whether the element in question is the
shadow root or not in animation mutation observer, specifically at a
ShadowRoot::FromNote call in ForEachAncestorObserver [1].

The test case in this change is based on a test case created by Julian Descottes [2].

[1] https://searchfox.org/mozilla-central/rev/b1e5f2c7c96be36974262551978d54f457db2cae/dom/base/MutationObservers.cpp#67
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1783021#c9

Differential Revision: https://phabricator.services.mozilla.com/D157881
2022-09-23 01:52:07 +00:00
Martin Robinson
f943c5f18d Bug 1789255: Anonymous children of elements with content-visibility should not be skipped for layout r=emilio
Some anonymous children are important for properly sizing their parents
even when those parents hide content with `content-visibility`. This is
shown by regressions in the proper layout of some form elements with
`content-visibility`.

This change introduces a more conservative approach for avoiding layout
of hidden content. Instead of leaving all children dirty during reflow,
reflow anonymous frames (and nsComboboxDisplayFrame, a specialized kind
of anonymous frame). This change means that frames may only lay out some
of their children, so it must introduce some more changes to assumptions
during line layout.

In addition, this change renames `content-visibility` related methods in
nsIFrame in order to make it more obvious what they do.

Differential Revision: https://phabricator.services.mozilla.com/D157306
2022-09-15 20:32:27 +00:00
Norisz Fay
fd54c095de Backed out changeset c3780baf6f24 (bug 1789255) for causing build bustages CLOSED TREE 2022-09-15 21:14:04 +03:00
Martin Robinson
631f1807ed Bug 1789255: Anonymous children of elements with content-visibility should not be skipped for layout r=emilio
Some anonymous children are important for properly sizing their parents
even when those parents hide content with `content-visibility`. This is
shown by regressions in the proper layout of some form elements with
`content-visibility`.

This change introduces a more conservative approach for avoiding layout
of hidden content. Instead of leaving all children dirty during reflow,
reflow anonymous frames (and nsComboboxDisplayFrame, a specialized kind
of anonymous frame). This change means that frames may only lay out some
of their children, so it must introduce some more changes to assumptions
during line layout.

In addition, this change renames `content-visibility` related methods in
nsIFrame in order to make it more obvious what they do.

Differential Revision: https://phabricator.services.mozilla.com/D157306
2022-09-15 17:56:42 +00:00
Sandor Molnar
4009825526 Backed out changeset 3a5759eabb42 (bug 1789255) for causing wpt failures in netwerk/protocol/http/Http2Session.cpp CLOSED TREE 2022-09-14 02:01:36 +03:00
Martin Robinson
f48a334b7c Bug 1789255: Anonymous children of elements with content-visibility should not be skipped for layout r=emilio
Some anonymous children are important for properly sizing their parents
even when those parents hide content with `content-visibility`. This is
shown by regressions in the proper layout of some form elements with
`content-visibility`.

This change introduces a more conservative approach for avoiding layout
of hidden content. Instead of leaving all children dirty during reflow,
reflow anonymous frames (and nsComboboxDisplayFrame, a specialized kind
of anonymous frame). This change means that frames may only lay out some
of their children, so it must introduce some more changes to assumptions
during line layout.

In addition, this change renames `content-visibility` related methods in
nsIFrame in order to make it more obvious what they do.

Differential Revision: https://phabricator.services.mozilla.com/D156473
2022-09-13 20:01:35 +00:00
Calixte
ffb67e7b84 Bug 1790576 - In the pdf viewer, allow to switch to presentation mode in using the keyboard without a transient activation r=edgar,pdfjs-reviewers,marco
Differential Revision: https://phabricator.services.mozilla.com/D157202
2022-09-13 12:37:56 +00:00
Emilio Cobos Álvarez
f32093456d Bug 1786513 - Make SimpleResizeReflow not flush by default. r=jfkthame,layout-reviewers
Only GeckoMVMContext really needs the flush, to measure scrolled height
afterwards. Do that explicitly.

This shouldn't change behavior, for the most part; there was a preload
test that relied on the flush when changing DPI to start a run really
clean, but other than that this looks green on try.

Should at best be neutral (just code clean-up), or be a performance
improvement.

In a follow-up, we can possibly remove the DelayedResize code from the
view manager, though I need to think how to possibly coalesce the MVM
reflows, so let's not do that yet.

Differential Revision: https://phabricator.services.mozilla.com/D155385
2022-09-01 10:54:24 +00:00
Martin Robinson
ff6e1e7e64 Bug 1767262 - Lazily layout content that is hidden via content-visibility: hidden r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D145949
2022-08-29 14:41:36 +00:00
Cristian Tuns
24652e5425 Backed out changeset e29b0fbf77f1 (bug 1786513) for causing mochitest failures on /browser_unified_extensions.js CLOSED TREE 2022-08-26 11:11:46 -04:00
Emilio Cobos Álvarez
7c34c8de9a Bug 1786513 - Make SimpleResizeReflow not flush by default. r=jfkthame,layout-reviewers
Only GeckoMVMContext really needs the flush, to measure scrolled height
afterwards. Do that explicitly.

This shouldn't change behavior, for the most part; there was a preload
test that relied on the flush when changing DPI to start a run really
clean, but other than that this looks green on try.

Should at best be neutral (just code clean-up), or be a performance
improvement.

In a follow-up, we can possibly remove the DelayedResize code from the
view manager, though I need to think how to possibly coalesce the MVM
reflows, so let's not do that yet.

Differential Revision: https://phabricator.services.mozilla.com/D155385
2022-08-26 12:58:12 +00:00
Sandor Molnar
a4f3a0f44b Backed out changeset f67c8298a104 (bug 1767262) for causing wpt assertion failures in layout/base/PresShell.cpp CLOSED TREE 2022-08-24 20:39:45 +03:00
Martin Robinson
9d8878f0d0 Bug 1767262 - Lazily layout content that is hidden via content-visibility: hidden r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D145949
2022-08-24 13:30:55 +00:00
Butkovits Atila
5c5ef28ffa Backed out changeset 5a4a5749f8dc (bug 1767262) for causing wpt failures. 2022-08-23 18:33:04 +03:00
Martin Robinson
4d8325d138 Bug 1767262 - Lazily layout content that is hidden via content-visibility: hidden r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D145949
2022-08-23 14:16:10 +00:00
Emilio Cobos Álvarez
dd9f38a043 Bug 1777293 - Implement Element.checkVisibility(). r=jwatt
Implement it with a "no-flush" ChromeOnly option so that things like
bug 1783045 can use it without causing flashes of unstyled content, etc.

Differential Revision: https://phabricator.services.mozilla.com/D155206
2022-08-22 17:28:04 +00:00
Oriol Brufau
53cf586b7a Bug 1784577 - Add logic for updating the last remembered size. r=emilio
Depends on D154575

Differential Revision: https://phabricator.services.mozilla.com/D152642
2022-08-21 23:27:22 +00:00
Oriol Brufau
90e549ef1c Bug 1781046 - Let elements have a last remembered size. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D154322
2022-08-12 15:06:42 +00:00