Commit Graph

1025 Commits

Author SHA1 Message Date
Tom Schuster
6649b9354c Bug 1838415 - Use RFPTarget::PointerEvents for Set/ReleasePointerCapture. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D180954
2023-06-21 07:01:23 +00:00
Emilio Cobos Álvarez
bf865088ae Bug 1839485 - Minor string improvements in custom element reactions. r=edgar
We're atomizing to turn into a string again which is wasteful.

Differential Revision: https://phabricator.services.mozilla.com/D181552
2023-06-20 19:11:18 +00:00
Emilio Cobos Álvarez
041813713e 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
Kershaw Chang
86ab7691ee Bug 1543990 - Simplify nsISpeculativeConnect API, r=necko-reviewers,geckoview-reviewers,search-reviewers,valentin,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D179066
2023-06-01 09:46:12 +00:00
Tom Schuster
f33200529a 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
0b8aa324eb 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
Jan-Niklas Jaeschke
d34befcb48 Bug 1828469, part 2: Moved some logic from nsRange to AbstractRange to support StaticRanges in custom highlights. r=masayuki
With this change, Selections are also registered into StaticRanges,
ultimately making them visible to `nsINode::IsSelected()`,
which is necessary to paint them.

Differential Revision: https://phabricator.services.mozilla.com/D175784
2023-05-31 08:23:45 +00:00
Cosmin Sabou
aa1153360b Backed out changeset 934b572f87f7 (bug 1833570) for causing build bustages on PopoverData.h. 2023-05-29 19:27:18 +03:00
Ziran Sun
964c1fd534 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
19f22176f6 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
1202bb6338 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
Mirko Brodesser
896dabd637 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
Noemi Erli
9a6edab85a Backed out 3 changesets (bug 1828469) for causing assertion in RangeBoundary.h
Backed out changeset ab92a12ba6ea (bug 1828469)
Backed out changeset 217801294c41 (bug 1828469)
Backed out changeset c78c717e4ec9 (bug 1828469)
2023-05-23 12:10:12 +03:00
Jan-Niklas Jaeschke
654b508a08 Bug 1828469, part 2: Moved some logic from nsRange to AbstractRange to support StaticRanges in custom highlights. r=masayuki
With this change, Selections are also registered into StaticRanges,
ultimately making them visible to `nsINode::IsSelected()`,
which is necessary to paint them.

Differential Revision: https://phabricator.services.mozilla.com/D175784
2023-05-23 06:53:32 +00:00
Masayuki Nakano
d8b4f4d3a2 Bug 1829570 - part 1: Create a static method version of AsyncEventDispatcher::RunDOMEventWhenSafe r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D176486
2023-05-15 01:07:29 +00:00
Emilio Cobos Álvarez
79e2754796 Bug 1831539 - Remove HasBoxFFI. r=boris
HasBoxFFI and HasArcFFI aren't great, see bug 1831242 as for examples of
why.

HasArcFFI requires a bit more care, but HasBoxFFI doesn't give us much
benefit. Instead use the same type in the FFI boundary.

Differential Revision: https://phabricator.services.mozilla.com/D177252
2023-05-09 11:07:26 +00:00
Boris Chiou
b0d23e1251 Bug 1677844 - Let getAnimations() return scroll animations with null timeline. r=webidl,smaug,emilio
This is a tentative way to avoid any timeout in WPT because other
brower vendors may expect getAnimations() works for scroll animations.

The original implementation is error-prone because the user can use the
declarative way to create a CSS animation associated with the document-timeline,
and then changes animation-timeline property to any other scroll-timeline.
If the user calls getAnimations() before changing its style, we still expose
the Animation objects in JS and may crash or have other unexpected bahaviors
if the user tries to access Animation.timeline.

Besides, another benefit of this patch is that we can use other Web Animation
APIs for scroll animations in WPT, e.g. Animation.ready.

Differential Revision: https://phabricator.services.mozilla.com/D176966
2023-05-03 22:49:21 +00:00
Emilio Cobos Álvarez
c1c1e7460b 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
ded1458b5b 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
c881eb2941 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
Emilio Cobos Álvarez
c5c8aee75c Bug 1827856 - Remove nativeAnonymousChildList observers. r=smaug,credential-management-reviewers,devtools-reviewers,sgalich,nchevobbe
You let me know if this seems appealing to you :)

Differential Revision: https://phabricator.services.mozilla.com/D175382
2023-04-18 14:58:34 +00:00
Cathie Chen
6d716489ba Bug 1827244 - Popover: implement topmost popover ancestor, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175059
2023-04-18 13:48:38 +00:00
Alexander Surkov
3ce742bba0 Bug 1826793 - implement popover invoker, r=emilio
See https://html.spec.whatwg.org/multipage/popover.html#popover-invoker

Differential Revision: https://phabricator.services.mozilla.com/D175265
2023-04-17 14:17:06 +00:00
Alexander Surkov
50bc93b884 Bug 1823757 - use parsed atoms for popovertarget attribute, r=emilio
Use parsed atoms to store popovertarget attributes as more effective mechanism to search for ID match in attr associated elements implementation. Followup from D173337.

Differential Revision: https://phabricator.services.mozilla.com/D174786
2023-04-11 18:35:51 +00:00
Natalia Csoregi
64f264b62e Backed out changeset 96da9dcee2b0 (bug 1823757) for causing failures on popover-invoking-attribute.html. CLOSED TREE 2023-04-11 09:43:08 +03:00
Alexander Surkov
be39f08c40 Bug 1823757 - use parsed atoms for popovertarget attribute, r=emilio
Use parsed atoms to store popovertarget attributes as more effective mechanism to search for ID match in attr associated elements implementation. Followup from D173337.

Differential Revision: https://phabricator.services.mozilla.com/D174786
2023-04-11 00:53:28 +00:00
Cosmin Sabou
67393d958e Backed out changeset 93a5b0a259ae (bug 1823757) for causing Atom related wpt failures. 2023-04-07 00:39:17 +03:00
Alexander Surkov
a9708c7096 Bug 1823757 - use parsed atoms for popovertarget attribute, r=emilio
Use parsed atoms to store popovertarget attributes as more effective mechanism to search for ID match in attr associated elements implementation. Followup from D173337.

Differential Revision: https://phabricator.services.mozilla.com/D174786
2023-04-06 18:48:03 +00:00
Emilio Cobos Álvarez
c195031050 Bug 1825825 - Simplify NAC setup. r=smaug
Make all UA widgets also NAC.

Keep the UA widget flag but break at anonymous subtree boundaries, so
that only nodes inside the UA widget directly (and not NAC from those)
get the flag.

This is important because two callers depend on this difference:

 * The style system, since we still want to match content rules from
   stylesheets in the UA widget. We also match user rules, which is a
   bit sketchy, but that was the previous behavior, will file a
   follow-up for that.

 * The reflector code, since we want the scope for UA widgets to not
   include the NAC nodes inside that UA widget. nsINode::IsInUAWidget
   got it wrong.

After this patch, ChromeOnlyAccess is equivalent to
IsInNativeAnonymousSubtree, so we should probably unify the naming.
That's left for a follow-up patch because I don't have a strong
preference.

Differential Revision: https://phabricator.services.mozilla.com/D174310
2023-04-05 09:19:15 +00:00
Alexander Surkov
409e66eacc Bug 1823757 implement PopoverInvokerElement::popoverTargetElement, r=emilio
See https://html.spec.whatwg.org/multipage/popover.html#dom-popovertargetelement

Differential Revision: https://phabricator.services.mozilla.com/D174259
2023-04-03 13:21:36 +00:00
Alexander Surkov
27099d19d9 Bug 1823757 - implement attr associated element, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D173337
2023-03-30 16:15:52 +00:00
Emilio Cobos Álvarez
f69a397491 Bug 1449669 - Remove IsNodeOfType. r=longsonr
Depends on D172893

Differential Revision: https://phabricator.services.mozilla.com/D172894
2023-03-17 19:22:14 +00:00
Alexander Surkov
d00e971fa8 Bug 1821732 - implement "hide all popovers unitl" algorithm, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D172701
2023-03-16 16:52:30 +00:00
Alexander Surkov
802a7fe55e Bug 1821732 - implement auto popover list, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D172296
2023-03-13 20:18:46 +00:00
Ziran Sun
caa78efc0f Bug 1820544 - Add popover attribute and part of basic popover functionality. r=emilio
Starts to add part of the basic functionality for popover. Including
[1] :open & :closed CSS pseudo class
[2] showPopover(), hidePopover() and togglePopover() interfaces. Much of the
functionality is still to-do.
[3] PopoverData interface

Differential Revision: https://phabricator.services.mozilla.com/D171719
2023-03-10 10:52:20 +00:00
Brad Werth
68434f47f6 Bug 1815140 Part 1: Make Grid dom object an idempotent property of its frame. r=emilio
This ensures that repeated calls to Element::GetGridFragments will return
an array of idempotent Grid objects for each fragment. This is
accomplished by making the Grid object hold a WeakFrame back to its
originating frame, and updating a property on construction and
destruction.

Differential Revision: https://phabricator.services.mozilla.com/D169724
2023-02-23 01:07:34 +00:00
Emilio Cobos Álvarez
fe8e5d2f7f Bug 1816915 - Tweak how we handle animation restyles on bind/unbind. r=hiro
Remove code on bind/unbind that requested a restyle on an unstyled
element, and that canceled that on an unbound element.

Instead, deal with detached nodes in EffectCompositor.

Tweak test restyles since we now expect one restyle as a result of the
initial composing of the animation that before happened eagerly.

Drive-by remove an unused test function in wpt (animationStartsRightNow
is not defined there anyways).

In practice, this makes it consistent with how we handle bind on
elements in shadow trees.

Differential Revision: https://phabricator.services.mozilla.com/D169932
2023-02-21 08:51:00 +00:00
Cosmin Sabou
16ef9eba19 Backed out 3 changesets (bug 1815140) for causing wrapper related dt failures. CLOSED TREE
Backed out changeset 0380de95a301 (bug 1815140)
Backed out changeset dd7288d15da0 (bug 1815140)
Backed out changeset 7f50487ea10c (bug 1815140)
2023-02-21 07:15:20 +02:00
Brad Werth
792fde2cfe Bug 1815140 Part 1: Make Grid dom object an idempotent property of its frame. r=emilio
This ensures that repeated calls to Element::GetGridFragments will return
an array of idempotent Grid objects for each fragment. This is
accomplished by making the Grid object hold a WeakFrame back to its
originating frame, and updating a property on construction and
destruction.

Differential Revision: https://phabricator.services.mozilla.com/D169724
2023-02-21 04:06:37 +00:00
Emilio Cobos Álvarez
46f75451b0 Bug 1816915 - Clean up EffectSet APIs. r=firefox-animation-reviewers,boris
EffectSet::GetEffectSet seems rather redundant, use just EffectSet::Get
and tweak naming of similar APIs.

Differential Revision: https://phabricator.services.mozilla.com/D169931
2023-02-15 20:39:16 +00:00
Emilio Cobos Álvarez
765e4c3182 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
d3207e00dc 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
30f4d8a5a5 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
57da6ea373 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
3b28be9c3c 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
bd77026b85 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
28609c25f4 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
40c9f37d22 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
b0100048e4 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
59e7b13fee 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