Commit Graph

6707 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
2c6de5f038 Bug 1839223 - Remove nsMappedAttributes. r=smaug
Instead, lazily schedule evaluation of them before styling, much like we
were doing for SVG.

A subtle tweak is that we only remain scheduled while in the document.
This allows us to use the "in document" bit plus the "mapped attributes
dirty" bit to know our scheduled status. It also prevents doing silly
work for disconnected elements, and having to do hashmap lookups on
adoption and node destruction.

Differential Revision: https://phabricator.services.mozilla.com/D181549
2023-06-22 14:31:16 +00:00
Noemi Erli
ea5b4807dc Backed out 2 changesets (bug 1825745) for causing failures in form-requestsubmit.html CLOSED TREE
Backed out changeset eb77df0ccca6 (bug 1825745)
Backed out changeset 2ce4ceb5a39d (bug 1825745)
2023-06-22 16:35:27 +03:00
Peter Van der Beken
246deb207e Bug 1825745 - Fix intermittent failure of testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click.html. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D180534
2023-06-22 08:07:06 +00:00
Norisz Fay
e86f1fa0e9 Backed out 5 changesets (bug 1838829) for causing mochitest failures CLOSED TREE
Backed out changeset 693d34c8447d (bug 1838829)
Backed out changeset 903d9ff4afaa (bug 1838829)
Backed out changeset 5e51feff7467 (bug 1838829)
Backed out changeset e125be49d2a6 (bug 1838829)
Backed out changeset 1a8cf3c83dc4 (bug 1838829)
2023-06-22 03:37:07 +03:00
Kershaw Chang
2cdb6b3a96 Bug 1838829 - Skip failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,dimi,valentin,robwu
Differential Revision: https://phabricator.services.mozilla.com/D181251
2023-06-21 19:43:33 +00:00
Tom Schuster
2554bd9b9a Bug 1838415 - Add explicit targets for HTMLVideoElement metadata. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D180937
2023-06-21 07:01:22 +00:00
Emilio Cobos Álvarez
1c92ed74cb Bug 1839255 - Clean up a bit the mapped attribute set-up. r=smaug
This doesn't change behavior on its own. It could be split up a bit more
if needed though over all it shouldn't be hard to follow.

Unify nsHTMLStyleSheet and nsHTMLCSSStyleSheet into AttributeStyles
because the fact that we have two right now is pretty silly. They are
also not stylesheets (they used to be pre-stylo).

Differential Revision: https://phabricator.services.mozilla.com/D181414
2023-06-20 10:02:44 +00:00
Ziran Sun
96a16d3cad Bug 1835464 - Check dialog is modal flag instead of open attribute in 'check popover validity' algorithm. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D181089
2023-06-20 08:49:32 +00:00
Iulian Moraru
527ef4f7e5 Backed out changeset 9fb58fa7b8b6 (bug 1556358) for causing wpt failures on ElementInternals-setFormValue.html. CLOSED TREE 2023-06-20 08:16:50 +03:00
avandolder
31e82aa9be Bug 1556358 - Part 2: Save and restore custom element form data. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D174115
2023-06-20 01:29:58 +00:00
Natalia Csoregi
ddf6d6b447 Backed out changeset 08f12e7fa5f0 (bug 1556358) for causing bustage on ElementInternals.cpp. CLOSED TREE 2023-06-19 21:15:17 +03:00
avandolder
264a268d3b Bug 1556358 - Part 2: Save and restore custom element form data. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D174115
2023-06-19 17:22:01 +00:00
Norisz Fay
6f6032c8fd Backed out changeset 1680323680fe (bug 1556358) for causing Bb bustages on ElementInternals.cpp CLOSED TREE 2023-06-19 18:33:35 +03:00
Adam Vandolder
d6f990f53a Bug 1556358 - Part 2: Save and restore custom element form data. r=edgar
Depends on D175542

Differential Revision: https://phabricator.services.mozilla.com/D174115
2023-06-19 13:44:15 +00:00
Brad Werth
13bfef14a1 Bug 1836824 Part 1: Make HTMLCanvasElement re-register its frame refresh driver when a context is updated. r=jgilbert
Since HTMLCanvasElement has a lazily-created context, and the
RequestedFrameRefreshObserver will fail to watch the state when the
context is null, this patch adds a hook to try to re-register when
UpdateContext is called. The superclass calls UpdateContext after the
context is initially created.

Differential Revision: https://phabricator.services.mozilla.com/D181149
2023-06-16 21:13:00 +00:00
Emilio Cobos Álvarez
cea323d30e Bug 1837816 - Make selector cache not tied to a document. r=media-playback-reviewers,karlt,mstange
It doesn't really need to.

Differential Revision: https://phabricator.services.mozilla.com/D180591
2023-06-16 17:20:42 +00:00
Stanca Serban
cb33cee97e Backed out 3 changesets (bug 1556358) for causing Bb build bustages in ElementInternals.cpp. CLOSED TREE
Backed out changeset f7e94ea82252 (bug 1556358)
Backed out changeset c80f29a9cefc (bug 1556358)
Backed out changeset 413225d91666 (bug 1556358)
2023-06-16 19:46:02 +03:00
Adam Vandolder
61ab1463b6 Bug 1556358 - Part 3: Restore FACE state in SessionStore. r=edgar,farre
Depends on D174115

Differential Revision: https://phabricator.services.mozilla.com/D179278
2023-06-16 15:02:11 +00:00
Adam Vandolder
401c77f4ac Bug 1556358 - Part 2: Save and restore custom element form data. r=edgar
Depends on D175542

Differential Revision: https://phabricator.services.mozilla.com/D174115
2023-06-16 15:02:11 +00:00
Cathie Chen
1cedb71f13 Bug 1837360 - Popover: Align to the update of specification regarding nested popover, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D181121
2023-06-16 13:59:43 +00:00
Marco Castelluccio
21a2f56033 Bug 898315 - Update all callers of FileUtils.getDir to remove usage of the shouldCreate parameter. r=Gijs,extension-reviewers,application-update-reviewers,nalexander,robwu
Differential Revision: https://phabricator.services.mozilla.com/D180603
2023-06-15 08:10:45 +00:00
Noemi Erli
37e0c3eb20 Backed out changeset 63ccd00a399a (bug 898315) for causing failures in test_no_window_update_restart.py CLOSED TREE 2023-06-15 03:21:27 +03:00
Noemi Erli
c9a78e6659 Backed out 3 changesets (bug 1556358) for causing bustages in ElementInternals.cpp CLOSED TREE
Backed out changeset 0ebda393786b (bug 1556358)
Backed out changeset c41794eef66a (bug 1556358)
Backed out changeset a07e3e226569 (bug 1556358)
2023-06-15 01:32:38 +03:00
Emilio Cobos Álvarez
31e76d13b4 Bug 1838045 - Make <link rel=stylesheet> load event scheduling saner. r=smaug
The spec asks to post a task, see html.spec.whatwg.org/#update-a-style-block

What we were doing is quite crazy. Unifying the scheduling between
<style> and <link rel=stylesheet> on the patch above causes failures on
some mochitests.

Some of them aren't really related to these and are a pre-existing bug,
see bug 1838346.

Differential Revision: https://phabricator.services.mozilla.com/D180895
2023-06-14 21:42:31 +00:00
Adam Vandolder
8149717b64 Bug 1556358 - Part 3: Restore FACE state in SessionStore. r=edgar,farre
Depends on D174115

Differential Revision: https://phabricator.services.mozilla.com/D179278
2023-06-14 20:59:29 +00:00
Adam Vandolder
b0f2ac85c7 Bug 1556358 - Part 2: Save and restore custom element form data. r=edgar
Depends on D175542

Differential Revision: https://phabricator.services.mozilla.com/D174115
2023-06-14 20:59:29 +00:00
Marco Castelluccio
c85e65e2e0 Bug 898315 - Update all callers of FileUtils.getDir to remove usage of the shouldCreate parameter. r=Gijs,extension-reviewers,application-update-reviewers,nalexander,robwu
Differential Revision: https://phabricator.services.mozilla.com/D180603
2023-06-14 20:55:52 +00:00
Tom Schuster
fec8e2b942 Bug 1837153 - Make RFPTarget parameter of ShouldResistFingerprinting with justification non-optional. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D180667
2023-06-14 13:34:59 +00:00
Adam Vandolder
61ffa36c9d Bug 1827512 - Properly handle type and src attribute changes on script tags. r=smaug
Modifies the preparation of script tags in order to better follow the
specification. Now, scripts are only considered to have already started
if they have a valid type when being prepared, and only changes to the
src attribute trigger script preparation, instead of for all attributes.
This allows script tags to be re-run after their type and src are
modified, if they haven't run already.

Differential Revision: https://phabricator.services.mozilla.com/D175795
2023-06-14 04:00:09 +00:00
Masayuki Nakano
0208d2abca Bug 1836806 - Make TextControlState::SetValueWithoutTextEditor() notify IMEContentObserver of value changes even if it has a bounding frame r=smaug
This is an edge case which couldn't be fixed in bug 1835353.

In the testcase, `TextControlState` has new frame for the new
`<input type="number">` when its `stepUp()` is called.  However, its
`TextEditor` has not been recreated yet because it's not safe yet.  Therefore,
`SetValueWithoutTextEditor()` is called, but I added the new path notifying
`IMEContentObserver` of the value changes does not run if `mBoundFrame` is not
`nullptr`.  I don't remember why I did so (probably for avoiding performance
regressions as far as possible), but it does not make sense not to notify
`IMEContentObserver` if only `mTextEditor` has not been recreated because
`IMEStateManager` has not been reinitialized `IMEContentObserver` with new
anonymous `<div>`s yet because it requires new `TextEditor` instance.

Differential Revision: https://phabricator.services.mozilla.com/D180767
2023-06-14 01:26:33 +00:00
Kagami Sascha Rosylight
266882e325 Bug 1829874 - Add prefs for tests r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D180831
2023-06-13 17:52:52 +00:00
Emilio Cobos Álvarez
574b2cd0ea Bug 1838219 - Notify of user activation after <input type=file/color> picking. r=edgar
This allows opening popups after this.

Differential Revision: https://phabricator.services.mozilla.com/D180827
2023-06-13 16:36:37 +00:00
Adam Vandolder
327c7e2b15 Bug 1556358 - Part 1: Add formStateRestore CE lifecycle callback. r=edgar
Depends on D176127

Differential Revision: https://phabricator.services.mozilla.com/D174114
2023-06-13 15:51:46 +00:00
Kagami Sascha Rosylight
d753b20dd1 Bug 1829874 - Allow events on disabled fieldsets r=edgar
The HTML spec does not allow fieldset to be "disabled as a form control". The spec does not explicitly define whether fieldset is a form control or not (and thus can be disabled as a child of another fieldset), but here we assume it does not as:

* It's not a "control", right?
* It would be confusing if it could not be disabled by its own but could be disabled as a child.

Differential Revision: https://phabricator.services.mozilla.com/D179986
2023-06-13 13:11:20 +00:00
Cosmin Sabou
fb079cff05 Backed out changeset 487a29bd817e (bug 1829874) for fieldset related mochitest failures. 2023-06-13 15:30:05 +03:00
Kagami Sascha Rosylight
5b373288ea Bug 1829874 - Allow events on disabled fieldsets r=edgar
The HTML spec does not allow fieldset to be "disabled as a form control". The spec does not explicitly define whether fieldset is a form control or not (and thus can be disabled as a child of another fieldset), but here we assume it does not as:

* It's not a "control", right?
* It would be confusing if it could not be disabled by its own but could be disabled as a child.

Differential Revision: https://phabricator.services.mozilla.com/D179986
2023-06-13 11:30:18 +00:00
Norisz Fay
bc7286b898 Backed out 3 changesets (bug 1792110) for causing mochitest failures on test_bug756984.html CLOSED TREE
Backed out changeset 0d88c6fe314b
Backed out changeset 083b3dc773f3 (bug 1792110)
Backed out changeset 63bffcdc61e8 (bug 1792110)
2023-06-09 18:37:47 +03:00
Sean Feng
3ed2ae6c3a Update test_Bug 1792110.html to accommodate the common ancestor changes for mouseup r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D180379
2023-06-09 13:25:04 +00:00
Olli Pettay
7b5502f163 Bug 1837522 - HTMLOptionElement text setter should not reuse textnode, r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D180394
2023-06-09 08:10:47 +00:00
Emilio Cobos Álvarez
cac40bd1b4 Bug 1837375 - HTMLTextArea::Clone has two codepaths for cloning the value. r=smaug
Unify them into one. The static document codepath also was setting
mValueChanged, so this seems fine.

Differential Revision: https://phabricator.services.mozilla.com/D180311
2023-06-08 15:14:41 +00:00
Emilio Cobos Álvarez
9ac32645f7 Bug 1837382 - Remove nsIContent::IsDoneAddingChildren. r=smaug
It's only called once for a place where it knows it's a select element.

Differential Revision: https://phabricator.services.mozilla.com/D180312
2023-06-08 14:59:31 +00:00
Peter Van der Beken
6010b195d7 Bug 1814870 - HTML pattern attribute should set v flag for regular expressions. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D180201
2023-06-08 12:10:09 +00:00
Nika Layzell
bfebcdae69 Bug 1837090 - Support [NeedsSubjectPrincipal] on workers, r=peterv
We've supported nsIPrincipal off-main-thread since bug 1443925, and
nsIPrincipal has been used as the JSPrincipals on workers and worklets
since bug 1804093.

This change updates the signature of these methods to match the main
thread, and provides the subject principal off-main-thread as well as on
the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D180158
2023-06-07 15:58:51 +00:00
june wilde
d4e5590f40 Bug 1550743 - Change DoSecureToInsecureSubmitCheck to use IsSecureContext; r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D176319
2023-06-06 15:04:41 +00:00
Ziran Sun
3fbdf8d345 Bug 1833570 - Reset the popover invoker in showPopover(). r=emilio
As discussed in [1], we need to reset invoker in showPopover(). If not,
It's possible that a closed popover still has an invoker.

[1] https://github.com/whatwg/html/issues/9152

Differential Revision: https://phabricator.services.mozilla.com/D179195
2023-06-06 10:50:33 +00:00
Vincent Hilla
ae0257ca20 Bug 675943 - Part 3: Clean up after implementing dirname. r=edgar
Depends on D178164

Differential Revision: https://phabricator.services.mozilla.com/D178278
2023-06-06 07:51:37 +00:00
Vincent Hilla
148e8efb7d Bug 675943 - Part 2: Implement dirname attr for textarea elements within forms. r=edgar
Depends on D175626

Differential Revision: https://phabricator.services.mozilla.com/D178164
2023-06-06 07:51:37 +00:00
Vincent Hilla
1397cacaf8 Bug 675943 - Part 1: Implement dirname attr for input elements within forms. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D175626
2023-06-06 07:51:36 +00:00
Ziran Sun
d878f6e9df Bug 1833570 - Correct the handling of popovertargetaction value. r=emilio
The popovertargetaction attribute's invalid value default and missing value default are both the toggle state.

https://html.spec.whatwg.org/#popover-target-attribute-activation-behavior

Differential Revision: https://phabricator.services.mozilla.com/D179050
2023-06-05 12:30:10 +00:00
Emilio Cobos Álvarez
882ddb97e5 Bug 1835437 - Be consistent about value sanitization in HTMLInputElement::SetDirectionFromValue. r=smaug
aKnownValue is unsanitized, but GetValue is sanitized. Make sure they
match.

Differential Revision: https://phabricator.services.mozilla.com/D179790
2023-06-04 08:54:25 +00:00
CanadaHonk
f7d6eb2edb Bug 1834110 - Do not run script elements with whitespace type attribute values r=peterv
Fixed running script elements with a type attribute value with whitespace
(like " ").

Fixed by comparing value emptiness before and after trim, if not empty
before and empty after, undo the trim.

2 WPT subtests now newly pass.

WPT tests: https://wpt.fyi/results/html/semantics/scripting-1/the-script-element/script-type-and-language-js.html

Differential Revision: https://phabricator.services.mozilla.com/D178573
2023-06-02 15:24:14 +00:00
Cathie Chen
85bce2f578 Bug 1835671 - Popover: add repeatingHide to hide all popovers until algorithm, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D179454
2023-06-02 15:01:48 +00:00
Cathie Chen
fa7b94707d Bug 1836057 - Popover: Use dialog initial focus for dialog popovers, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D179580
2023-06-01 18:16:53 +00:00
Mirko Brodesser
9c1b44e3a9 Bug 1834972: when removing the popover attribute, remove the corresponding element from the top layer after hiding the popover. r=emilio
This requires the `PopoverData` to exist when
`RemovePopoverFromTopLayer` is called, since the latter asserts the
former's existence
(https://searchfox.org/mozilla-central/rev/8dd0d2bebe4c897152da6c86d937e4be80bbaa54/dom/base/Document.cpp#15149-15150).
Hence, clearing the popover data only after removing the element from
the top layer.

Differential Revision: https://phabricator.services.mozilla.com/D179434
2023-06-01 12:17:40 +00:00
Masayuki Nakano
53f87d35ce Bug 1835353 - Make TextControlState notify IMEContentObserver of setting new value during no frame r=smaug
`IMEContentObserver` can observe the value changes only while the text control
has anonymous `<div>` element because it observers the DOM mutation.  The
anonymous `<div>` is alive (connected) only while the text control element
has a frame (recreated at each reframe).  Therefore, `IMEContentObserver`
cannot observe the value changed during reframing.

This patch makes `TextControlState` notify `IMEContentObserver` of setting
new value directly only when it does not have `mBoundFrame`.

Differential Revision: https://phabricator.services.mozilla.com/D179358
2023-05-31 12:11:44 +00:00
Tom Schuster
b4c6e62b3c Bug 1834737 - Make RFPTarget parameter of Document::ShouldResistFingerprinting non-optional. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D178925
2023-05-31 09:46:54 +00:00
Ziran Sun
b84908da02 Bug 1833570 - Change popover invoker type from boolean to Element. r=emilio
The invoker type is currently implemented as boolean as suggested at
https://github.com/whatwg/html/issues/9168. This issue is now closed and
has been fixed at https://github.com/whatwg/html/pull/9171.

This patch is to be follow above discussions and implement popover invoker
type as element.

Differential Revision: https://phabricator.services.mozilla.com/D178287
2023-05-31 08:59:10 +00:00
Cathie Chen
1e8eb12010 Bug 1833883 - Popover: Don't restore popover focus for manual popovers, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178447
2023-05-30 13:28:52 +00:00
Cathie Chen
b968df97f6 Bug 1834343 - Flush frames before trying to focus popover, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178691
2023-05-30 13:28:26 +00:00
Cosmin Sabou
b5b6fbfc18 Backed out changeset 934b572f87f7 (bug 1833570) for causing build bustages on PopoverData.h. 2023-05-29 19:27:18 +03:00
Ziran Sun
c5177188cb Bug 1833570 - Change popover invoker type from boolean to Element. r=emilio
The invoker type is currently implemented as boolean as suggested at
https://github.com/whatwg/html/issues/9168. This issue is now closed and
has been fixed at https://github.com/whatwg/html/pull/9171.

This patch is to be follow above discussions and implement popover invoker
type as element.

Differential Revision: https://phabricator.services.mozilla.com/D178287
2023-05-29 15:08:47 +00:00
Cosmin Sabou
1338e14796 Backed out changeset 31915ad32476 (bug 1833570) for causing build bustages on PopoverData.h. CLOSED TREE 2023-05-29 11:06:57 +03:00
Ziran Sun
789fd6cf50 Bug 1833570 - Change popover invoker type from boolean to Element. r=emilio
The invoker type is currently implemented as boolean as suggested at
https://github.com/whatwg/html/issues/9168. This issue is now closed and
has been fixed at https://github.com/whatwg/html/pull/9171.

This patch is to be follow above discussions and implement popover invoker
type as element.

Differential Revision: https://phabricator.services.mozilla.com/D178287
2023-05-29 07:21:22 +00:00
Brad Werth
0e2033fa95 Bug 1834049: Permit canvas captureStream without initializing the context. r=lsalzman
The spec does not seem to require a current context, so there's no reason
to require it here. If later calls within
`HTMLCanvasElement::CaptureStream` need a current context, they'll have
their own failure messages which will hopefully clarify where exactly we
need the context to exist.

Differential Revision: https://phabricator.services.mozilla.com/D178985
2023-05-27 16:23:27 +00:00
Masayuki Nakano
a40b5c8d8d Bug 1833264 - Enable undo/redo in password fields r=m_kato
It was intentionally disabled in bug 271154 in 2004 for protecting users use
PC in public spaces.  However, in these days, only protecting from undo
transactions is not enough and most users must use smart phones instead.
Therefore, let's revert the change for compatibility with the other browsers.

Differential Revision: https://phabricator.services.mozilla.com/D178904
2023-05-26 00:13:35 +00:00
Cristian Tuns
f8d5019d88 Backed out changeset 6d4600975de9 (bug 1834049) for causing wpt failures in MediaStreamTrack-contentHint.html CLOSED TREE 2023-05-25 14:17:38 -04:00
Brad Werth
5bc65aa678 Bug 1834049: Permit canvas captureStream without initializing the context. r=lsalzman
The spec does not seem to require a current context, so there's no reason
to require it here. If later calls within
`HTMLCanvasElement::CaptureStream` need a current context, they'll have
their own failure messages which will hopefully clarify where exactly we
need the context to exist.

Differential Revision: https://phabricator.services.mozilla.com/D178985
2023-05-25 16:08:29 +00:00
Ziran Sun
791826bf87 Bug 1834519 - Don't throw when popovers/dialogs are in requested state. r=emilio
Update to be in line with spec discussions at
https://github.com/whatwg/html/pull/9142

Differential Revision: https://phabricator.services.mozilla.com/D178782
2023-05-25 08:35:29 +00:00
Mirko Brodesser
f80234e71d Bug 1831081: when the popover attribute changed, update the popover attribute state before hiding the popover. r=emilio
Moreover, simplify the code to match the spec more closely.

Differential Revision: https://phabricator.services.mozilla.com/D178906
2023-05-25 07:24:42 +00:00
Otto Länd
43499f6fab Bug 1703812, 1817997, 1821362: apply code formatting via Lando
# ignore-this-changeset
2023-05-24 13:28:38 +00:00
Paul Adenot
6ae500f220 Bug 1817997 - Write a version of GetSeekableTimeRanges that uses double and not TimeUnit. r=alwu
When playing a MediaSource, `seekable` should return `[0, duration]`, and duration
can be a double of any precision.

Differential Revision: https://phabricator.services.mozilla.com/D176042
2023-05-24 13:18:43 +00:00
Paul Adenot
8de71980b4 Bug 1817997 - Limit time resolution to microsecond on values exposed to script. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D176041
2023-05-24 13:18:43 +00:00
Paul Adenot
0412867c82 Bug 1817997 - Replace more double representing seconds by TimeUnit in MediaSource. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D176037
2023-05-24 13:18:42 +00:00
Paul Adenot
c4fa7046a4 Bug 1817997 - Reduce precision when storing time related to the played attribute. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D173528
2023-05-24 13:18:42 +00:00
Paul Adenot
cbf71085fb Bug 1817997 - Update HTMLMediaElement to use the new TimeUnit. r=alwu
Similarly to other commits, it's necessary to sometimes reduce the precision of
returned time values, to ensure there's no change to returned numbers.

Differential Revision: https://phabricator.services.mozilla.com/D173313
2023-05-24 13:18:41 +00:00
Cosmin Sabou
50307024b4 Backed out 3 changesets (bug 675943) for causing wpt unexpected passes.
Backed out changeset 56d084bfc8b8 (bug 675943)
Backed out changeset 8f514549a81c (bug 675943)
Backed out changeset 33fabcece85d (bug 675943)
2023-05-24 14:43:06 +03:00
Mirko Brodesser
d1b6593b65 Bug 1834493: part 1) Rename PopoverState to PopoverAttributeState. r=emilio
Less confusing.

Differential Revision: https://phabricator.services.mozilla.com/D178770
2023-05-24 10:48:04 +00:00
Vincent Hilla
f3ec29ff3d Bug 675943 - Part 3: Clean up after implementing dirname. r=edgar
Depends on D178164

Differential Revision: https://phabricator.services.mozilla.com/D178278
2023-05-24 08:04:52 +00:00
Vincent Hilla
1060b16a3b Bug 675943 - Part 2: Implement dirname attr for textarea elements within forms. r=edgar
Depends on D175626

Differential Revision: https://phabricator.services.mozilla.com/D178164
2023-05-24 08:04:52 +00:00
Vincent Hilla
cbddce7dcc Bug 675943 - Part 1: Implement dirname attr for input elements within forms. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D175626
2023-05-24 08:04:51 +00:00
Jens Stutte
129df77e82 Bug 1834326 - Have different error messages for QuotaExceededError in media APIs. r=media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D178683
2023-05-24 07:51:42 +00:00
Ziran Sun
f9edef8b84 Bug 1834334 - Include input reset and input button types to button type for target element. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178670
2023-05-23 18:11:58 +00:00
Emilio Cobos Álvarez
b8ac0dfcbe Bug 1833477 - Make type attribute changes follow the spec more closely. r=smaug,masayuki
The issue here is that the SetValueInternal call made us go from empty
value to non-empty due to color's specialness of returning black always,
but since the value dirty flag wasn't set, the non-empty value actually
didn't make a difference and just confused the code.

Make the code follow the spec more closely, which fixes this (in
particular the SetDefaultValueAsValue call).

Also, remove some useless code in SetValueInternal() since callers end
up in OnValueChanged() effectively everywhere except when mDoneCreating
is false (in which case we can just wait until DoneCreatingElement calls
us again), and if the do not end up there then that's a bug to fix.

Differential Revision: https://phabricator.services.mozilla.com/D178706
2023-05-23 15:18:03 +00:00
Mirko Brodesser
f27b7d97f9 Bug 1831097: declare HTMLElement's togglePopover argument force optional. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D177377
2023-05-23 14:26:57 +00:00
Mirko Brodesser
3895bbb54c Bug 1832033: change CheckPopoverValidity to match spec more closely. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D177486
2023-05-23 14:26:57 +00:00
Vincent Hilla
400e875b6d Bug 1108425 - Fix dir=auto for textarea with rtl text. r=smaug
I copy-pasted all `SetDirectionFromValue`-related parts from HTMLInputElement to HTMLTextAreaElement

Differential Revision: https://phabricator.services.mozilla.com/D176999
2023-05-22 12:35:01 +00:00
Mark Banner
130a655906 Bug 1826062 - Automatic fixes for upgrading Prettier to 2.8.8. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,calu
Differential Revision: https://phabricator.services.mozilla.com/D177027
2023-05-20 12:26:53 +00:00
Mark Banner
8219a5c503 Bug 1826062 - Automatic fixes for Prettier 2.0.5 upgrade. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,owlish
Differential Revision: https://phabricator.services.mozilla.com/D177025
2023-05-20 12:26:49 +00:00
Cosmin Sabou
5fd965f028 Backed out 80 changesets (bug 1821362, bug 1703812, bug 1817997) for causing media crashes as in Bug 1833890. a=backout
Backed out changeset f2113c9b661f (bug 1817997)
Backed out changeset f1ecfbba7ed2 (bug 1703812)
Backed out changeset 011cece33b0d (bug 1817997)
Backed out changeset 4b42659090f3 (bug 1817997)
Backed out changeset 2d92f903dd66 (bug 1817997)
Backed out changeset 0ef13d357ee3 (bug 1817997)
Backed out changeset 7353f869efd2 (bug 1703812)
Backed out changeset 14b061d0f595 (bug 1817997)
Backed out changeset d29bc29397c8 (bug 1703812)
Backed out changeset 54c3294f0839 (bug 1817997)
Backed out changeset b9f2e1155bd7 (bug 1817997)
Backed out changeset d5d5d390dcbf (bug 1817997)
Backed out changeset 8fca27bd0f6b (bug 1817997)
Backed out changeset 670c599a3b99 (bug 1817997)
Backed out changeset deea3077f762 (bug 1817997)
Backed out changeset 25ecea0f3d49 (bug 1817997)
Backed out changeset 35ab3ed5e3fc (bug 1817997)
Backed out changeset f516a428ba32 (bug 1817997)
Backed out changeset e589b4d30995 (bug 1817997)
Backed out changeset d096b9cc905d (bug 1817997)
Backed out changeset 2952a6fa06e5 (bug 1817997)
Backed out changeset c1ac4c31ad9a (bug 1817997)
Backed out changeset 04c60cd83c5f (bug 1821362)
Backed out changeset 6dd80575e551 (bug 1821362)
Backed out changeset b86b569ecd46 (bug 1817997)
Backed out changeset 412e0a9ec4e8 (bug 1817997)
Backed out changeset 8e0dcf163138 (bug 1817997)
Backed out changeset 7af506896930 (bug 1817997)
Backed out changeset 29f7cd2b341c (bug 1817997)
Backed out changeset 7f64e65d9497 (bug 1817997)
Backed out changeset 89c241451a32 (bug 1817997)
Backed out changeset 66e4a26e1ebe (bug 1817997)
Backed out changeset ea1aebd4e245 (bug 1817997)
Backed out changeset 2d88a5915db9 (bug 1817997)
Backed out changeset 697ec1928f9c (bug 1817997)
Backed out changeset 41c0bd1133c5 (bug 1817997)
Backed out changeset b20cc750c020 (bug 1817997)
Backed out changeset dc5fd84a3a4c (bug 1703812)
Backed out changeset efa6d130d4eb (bug 1703812)
Backed out changeset 20d9b7cf0ddc (bug 1703812)
Backed out changeset e77c61e8fad2 (bug 1703812)
Backed out changeset 582d5c680e5a (bug 1703812)
Backed out changeset 96c9aacc6811 (bug 1703812)
Backed out changeset 56ec4a57a6a6 (bug 1703812)
Backed out changeset 8f96c8811675 (bug 1703812)
Backed out changeset a79a2f1b2b51 (bug 1703812)
Backed out changeset 07eb8b2c5b9f (bug 1703812)
Backed out changeset bae2b2fb9759 (bug 1703812)
Backed out changeset 38b0416538f3 (bug 1703812)
Backed out changeset b27b54c95cf2 (bug 1703812)
Backed out changeset cab00065d83d (bug 1703812)
Backed out changeset ab44727b2e1a (bug 1703812)
Backed out changeset b7fdcb494670 (bug 1703812)
Backed out changeset 73db43d49c6d (bug 1703812)
Backed out changeset ce754dbfb862 (bug 1703812)
Backed out changeset d694726a3ee6 (bug 1703812)
Backed out changeset 6acede55acbb (bug 1703812)
Backed out changeset 86e7d4784a20 (bug 1703812)
Backed out changeset 6b2e055d9314 (bug 1703812)
Backed out changeset b08695e5728a (bug 1703812)
Backed out changeset 3b8a0081fd10 (bug 1703812)
Backed out changeset 3a163596f982 (bug 1703812)
Backed out changeset 5be1d4b282ab (bug 1703812)
Backed out changeset 1ce012d7509e (bug 1703812)
Backed out changeset ee2fab5881c7 (bug 1703812)
Backed out changeset 62941a522893 (bug 1703812)
Backed out changeset d4f11dc33eed (bug 1703812)
Backed out changeset 781bb4c3cc02 (bug 1703812)
Backed out changeset f070e0de0566 (bug 1703812)
Backed out changeset 9f65c67ba2a6 (bug 1703812)
Backed out changeset 1e76eecb85e2 (bug 1703812)
Backed out changeset 953432408a83 (bug 1703812)
Backed out changeset fd1dc92d3911 (bug 1703812)
Backed out changeset 34d56948c6b6 (bug 1703812)
Backed out changeset 2ba7ca61ecc3 (bug 1703812)
Backed out changeset 545253c469e6 (bug 1703812)
Backed out changeset fb4a61ab1300 (bug 1703812)
Backed out changeset bf07b3cfd3d5 (bug 1703812)
Backed out changeset eaff51e7754b (bug 1703812)
Backed out changeset f5c485c41d13 (bug 1703812)
2023-05-19 14:49:57 +03:00
Mirko Brodesser
df0d61ce21 Bug 1833588: remove popover content attribute when setting it to null via IDL. r=emilio
The assertion count increased, because a formerly violated assertion
(https://searchfox.org/mozilla-central/rev/e77d89c414eac63a295a2124600045775a6f4715/dom/base/Document.cpp#14940)
is now violated more often. No new assertion is violated.

The new sub-test failures all violate the above assertion. Fixing those
violations should be done in a separate ticket, at latest bug 1816851.

Depends on D178182

Differential Revision: https://phabricator.services.mozilla.com/D178305
2023-05-18 07:53:05 +00:00
Mirko Brodesser
5e33485028 Bug 1833333: return the canonical keyword in popover IDL's getter steps. r=emilio
Covered by the sub-test at
<https://searchfox.org/mozilla-central/rev/f60cf6bfa8bd096efd9bb3a445364f5a0f32897a/testing/web-platform/tests/html/semantics/popovers/popover-attribute-basic.html#100,102>.
Verified locally that it passes with the patch and failed without it.
The whole test
(https://searchfox.org/mozilla-central/rev/f60cf6bfa8bd096efd9bb3a445364f5a0f32897a/testing/web-platform/tests/html/semantics/popovers/popover-attribute-basic.html#120)
still fails at a later stage, hence the meta data isn't changed.

Differential Revision: https://phabricator.services.mozilla.com/D178182
2023-05-18 07:53:05 +00:00
Ziran Sun
7fd8c1eea1 Bug 1831057 - Handle conflict interactions between popover, modal dialog and fullscreen. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D177003
2023-05-17 18:49:45 +00:00
Emilio Cobos Álvarez
21981d4a06 Bug 1831328 - Transfer nonce slot when moved across documents. r=sefeng
Differential Revision: https://phabricator.services.mozilla.com/D178297
2023-05-17 16:38:44 +00:00
Otto Länd
73f06050fb Bug 1703812, 1817997, 1821362: apply code formatting via Lando
# ignore-this-changeset
2023-05-17 16:00:46 +00:00
Paul Adenot
38c29f1a6a Bug 1817997 - Write a version of GetSeekableTimeRanges that uses double and not TimeUnit. r=alwu
When playing a MediaSource, `seekable` should return `[0, duration]`, and duration
can be a double of any precision.

Differential Revision: https://phabricator.services.mozilla.com/D176042
2023-05-17 15:47:07 +00:00
Paul Adenot
903f061f6f Bug 1817997 - Limit time resolution to microsecond on values exposed to script. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D176041
2023-05-17 15:47:07 +00:00
Paul Adenot
a5dda50bd8 Bug 1817997 - Replace more double representing seconds by TimeUnit in MediaSource. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D176037
2023-05-17 15:47:06 +00:00
Paul Adenot
0b4a1e2149 Bug 1817997 - Reduce precision when storing time related to the played attribute. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D173528
2023-05-17 15:47:05 +00:00
Paul Adenot
256aab271f Bug 1817997 - Update HTMLMediaElement to use the new TimeUnit. r=alwu
Similarly to other commits, it's necessary to sometimes reduce the precision of
returned time values, to ensure there's no change to returned numbers.

Differential Revision: https://phabricator.services.mozilla.com/D173313
2023-05-17 15:47:05 +00:00
Karl Tomlinson
8fa3446be3 Bug 1832479 reflow video elements with natural size from metadata r=pehrsons
The spec is inconsistent [1] about whether this size from metadata should be
used, but having predictable behavior in Firefox is better than having the
size change unexpectedly because something unrelated triggers a reflow and
this change makes Firefox consistent with Chrome.

[1] https://github.com/whatwg/html/issues/9279

Differential Revision: https://phabricator.services.mozilla.com/D177984
2023-05-17 01:36:59 +00:00
Karl Tomlinson
fb0873a1d5 Bug 1832479 use types for decoder owner Invalidate() boolean parameters r=pehrsons
for safety and readability.

Differential Revision: https://phabricator.services.mozilla.com/D177983
2023-05-16 21:30:29 +00:00
Karl Tomlinson
01a3ef4ecb Bug 1832479 remove declaration of missing UpdateInitialMediaSize() r=pehrsons
Definition was removed in
https://hg.mozilla.org/integration/mozilla-inbound/rev/e13f35cff432#l1.308

Differential Revision: https://phabricator.services.mozilla.com/D177982
2023-05-16 21:30:29 +00:00
Natalia Csoregi
b500f2692b Backed out changeset 2f394b22e31d (bug 1108425) for causing failures on bidi/726420-1.html. CLOSED TREE 2023-05-16 18:47:45 +03:00
Vincent Hilla
66bc5434e9 Bug 1108425 - Fix dir=auto for textarea with rtl text. r=smaug
I copy-pasted all `SetDirectionFromValue`-related parts from HTMLInputElement to HTMLTextAreaElement

Differential Revision: https://phabricator.services.mozilla.com/D176999
2023-05-16 13:49:07 +00:00
Masayuki Nakano
12761898d8 Bug 1822860 - Make elements handle space key only when it's focused r=emilio
When a focused editable element which is in an element having some default
actions for some keyboard events, keyboard events should be handled only by the
editor associated to the focused editable element.  Therefore,
`nsGenericHTMLElement::HandleKeyboardActivation` should check whether the
element has focus.

Note that if elements having default actions for keyboard events is a focused
editing host, Chrome makes the element handle keyboard events instead of
their builtin editor.  For compatibility with them, let's follow the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D177757
2023-05-16 01:29:11 +00:00
Emilio Cobos Álvarez
f37d9339a7 Bug 1833181 - Avoid attr lookups to check whether input value is empty. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D178078
2023-05-15 17:16:41 +00:00
Emilio Cobos Álvarez
407a5169d2 Bug 1833181 - Make SetValueChanged return void. r=smaug
Just a drive-by clean-up.

Differential Revision: https://phabricator.services.mozilla.com/D178077
2023-05-15 16:07:30 +00:00
Mirko Brodesser
19c9fee99f Bug 1828674: part 2) Set a popover's state to auto when the corresponding attribute value is the empty string. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D177764
2023-05-15 12:55:11 +00:00
Norisz Fay
f60cf6bfa8 Backed out 2 changesets (bug 1828674) for causing build bustage on nsGenericHTMLElement.cpp CLOSED TREE
Backed out changeset 40ab13fb03c1 (bug 1828674)
Backed out changeset 1f7322b59dfb (bug 1828674)
2023-05-15 15:22:29 +03:00
Mirko Brodesser
78512c8602 Bug 1828674: part 2) Set a popover's state to auto when the corresponding attribute value is the empty string. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D177764
2023-05-15 09:44:58 +00:00
Butkovits Atila
3f45f060ec Backed out 2 changesets (bug 1828674) as requested by dev. CLOSED TREE
Backed out changeset ccfe4902760f (bug 1828674)
Backed out changeset a526004408c1 (bug 1828674)
2023-05-15 12:18:22 +03:00
Mirko Brodesser
7c884d6bb7 Bug 1828674: part 2) Set a popover's state to auto when the corresponding attribute value is the empty string. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D177764
2023-05-15 08:15:08 +00:00
Masayuki Nakano
e16a783838 Bug 1829570 - part 2: Add an overload of AsyncEventDispatcher::RunDOMEventWhenSafe r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D176488
2023-05-15 01:07:29 +00:00
Em Zhan
cf3f789fba Bug 1425310 - Implement modulepreload for link rel. r=yulia,smaug,jonco
Does perform the optional step of fetching descendants and linking:
https://html.spec.whatwg.org/multipage/webappapis.html#fetching-scripts:fetch-the-descendants-of-and-link-a-module-script-2

Partially implements some new destinations ("as" attribute values) for
modulepreload only (not for preload or link attribute reflection)

Differential Revision: https://phabricator.services.mozilla.com/D172368
2023-05-14 10:49:46 +00:00
Natalia Csoregi
e0961833bd Backed out changeset 3bb8a8b46f3c (bug 1425310) for causing failures on /preload/modulepreload.html. CLOSED TREE 2023-05-13 21:02:02 +03:00
Em Zhan
23e08c0b13 Bug 1425310 - Implement modulepreload for link rel. r=yulia,smaug,jonco
Does perform the optional step of fetching descendants and linking:
https://html.spec.whatwg.org/multipage/webappapis.html#fetching-scripts:fetch-the-descendants-of-and-link-a-module-script-2

Partially implements some new destinations ("as" attribute values) for
modulepreload only (not for preload or link attribute reflection)

Differential Revision: https://phabricator.services.mozilla.com/D172368
2023-05-13 16:09:03 +00:00
Adam Vandolder
020a417143 Bug 1653625 - Make the submission from default action of a submit button also deferred. r=edgar
The submission from requestSubmit() call is non-deferred due to
mDeferSubmission
being cleared in HTMLFormElement::PostHandleEvent when handling a submit
event. The
mDeferSubmission clearing is also to make the submission from the default
action
of a submit button non-deferred.

This patch makes the submission from default action of a submit button
deferred
which could fix this bug, and also simplify the logic a bit.

Since gecko would also trigger submission for untrusted submit event,
see
bug 1370630, we need to handle that case specially.

Differential Revision: https://phabricator.services.mozilla.com/D170941
2023-05-12 23:11:28 +00:00
Stanca Serban
25a6d81670 Backed out changeset fcef8c68028c (bug 1822860) for causing wpt failures in focus-tabindex-event.html. CLOSED TREE 2023-05-12 15:43:19 +03:00
Stanca Serban
23eceacb05 Backed out changeset e1a398764f9e (bug 1831057) for causing wpt failures in popover-top-layer-combinations.html. 2023-05-12 15:39:38 +03:00
Masayuki Nakano
e877763371 Bug 1822860 - Make elements handle space key only when it's focused r=emilio
When a focused editable element which is in an element having some default
actions for some keyboard events, keyboard events should be handled only by the
editor associated to the focused editable element.  Therefore,
`nsGenericHTMLElement::HandleKeyboardActivation` should check whether the
element has focus.

Note that if elements having default actions for keyboard events is a focused
editing host, Chrome makes the element handle keyboard events instead of
their builtin editor.  For compatibility with them, let's follow the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D177757
2023-05-12 08:57:48 +00:00
Ziran Sun
ed290a4a58 Bug 1831057 - Handle conflict interactions between popover, modal dialog and fullscreen. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D177003
2023-05-12 08:00:26 +00:00
Cristian Tuns
e106133337 Backed out changeset 0054de12b39c (bug 1425310) while the issue is being investigated(Bug 1832361) CLOSED TREE 2023-05-10 14:49:41 -04:00
Emilio Cobos Álvarez
1f0f0e29a7 Bug 1831863 - Drive by clean-ups to HTMLSharedElement. r=smaug
While I'm around let's remove redundant virtual keywords.

Depends on D177624

Differential Revision: https://phabricator.services.mozilla.com/D177625
2023-05-10 16:47:18 +00:00
Emilio Cobos Álvarez
0335835247 Bug 1831863 - Stop mapping <dir type> to list-style-type. r=zcorpan,smaug
We also parsed the start attribute, but we actually don't use it.

Mapping of start broke in bug 288704, where it was migrated to map to
counter-reset, instead of being looked up by layout directly.

Differential Revision: https://phabricator.services.mozilla.com/D177624
2023-05-10 16:47:18 +00:00
Em Zhan
1fb37f2836 Bug 1425310 - Implement modulepreload for link rel. r=yulia,smaug,jonco
Does perform the optional step of fetching descendants and linking:
https://html.spec.whatwg.org/multipage/webappapis.html#fetching-scripts:fetch-the-descendants-of-and-link-a-module-script-2

Partially implements some new destinations ("as" attribute values) for
modulepreload only (not for preload or link attribute reflection)

Differential Revision: https://phabricator.services.mozilla.com/D172368
2023-05-09 12:35:52 +00:00
Noemi Erli
cd34e6e230 Backed out changeset 1ef27d4a851e (bug 1425310) for causing build bustages in nsHtml5TreeBuilderCppSupplement.h 2023-05-08 18:08:45 +03:00
Mirko Brodesser
4328b1ce93 Bug 1829660: pass true for aFireEvents and defer hiding the popover and updating the popover states. r=emilio
Pass `true` for `aFireEvents` to match the spec.
Defer hiding the popover because it may run script, which is forbidden,
because `SetAttrAndNotify` runs with a script blocker
(`mozAutoDocUpdate`).

Updated test expectations:
  The assertion count increased because
  <https://searchfox.org/mozilla-central/rev/4e6970cd336f1b642c0be6c9b697b4db5f7b6aeb/dom/base/Document.cpp#14948-14949>
  is violated more often, which was violated before. No new
  `NS_ASSERTION`s are violated.

  "[Changing a popover from auto to manual (via attr), and then auto during 'beforetoggle' works]
     expected: FAIL" still fails because
     <https://searchfox.org/mozilla-central/rev/4e6970cd336f1b642c0be6c9b697b4db5f7b6aeb/testing/web-platform/tests/html/semantics/popovers/popover-attribute-basic.html#334>
     is violated, which is unrelated to this change.
  Other instances of
  <https://searchfox.org/mozilla-central/rev/4e6970cd336f1b642c0be6c9b697b4db5f7b6aeb/testing/web-platform/tests/html/semantics/popovers/popover-attribute-basic.html#339>
  still fail too, but the general mechanism of firing events seems to
  work. Therefore it seems reasonable to investigate the remaining
  failures in bug 1816851.

Differential Revision: https://phabricator.services.mozilla.com/D176660
2023-05-08 14:08:37 +00:00
Tim Huang
07cbc511d5 Bug 1816189 - Part 4: Add random noise when extracting data from canvas element when canvas randomization is enabled. r=tjr,lsalzman
This patch introduces random noises to data extraction functions of
canvas element and offscreen canvas. The random noise is based on the
random key of the cookieJarSettings and the image data itself.

The random noises would interfere the ability of fingerprinters that
use canvas data to fingerprint users. The random noise will make unique
canvas finerprint to for every browsing session. Therefore, fingerprinter
cannot use canvas fingerprint to tracker individuals across browsing
sessions.

Differential Revision: https://phabricator.services.mozilla.com/D175499
2023-05-08 14:04:35 +00:00
Em Zhan
aa8c113862 Bug 1425310 - Implement modulepreload for link rel. r=yulia,smaug,jonco
Does perform the optional step of fetching descendants and linking:
https://html.spec.whatwg.org/multipage/webappapis.html#fetching-scripts:fetch-the-descendants-of-and-link-a-module-script-2

Partially implements some new destinations ("as" attribute values) for
modulepreload only (not for preload or link attribute reflection)

Differential Revision: https://phabricator.services.mozilla.com/D172368
2023-05-08 13:12:30 +00:00
Cathie Chen
70b0f99e92 Bug 1825808 - Popover: Complete ShowPopover and HidePopover, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175395
2023-05-02 11:29:20 +00:00
Ziran Sun
c4aad864d0 Bug 1829318 - Throw exception when calling dialog.show() on an open popover. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D176141
2023-04-28 14:17:51 +00:00
Edgar Chen
14d3fe16aa Bug 1827019 - Add diagnostic assertion to ensure mForm is reset after unlink; r=smaug
Depends on D176356

Differential Revision: https://phabricator.services.mozilla.com/D176357
2023-04-27 21:48:43 +00:00
Edgar Chen
5876ffefe4 Bug 1827019 - Reset mFieldset after unlink; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D176356
2023-04-27 21:48:43 +00:00
Butkovits Atila
843159f76c Backed out changeset 4fd18988ada9 (bug 1825808) for causing failures at popover-open-overflow-display.html. CLOSED TREE 2023-04-27 23:36:17 +03:00
Cathie Chen
fbebb6e2ac Bug 1825808 - Popover: Complete ShowPopover and HidePopover, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175395
2023-04-27 17:49:06 +00:00
Mirko Brodesser
872610e807 Bug 1830031: split nsGenericHTMLElement::HandleFocusAfterHidingPopover. r=emilio
To achieve `MOZ_CAN_RUN_SCRIPT`-correctness.

Bonus: avoids a call of `do_QueryReferent`.

Differential Revision: https://phabricator.services.mozilla.com/D176521
2023-04-26 12:12:26 +00:00
Cathie Chen
1445380f8f Bug 1828969 - Popover: Check the popover's document in showPopover, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175935
2023-04-26 10:25:21 +00:00
Cristina Horotan
82a7ee4839 Backed out changeset b288a387f790 (bug 1425310) for causing Reflection related failures. CLOSED TREE 2023-04-21 18:37:11 +03:00
Em Zhan
3005df8d1d Bug 1425310 - Implement modulepreload for link rel. r=yulia,smaug,jonco
Does perform the optional step of fetching descendants and linking:
https://html.spec.whatwg.org/multipage/webappapis.html#fetching-scripts:fetch-the-descendants-of-and-link-a-module-script-2

Differential Revision: https://phabricator.services.mozilla.com/D172368
2023-04-21 14:32:30 +00:00
Emilio Cobos Álvarez
620e7eee18 Bug 1829225 - Trivially fix a typo in the previous patch.
MANUAL PUSH: Trivial orange fix CLOSED TREE
2023-04-21 12:56:47 +02:00
Emilio Cobos Álvarez
25b79c7b15 Bug 1829225 - Make BeforeSetAttr take the parsed nsAttrValue. r=smaug
ParseAttribute ideally would be const (see bug 1829138), but the SVG and
SMIL code is rather messy. Still, now that BeforeSetAttr can't really
fail, swapping the order of ParseAttribute and BeforeSetAttr shouldn't
really change behavior.

Sorry for the extra `virtual` keyword removal and such. I had to do this
one by hand unlike the dependent bugs, and I went a bit drive-by, lmk if
you want me to split those changes.

Differential Revision: https://phabricator.services.mozilla.com/D176086
2023-04-21 09:25:17 +00:00
Emilio Cobos Álvarez
51758cfc9b Bug 1829189 - Make OnAttrSetButNotChanged and AfterSetAttr infallible. r=smaug
Same rg + sed shenanigans as the first patch.

There were two that could fail, both due to OOM:

 * HTMLInputElement::AfterSetAttr: If we fail (only in the type=range
   case) we end up with an old value without it being clamped by
   min/max/step.

 * HTMLBodyElement::AfterSetAttr: If we fail we won't peek up the
   DocShell's frame margins and styling could be incorrect.

That seems better than having to deal with broken states after we've
already set the attribute.

Depends on D176069

Differential Revision: https://phabricator.services.mozilla.com/D176070
2023-04-21 08:56:27 +00:00
Emilio Cobos Álvarez
ee4c38a50c Bug 1829189 - Make BeforeSetAttr infallible. r=smaug
rg BeforeSetAttr -l | xargs sed -i 's/nsresult BeforeSetAttr/void BeforeSetAttr/g'
  rg ::BeforeSetAttr -l | xargs sed -i 's/nsresult \(.*\)::BeforeSetAttr/void \1::BeforeSetAttr/g'

Plus trivial fixes, plus clang-format.

The only meaningful changes are in nsXULElement::BeforeSetAttr. Two
things could fail:

chromemargin: I removed it because we don't use the parsed attribute any
other place than here:

  https://searchfox.org/mozilla-central/rev/31f5847a4494b3646edabbdd7ea39cb88509afe2/dom/xul/ChromeObserver.cpp#136

And that deals just fine with it not being parsed.

usercontextid: We have a debug assertion that we don't dynamically change it.
I kept it but I don't think it's worth failing to set the attribute on release for that

Differential Revision: https://phabricator.services.mozilla.com/D176069
2023-04-21 08:56:27 +00:00
Butkovits Atila
abffec9580 Backed out 2 changesets (bug 1741469) for causing failures at test_bug1261674-1.html. CLOSED TREE
Backed out changeset b007c139e65c (bug 1741469)
Backed out changeset a75f2a426fa3 (bug 1741469)
2023-04-20 19:38:30 +03:00
Daniel Holbert
c97c4ebace Bug 1741469 part 2: Add an off-by-default pref to control whether input type="number" fields are modified when mousewheel-scrolled. r=smaug
The C++ code change here is simply replacing an ifdef with a pref-check (and
associated reindentation for being placed in an "if"-block).

The pref is off-by-default for now, since no other browser seems to modify
these fields through mousewheel scrolling, and users seem to be surprised when
they encounter the behavior in Firefox.  See discussion on the bugzilla page.

Note: now that this behavior is controlled by a pref, we don't need to have
platform-specific #ifdefs and "skip-if" test exemptions. If we decide to bring
this behavior back on certain platforms, we can do so by simply changing the
default value of the pref on those platforms.

Differential Revision: https://phabricator.services.mozilla.com/D175719
2023-04-20 14:23:52 +00:00
Daniel Holbert
8a8b01a6e0 Bug 1741469 part 1: Make some cleanups and readability edits to test_bug1261673.html. r=smaug
The next patch in this series will extend this test a bit.  To make that change
easier to understand (and make the test in general easier to follow), I'm doing
a bit of initial tweaks/cleanup.

Notable changes:
* Switched to "is(a,b)" instead of "ok(a == b, 'expect a get b)".
* Renamed (and added brief documentation for) variables 'result',
  'numberChange', and 'expectChange' to make their meanings/usage clearer.
* Expanded out some one-liner ternary-logic expressions, both for readability
  and because I'm going to be extending them with more cases in the next patch.
* Removed unnecessary parseInt() (p.valueChanged is already an integer; no
  parsing needed) but added another (wrapping input.value, so that is() doesn't
  spuriously fail due to integer vs. string comparison).

Differential Revision: https://phabricator.services.mozilla.com/D175971
2023-04-20 14:23:52 +00:00
Alexander Surkov
042441bd22 Bug 1824374 - implement popover activation behavior, r=emilio
See https://html.spec.whatwg.org/#the-input-element:popover-target-attribute-activation-behavior

Differential Revision: https://phabricator.services.mozilla.com/D175485
2023-04-18 19:50:52 +00:00
Ziran Sun
5dfafa520f Bug 1824350 - Implement queue a popover toggle event task for Popover. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D173820
2023-04-18 13:51:23 +00:00
Butkovits Atila
fdef98b00c Backed out changeset 241b4b54e654 (bug 1824374) for causing failures at popover-invoking-attribute.html. 2023-04-17 23:44:22 +03:00
Alexander Surkov
f4b740a32f Bug 1824374 - implement popover activation behavior, r=emilio
See https://html.spec.whatwg.org/#the-input-element:popover-target-attribute-activation-behavior

Differential Revision: https://phabricator.services.mozilla.com/D175485
2023-04-17 18:10:13 +00:00