Commit graph

1019 commits

Author SHA1 Message Date
Fatih
727dac89a3 Bug 1871789 - Spoof mozInputSource and mozPressure for RFP. r=tjr,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D209543
2024-05-16 19:43:12 +00:00
Adam Vandolder
b40c30b136 Bug 1890428 - Add serialization support for Declarative Shadow DOM. r=webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D206955
2024-05-15 16:40:21 +00:00
Tamas Szentpeteri
065fdfb46e Backed out 2 changesets (bug 1890428) for causing wpt failures on idlharness.https.html. CLOSED TREE
Backed out changeset 1954ce9669b8 (bug 1890428)
Backed out changeset 3e45e3d15eed (bug 1890428)
2024-05-15 11:19:46 +03:00
Adam Vandolder
bc77f97e3d Bug 1890428 - Add serialization support for Declarative Shadow DOM. r=webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D206955
2024-05-15 03:01:19 +00:00
Cristian Tuns
d52242a24f Backed out 2 changesets (bug 1890428) for causing failures in idlharness.window.html?exclude=Node CLOSED TREE
Backed out changeset f9cf0740eef2 (bug 1890428)
Backed out changeset 37e2a10a9022 (bug 1890428)
2024-05-14 19:42:37 -04:00
Adam Vandolder
133a24fad6 Bug 1890428 - Add serialization support for Declarative Shadow DOM. r=webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D206955
2024-05-14 16:43:28 +00:00
Ting-Yu Lin
b6efd1588f Bug 1488080 Part 1 - Convert GetAllInFlowRects flags to EnumSet. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D209096
2024-05-03 18:42:41 +00:00
Sean Feng
92ef542dba Bug 1881097 - Ensure nsContentUtils::IsPointInSelection works for point in selection that crosses the boundary r=smaug
Ths patch introduces a new class called `CrossShadowBoundaryRange` to
make cross shadow boundary range related stuff can be isolated into a
single class.

It also tweaks a few functions along the call stack, the goal here
is to make sure nsContentUtils::IsPointInSelection can detect points
in ShadowDOM selection.

There's an additional change to `SelectionUtils.sys.mjs` to make sure
the correct context menu items are displayed when the current selection
crosses the boundary.

Differential Revision: https://phabricator.services.mozilla.com/D204080
2024-04-15 13:09:08 +00:00
Vincent Hilla
048e0da5cf Bug 1873738 - Make non-html elements have a directionality. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D204384
2024-03-26 12:54:25 +00:00
Sean Feng
b411788f91 Bug 1867058 - Part 7: Reset the CrossBoundaryRange when nodes becomes shadow host r=jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D195307
2024-03-25 13:40:58 +00:00
pstanciu
715a8e1d09 Backed out 12 changesets (bug 1867058) for causing bustages on AbstractRange.cpp
Backed out changeset 6254c9c51033 (bug 1867058)
Backed out changeset 2ad556d56736 (bug 1867058)
Backed out changeset a8bc41291ab3 (bug 1867058)
Backed out changeset c30869c03a70 (bug 1867058)
Backed out changeset 39c5816dff6b (bug 1867058)
Backed out changeset 42e226158dc9 (bug 1867058)
Backed out changeset 67bb7158a09f (bug 1867058)
Backed out changeset 7b5a689dc7fd (bug 1867058)
Backed out changeset 3cf108eb13a6 (bug 1867058)
Backed out changeset 8efda4cce80c (bug 1867058)
Backed out changeset 0837e15babab (bug 1867058)
Backed out changeset 8ce7972ea4df (bug 1867058)
2024-03-23 02:24:26 +02:00
Sean Feng
3faa7299d3 Bug 1867058 - Part 7: Reset the CrossBoundaryRange when nodes becomes shadow host r=jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D195307
2024-03-22 17:05:50 +00:00
Emilio Cobos Álvarez
94c83007c1 Bug 1880189 - Implement Element.currentCSSZoom. r=webidl,layout-reviewers,dshin,smaug
As per https://drafts.csswg.org/cssom-view/#dom-element-currentcsszoom

Differential Revision: https://phabricator.services.mozilla.com/D205214
2024-03-20 21:55:52 +00:00
Adam Vandolder
ea21e923de Bug 1876885 - Implement modified behaviour for doubly-attached declarative shadow roots. r=dom-core,peterv
Differential Revision: https://phabricator.services.mozilla.com/D200026
2024-03-18 15:36:56 +00:00
Emilio Cobos Álvarez
0e321f79be Bug 232598 - Return null for unset attributes in XUL. r=smaug,devtools-reviewers,omc-reviewers,zombie,nchevobbe,settings-reviewers,application-update-reviewers,credential-management-reviewers,mossop,aminomancer,bytesized,issammani,sessionstore-reviewers,dao
I just got bit by this in bug 1873833, let's just fix it. There isn't
all that much stuff depending on it anymore.

Differential Revision: https://phabricator.services.mozilla.com/D204496
2024-03-18 09:15:07 +00:00
Emilio Cobos Álvarez
788781e832 Bug 1885521 - Use GetWidgetScreen to get Element.screen. r=stransky
So that we get the right screen on Wayland, where ScreenForRect is not
really reliable.

This makes mismatched screen sizes and resolutions work better. In
particular, this matches what window.screen returns.

Differential Revision: https://phabricator.services.mozilla.com/D204753
2024-03-16 15:52:06 +00:00
Eitan Isaacson
41c0dbb5ad Bug 1883996 - P2: Add ariaActiveDescendantElement to ARIAMixin and implement. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D203850
2024-03-12 20:32:16 +00:00
Peter Van der Beken
62bdf442eb Bug 1640839 - Stop generating a sentinel value at the end of WebIDL enums. r=mccr8,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201344
2024-03-02 07:50:25 +00:00
Natalia Csoregi
8c2521e9d5 Backed out 13 changesets (bug 1640839) for causing bustage on Element.cpp CLOSED TREE
Backed out changeset 179ceb82c9e5 (bug 1640839)
Backed out changeset 73f498a821f0 (bug 1640839)
Backed out changeset dc2d3d0e0365 (bug 1640839)
Backed out changeset ddc989ac0509 (bug 1640839)
Backed out changeset e595bb3feea8 (bug 1640839)
Backed out changeset c85aca04e27f (bug 1640839)
Backed out changeset 98e8e3a4047a (bug 1640839)
Backed out changeset 59ef180517db (bug 1640839)
Backed out changeset af2f5e293662 (bug 1640839)
Backed out changeset 89aa6d9dc598 (bug 1640839)
Backed out changeset 67b722a722f9 (bug 1640839)
Backed out changeset 24a9665c6ced (bug 1640839)
Backed out changeset d93f199385e9 (bug 1640839)
2024-03-01 18:23:08 +02:00
Peter Van der Beken
763356e4fb Bug 1640839 - Stop generating a sentinel value at the end of WebIDL enums. r=mccr8,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201344
2024-03-01 14:31:15 +00:00
Frédéric Wang
c592b5761b Bug 1880928 - Remove last remembered size observer, handle it in Document::DetermineProximityToViewportAndNotifyResizeObservers. r=emilio,layout-reviewers
The CSS Box Sizing specification indicates that last remembered sizes
are recorded "at the time that ResizeObserver events are determined and
delivered" [1].

In bug 1807253, we changed the implementation of when proximity to the
viewport of `content-visibility: auto` nodes are determined and of when
resize observations are broadcast, in order to align with the latest
version of the HTML specification [2]. We continue to use an internal
`Document::mLastRememberedSizeObserver` to update last remembered sizes
but it has been causing issues (e.g. bug 1867090 and bug 1880928) and
could be replaced by a direct update before broadcasting resize
observations.

This is what the current patch is doing. The elements currently observed
by `Document::mLastRememberedSizeObserver` are now stored on a
`Document::mElementsWithLastRememberedSize` hashset and a new function
`Document::UpdateLastRememberedSizes` is called before broadcasting
resize observations, and peforms the work of `LastRememberedSizeCallback`
and of `CalculateBoxSize` (with `aBox=Content_box`).

The only behavior change is in the `while(true)` loop from
`DetermineProximityToViewportAndNotifyResizeObservers`: at each step
we update the last remember sizes for elements of arbitrary depth, and
don't use these depths for calculating `shallowestTargetDepth`. This is
fine, since our `LastRememberedSizeCallback` only records current box
sizes without causing significant side effects (e.g. execution of
JavaScript code) that may require a relayout.

[1] https://drafts.csswg.org/css-sizing-4/#last-remembered
[2] https://html.spec.whatwg.org/#update-the-rendering

Differential Revision: https://phabricator.services.mozilla.com/D202571
2024-02-29 08:50:55 +00:00
Cathie Chen
791a41bfd4 Bug 1879340 - Add potentially render blocking, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D201095
2024-02-24 18:12:35 +00:00
Emilio Cobos Álvarez
a29d2e78b4 Bug 1874040 - Simplify dir=auto implementation. r=smaug
Make sure to do no work on insertions if the dir=auto element has
already the right strong directionality, but record that the node might
be the one impacting the dir=auto resolution.

Also get some node flags back.

Differential Revision: https://phabricator.services.mozilla.com/D202071
2024-02-21 12:23:48 +00:00
James Teh
631247706d Bug 1879255 part 3: Notify accessibility about changes to explicitly set attr-elements. r=smaug,eeejay
Accessibility needs to keep track of changes to explicitly set attr-elements.
Since the popovertarget content attribute is "" for any explicitly set attr-element, we won't always get attribute change notifications for the content attribute when .popoverTargetElement is set.
For example, if e1's popovertarget content attribute is absent and you set e1.popoverTargetElement to e2, the popovertarget content attribute will be "".
If you later set e1.popoverTargetElement to e3, there won't be a notification for the content attribute change, since it remains "".
Even if there were, it might occur before the element has changed, which means we can't detect any relevant state changes there; e.g. mPrevStateBits.
To deal with this, we now have DOM notify accessibility before and after the explicitly set attr-element is changed.
Within DocAccessible, this is treated like any other attribute change, but the notification methods get called consistently and at the appropriate time.

Differential Revision: https://phabricator.services.mozilla.com/D201662
2024-02-21 00:05:21 +00:00
James Teh
33de5c2029 Bug 1879255 part 1: Add Element::GetExplicitlySetAttrElement. r=smaug
This will be needed by accessibility for two reasons:

1. Accessibility will need to keep track of explicitly set attr-elements even if they aren't a descendant of any of the refering element's shadow-including ancestors. Accessibility will enforce that restriction itself before using the attr-element.
2. Accessibility will need to be able to distinguish between an attr-associated element obtained from an explicitly set attr-element vs derived using an id string in the content attribute. There are other ways to do this, but they are somewhat ugly.

Differential Revision: https://phabricator.services.mozilla.com/D201660
2024-02-21 00:05:20 +00:00
Emilio Cobos Álvarez
88699ef142 Bug 1881075 - Fix popovertarget attribute update steps. r=zsun
See https://github.com/whatwg/html/issues/10150. Per spec these run even
if the attribute doesn't change.

Differential Revision: https://phabricator.services.mozilla.com/D202240
2024-02-20 18:52:37 +00:00
Emilio Cobos Álvarez
8925ee2d3d Bug 1881011 - Refactor UnbindFromTree to take a context argument. r=smaug
Much like BindToTree.

This will be useful because I need to pass more information through
UnbindFromTree() to speed up dir=auto for bug 1874040.

Differential Revision: https://phabricator.services.mozilla.com/D202215
2024-02-20 15:05:40 +00:00
Ziran Sun
f56ca13340 Bug 1879001 - Remove the popovertarget attribute or set it to an invalid value should clear the explicitly set attr-element. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D201711
2024-02-16 21:51:24 +00:00
Emilio Cobos Álvarez
0d81741c6d Bug 1874488 - Make Element.{client,scroll} APIs zoom aware. r=saschanaz,TYLin
Also extend scroll-zoom to cover scroll{Top,Left,To,By}, since that was
completely untested.

Differential Revision: https://phabricator.services.mozilla.com/D200029
2024-02-08 11:13:01 +00:00
Emilio Cobos Álvarez
a3821275c4 Bug 1874488 - Refactor some scroll APIs to use shared code. r=TYLin,webidl,smaug
This makes the next patch simpler too. No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D200916
2024-02-08 11:13:00 +00:00
Emilio Cobos Álvarez
31e6d0e8a3 Bug 1874488 - Guarantee that Element::GetScrollFrame returns a frame if it returns a scrollframe. r=TYLin
This the "body propagated to root" case to also set aFrame.

This doesn't change behavior for current callers, but would be useful to
simplify the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D200915
2024-02-08 11:13:00 +00:00
Iulian Moraru
fd7cec7036 Backed out 3 changesets (bug 1874488) for causing multiple failures. CLOSED TREE
Backed out changeset 467c5213a79a (bug 1874488)
Backed out changeset 13da2be03857 (bug 1874488)
Backed out changeset 974683909782 (bug 1874488)
2024-02-08 01:29:54 +02:00
Emilio Cobos Álvarez
3f6f4db1d8 Bug 1874488 - Make Element.{client,scroll} APIs zoom aware. r=saschanaz,TYLin
Also extend scroll-zoom to cover scroll{Top,Left,To,By}, since that was
completely untested.

Differential Revision: https://phabricator.services.mozilla.com/D200029
2024-02-07 21:30:36 +00:00
Emilio Cobos Álvarez
1b7227c33c Bug 1874488 - Refactor some scroll APIs to use shared code. r=TYLin,webidl,smaug
This makes the next patch simpler too. No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D200916
2024-02-07 21:30:35 +00:00
Emilio Cobos Álvarez
3521c18a57 Bug 1874488 - Guarantee that Element::GetScrollFrame returns a frame if it returns a scrollframe. r=TYLin
This the "body propagated to root" case to also set aFrame.

This doesn't change behavior for current callers, but would be useful to
simplify the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D200915
2024-02-07 21:30:35 +00:00
Cathie Chen
d7bb85c04b Bug 1878888 - Add the runtime flag and parsing for the blocking attribute, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D200810
2024-02-07 17:06:56 +00:00
Emilio Cobos Álvarez
450b8e97d3 Bug 1878900 - Simplify AnchorAreaFormRelValues. r=dom-core,edgar
Having a base class with a single static member doesn't buy us much, and
actually MSVC-compatible compilers don't optimize empty base classes out
(plus the empty base is at the end so it might even take space on Linux
and macOS, untested).

Just put the values in Element.h / Element.cpp which is the common base
class of the relevant elements.

Differential Revision: https://phabricator.services.mozilla.com/D200825
2024-02-06 16:47:38 +00:00
keithamus
5b10455622 Bug 1878708 - Dialogs HideAllPopoversUntil nearest popover, not document. r=smaug
Given some markup like:

```html
<div id=popover popover>
  <button id="openDialog">Open Dialog</button>
  <dialog id=dialog>
    I'm a dialog!
  </dialog>
</div>
<button id="openPopover">Open Popover</button>
<button>I do nothing!</button>
```

With some JS like

```js
openDialog.onclick = () => {
  dialog.showModal();
}

openPopover.onclick = () => {
  popover.showPopover();
}
```

Clicking the "Open Popover" button followed by the "Open Dialog" button results in both the Dialog and Popover being hidden, however the dialog will still be open as modal, rendering the whole page inert, nothing is clickable and there seems to be no way to undo this (unless you use a CloseWatcher gesture such as the Esc key - if you have one available on your device).

It is expected that the popover should not close the dialog, as it causes the invisible Modal Dialog to make the whole page inert, and it is very difficult for users (and developers) to discover how to undo this action (pressing escape).

This was reported in https://github.com/whatwg/html/issues/9998, and WhatWG resolved to fix this, which in https://github.com/whatwg/html/pull/10116.

Differential Revision: https://phabricator.services.mozilla.com/D200686
2024-02-05 23:58:42 +00:00
Emilio Cobos Álvarez
bddf934e04 Bug 1876745 - Factor out scroll{Width,Height} logic. r=dholbert
No behavior change, just clean-up.

Differential Revision: https://phabricator.services.mozilla.com/D199861
2024-01-29 21:32:12 +00:00
Hiroyuki Ikezoe
0fcc48906c Bug 1875011 - Rename GetScrollPositionCSSPixels to GetRoundedScrollPositionCSSPixels. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D198766
2024-01-17 06:27:05 +00:00
Emilio Cobos Álvarez
9231eae657 Bug 1856156 - Make Directionality an enum class. r=smaug
A bit neater this way.

Differential Revision: https://phabricator.services.mozilla.com/D198590
2024-01-15 19:35:44 +00:00
Narcis Beleuzu
56eab566cd Backed out changeset 5431daa798c7 (bug 1871424) for causing Bug 1873472 2024-01-12 11:52:07 +02:00
Edgar Chen
f9dcb72748 Bug 1871424 - Make input checkbox/radio in link element work again; r=vhilla,dom-core
The root cause of issue is that the link elements have not yet adopted the
activation behavior defined in the specification. This patch add a hacky way to
avoid link elements perform activation behavior if it has a child input element
which will perform activation behavior. This patch introduces new flags instead of
reusing the exiting ones, allowing us to uplift this patch more safely.

Differential Revision: https://phabricator.services.mozilla.com/D197393
2024-01-02 15:52:25 +00:00
Jihye Hong
44b6d16685 Bug 1859852 - Add options to check for content-visibility: auto to element.checkVisibility() r=emilio
This patch adds `contentVisibilityAuto` as well as alternative names `opacityProperty` and `visibilityProperty` for deprecated options.

Related spec edit: https://github.com/w3c/csswg-drafts/pull/9549/files

authored-by: Frédéric Wang <fwang@igalia.com>

Differential Revision: https://phabricator.services.mozilla.com/D196007
2023-12-12 12:39:23 +00:00
Adam Vandolder
925078cda0 Bug 1712140 - Part 4: Add parseHTMLUnsafe and setHTMLUnsafe methods. r=dom-core,webidl,hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D193676
2023-12-07 21:27:10 +00:00
Adam Vandolder
df57d42de6 Bug 1712140 - Part 2: Allow ShadowRoots to be clonable and declarative. r=webidl,emilio,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D193674
2023-12-07 21:27:09 +00:00
Iulian Moraru
ec88b58413 Backed out 6 changesets (bug 1712140) for causing sanitizer failures on nsHtml5TreeBuilder.cpp. CLOSED TREE
Backed out changeset b374469160e9 (bug 1712140)
Backed out changeset dfc44cccff32 (bug 1712140)
Backed out changeset 3a35e1401130 (bug 1712140)
Backed out changeset a93481858c38 (bug 1712140)
Backed out changeset a861fd445f56 (bug 1712140)
Backed out changeset dc1dc389f2dc (bug 1712140)
2023-12-07 08:16:23 +02:00
Adam Vandolder
1b0ccf0e14 Bug 1712140 - Part 4: Add parseHTMLUnsafe and setHTMLUnsafe methods. r=dom-core,webidl,hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D193676
2023-12-06 22:50:50 +00:00
Adam Vandolder
6711844677 Bug 1712140 - Part 2: Allow ShadowRoots to be clonable and declarative. r=webidl,emilio,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D193674
2023-12-06 22:50:49 +00:00
Stanca Serban
88e5c5662f Backed out 6 changesets (bug 1712140) for causing Linux related wpt failures in nsHtml5TreeBuilder.cpp. CLOSED TREE
Backed out changeset 3d799b386f3e (bug 1712140)
Backed out changeset 2ed53d545d6d (bug 1712140)
Backed out changeset 6f50077df42a (bug 1712140)
Backed out changeset e7c5449482f9 (bug 1712140)
Backed out changeset 5490dad148ef (bug 1712140)
Backed out changeset 50828058065e (bug 1712140)
2023-12-06 00:18:38 +02:00