Commit Graph

566 Commits

Author SHA1 Message Date
Ting-Yu Lin
5cd68a11de Bug 1896516 Part 9 - Remove nsIScrollableFrame usages under dom/. r=layout-reviewers,emilio
Also, in EventStateManager, convert `ComputeScrollTarget()` and
`ComputeScrollTargetAndMayAdjustWheelEvent()` to return `ScrollContainerFrame*`
so that we can drop more unnecessarily `do_QueryFrame`.

Due to removing `nsIScrollableFrame` forward declaration in DOM headers, we have
to add `nsIScrollableFrame` forward declaration temporarily in
nsMenuPopupFrame.h to make this patch compile, but we'll remove it once we
remove `nsIScrollableFrame` under layout/.

Differential Revision: https://phabricator.services.mozilla.com/D211496
2024-05-30 06:32:21 +00:00
Sebastian Hengst
bf4dfe53f8 Backed out 15 changesets (bug 1896516) for causing scrolling crashes on macOS. a=backout
Backed out changeset fd6904338812 (bug 1896516)
Backed out changeset 2977ff81a23e (bug 1896516)
Backed out changeset c8a6b0e526d6 (bug 1896516)
Backed out changeset 3c06f22da72b (bug 1896516)
Backed out changeset f63b0c4335fe (bug 1896516)
Backed out changeset 6f7ab8adfa6e (bug 1896516)
Backed out changeset 997c9249dbed (bug 1896516)
Backed out changeset c964fccd5180 (bug 1896516)
Backed out changeset 7b481b747b7a (bug 1896516)
Backed out changeset 42e1bbe0ecb6 (bug 1896516)
Backed out changeset 717dac08b607 (bug 1896516)
Backed out changeset 2f0817331dbe (bug 1896516)
Backed out changeset b765169a7a8f (bug 1896516)
Backed out changeset a2d37b98273c (bug 1896516)
Backed out changeset ea9ecb543e66 (bug 1896516)
2024-05-29 11:22:52 +02:00
Ting-Yu Lin
5d5204f810 Bug 1896516 Part 9 - Remove nsIScrollableFrame usages under dom/. r=layout-reviewers,emilio
Also, in EventStateManager, convert `ComputeScrollTarget()` and
`ComputeScrollTargetAndMayAdjustWheelEvent()` to return `ScrollContainerFrame*`
so that we can drop more unnecessarily `do_QueryFrame`.

Due to removing `nsIScrollableFrame` forward declaration in DOM headers, we have
to add `nsIScrollableFrame` forward declaration temporarily in
nsMenuPopupFrame.h to make this patch compile, but we'll remove it once we
remove `nsIScrollableFrame` under layout/.

Differential Revision: https://phabricator.services.mozilla.com/D211496
2024-05-28 04:46:20 +00:00
keithamus
af4755d972 Bug 1860457 - implement popover invoke defaults r=dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D206184
2024-05-24 08:41:03 +00:00
Tom Schuster
c223046d21 Bug 1835157 - Ignore target names which contain both newline and < characters. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D210480
2024-05-24 08:09:36 +00:00
Sandor Molnar
a9eee12a7d Backed out changeset 4cce744a9cbb (bug 1860457) for causing wpt failures. CLOSED TREE 2024-05-24 07:07:16 +03:00
keithamus
05c91c9f0e Bug 1860457 - implement popover invoke defaults r=dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D206184
2024-05-23 20:56:58 +00:00
keithamus
1df93584c8 Bug 1867786 - Only dispatch for valid invoke actions r=dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D206183
2024-05-16 09:49:50 +00:00
keithamus
dbce97da92 Bug 1888774 - make InvokeAction an enum, "auto" now implicit r=dom-core,sefeng
Only "custom" invoke actions (those with a dash) or well-defined built-in
actions can be defined. Auto action is now implicit from empty/null atom.

Differential Revision: https://phabricator.services.mozilla.com/D206182
2024-05-15 21:38:06 +00:00
Adam Vandolder
a47cef74ff 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
2b8d8ca135 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
a54c0a7578 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
badab1c1b7 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
35af9c2203 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
Vincent Hilla
8cd8ba4bdf 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
Emilio Cobos Álvarez
747332792a 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
ff13a04474 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
Eitan Isaacson
55275793f7 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
Artur Iunusov
06d1306fcc Bug 1770944 - Remove nsIMozBrowserFrame. r=smaug
Depends on D155254

Differential Revision: https://phabricator.services.mozilla.com/D170397
2024-03-07 13:04:21 +00:00
Cathie Chen
7859d6112f Bug 1879340 - Add potentially render blocking, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D201095
2024-02-24 18:12:35 +00:00
Narcis Beleuzu
197b39f007 Backed out 16 changesets (bug 1770944) as req by asuth.
Backed out changeset 61af32f40777 (bug 1770944)
Backed out changeset 4ff0c45db93b (bug 1770944)
Backed out changeset 8a217eff7bcd (bug 1770944)
Backed out changeset 6435f48c96bf (bug 1770944)
Backed out changeset 0d2432765ca0 (bug 1770944)
Backed out changeset 58e02566db85 (bug 1770944)
Backed out changeset 0a8c4c2460ee (bug 1770944)
Backed out changeset 9416bafd9982 (bug 1770944)
Backed out changeset 79de4f83fe2e (bug 1770944)
Backed out changeset 63ac518aceb0 (bug 1770944)
Backed out changeset 14952f872b77 (bug 1770944)
Backed out changeset f65e0967ad75 (bug 1770944)
Backed out changeset bd53c42038f7 (bug 1770944)
Backed out changeset 36c378ba8212 (bug 1770944)
Backed out changeset 9ba54ab06348 (bug 1770944)
Backed out changeset fb5a54b3cbe9 (bug 1770944)
2024-02-23 21:11:08 +02:00
Artur Iunusov
1ce1cdce44 Bug 1770944 - Remove nsIMozBrowserFrame. r=smaug
Depends on D155254

Differential Revision: https://phabricator.services.mozilla.com/D170397
2024-02-22 10:13:13 +00:00
Emilio Cobos Álvarez
18f7b60591 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
893e35ea14 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
James Teh
7db31a1797 Bug 1861201: Support ariaBrailleLabel and ariaBrailleRoleDescription IDL attributes. r=webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D202195
2024-02-20 21:46:40 +00:00
Sandor Molnar
6699491437 Backed out 16 changesets (bug 1770944) for causing asan failures @ dom/base/InProcessBrowserChildMessageManager.cpp
Backed out changeset b73885731e73 (bug 1770944)
Backed out changeset 23d0dc98eb51 (bug 1770944)
Backed out changeset 15661e24d8e1 (bug 1770944)
Backed out changeset 97aa839dc200 (bug 1770944)
Backed out changeset 0d4318bf3239 (bug 1770944)
Backed out changeset be28bb62e9f3 (bug 1770944)
Backed out changeset 708b2671410e (bug 1770944)
Backed out changeset 0a138f3b56b9 (bug 1770944)
Backed out changeset 3a149ef794c2 (bug 1770944)
Backed out changeset 4b6ae7dd0e69 (bug 1770944)
Backed out changeset e3960ad85182 (bug 1770944)
Backed out changeset 9ea253525227 (bug 1770944)
Backed out changeset 1828b66c2f7c (bug 1770944)
Backed out changeset 55b0886f9025 (bug 1770944)
Backed out changeset a4197071d10a (bug 1770944)
Backed out changeset 9b18524f541e (bug 1770944)
2024-02-20 20:34:55 +02:00
Artur Iunusov
8d02dfbc6f Bug 1770944 - Remove nsIMozBrowserFrame. r=smaug
Depends on D155254

Differential Revision: https://phabricator.services.mozilla.com/D170397
2024-02-20 16:53:22 +00:00
Emilio Cobos Álvarez
7506fc5879 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
021e5f2541 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
b5a4cd1ace 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
573df9d987 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
c048517fd7 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
2241dc7d89 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
5a1201acfd 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
d8224880f1 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
a0f699ef4d 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
d5efc74a38 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
18df088553 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
Tom Schuster
940baabb7a Bug 1397308 - Implement CSP 'Is element nonceable?' check. r=emilio,hsivonen,freddyb
Differential Revision: https://phabricator.services.mozilla.com/D198150
2024-01-26 14:56:32 +00:00
Emilio Cobos Álvarez
bc8e14504e 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
Adam Vandolder
9175984175 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
483e2a2383 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
8d186a8450 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
355580f7c5 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
2353e195dc 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
34d35a19ee 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
Adam Vandolder
22752a3a0a Bug 1712140 - Part 4: Add parseHTMLUnsafe and setHTMLUnsafe methods. r=dom-core,webidl,hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D193676
2023-12-05 18:18:17 +00:00
Adam Vandolder
86ef8d220d 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-05 18:18:16 +00:00
Masayuki Nakano
fc0a220bac Bug 1863759 - Make IMEStateManager recreate IMEContentObserver if the active one is not observing editable content of focused element r=smaug,m_kato
The test case is a special case that changes focused element from a text control
to an editing host.  Therefore, without a focus change, focused editor is
changed from a `TextEditor` to `HTMLEditor`.  At this time, `IMEContentObserver`
needs to switch the observing target from the anonymous content if `<input>` to
children of it.

However, the editable content becomes completely changed without a focus change
in the DOM.  Therefore, `IMEStateManager` needs to synthesize a fake focus move
for IME.  Therefore, this patch make `IMEStateManager` recreate
`IMEContentObserver` if active one is not observing editable content for the
focused element under "current" conditions at checking it.  (When
`IMEContentObserver` is being destroyed, it sends "blur" notification to IME
and the new `IMEContentObserver` instance posts "focus" notification with
all editable content data.  I.e., recreating `IMEContentObserver` generates
a fake focus move from IME point of view.)

Additionally, there is the opposite case, that is, editing host of an `<input>`
whose type is not a text control may become a text control.  Therefore, this
adds new WPTs to check the handler is the text editor for the text control or
the HTML editor.  The tests passed on Firefox and Chrome at least.

FYI: I guess that in this case, we need to kick `focus` event listener of the
`HTMLEditor`, but anyway, users cannot change the content because it's the
case that an atomic content is the editing host.  Therefore, I don't touch
about that in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D193262
2023-12-05 02:33:18 +00:00
Iulian Moraru
80baabd575 Backed out 6 changesets (bug 1712140) for causing wpt failures on declarative-shadow-dom-opt-in.html.
Backed out changeset 78e3a33470ae (bug 1712140)
Backed out changeset 8601fce480ef (bug 1712140)
Backed out changeset 4d2749962c5f (bug 1712140)
Backed out changeset b65511d17150 (bug 1712140)
Backed out changeset 8ae1f766f1f9 (bug 1712140)
Backed out changeset 4ffe7a6ad366 (bug 1712140)
2023-12-04 22:30:04 +02:00