Commit graph

425 commits

Author SHA1 Message Date
Olli Pettay
6b448ef5da Bug 1882417 - Suspend DOM notifications while parsing innerHTML, r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D202891
2024-03-01 13:14:34 +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
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
Emilio Cobos Álvarez
a4d842c063 Bug 1879579 - Clean up CompareTreePosition and related code. r=smaug
Make TreeOrderedArray support what the form controls stuff needs, and
use it instead of custom nsContentUtils stuff.

Differential Revision: https://phabricator.services.mozilla.com/D201261
2024-02-12 20:01:36 +00:00
Noemi Erli
f92d721721 Backed out changeset 1acc95286189 (bug 1879579) for causing mass failures CLOSED TREE 2024-02-12 17:25:21 +02:00
Emilio Cobos Álvarez
068080982b Bug 1879579 - Clean up CompareTreePosition and related code. r=smaug
Make TreeOrderedArray support what the form controls stuff needs, and
use it instead of custom nsContentUtils stuff.

Differential Revision: https://phabricator.services.mozilla.com/D201261
2024-02-12 00:01:23 +00:00
Emilio Cobos Álvarez
633cce158c Bug 1868552 - Refactor nsIContent::IsFocusable for clarity. r=masayuki
Make it be output-only, not having that confusing in-out tab-index
parameter that is special for XUL to become focusable with
-moz-user-focus: normal. Instead, do that explicitly in
nsIFrame::IsFocusable().

Also, call it IsFocusableWithoutStyle(), since that's what it is.

Differential Revision: https://phabricator.services.mozilla.com/D195644
2023-12-08 11:34:06 +00:00
Emilio Cobos Álvarez
3bac7ba792 Bug 1866773 - Don't retarget animation events from anon root to anon parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D194865
2023-11-29 01:36:22 +00:00
Ziran Sun
54f7be0077 Bug 1858912 - Refine popover focusing steps to follow the specs. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D190917
2023-10-27 13:02:17 +00:00
Sylvestre Ledru
d0f6c7fc66 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-15 15:29:02 +00:00
Cristina Horotan
6a90f5eded Backed out 2 changesets (bug 1856795) for causing build bustage at BasicEvents.h CLOSED TREE
Backed out changeset 1d98b028923a (bug 1856795)
Backed out changeset eae2ac93e17c (bug 1856795)
2023-10-14 21:42:14 +03:00
Sylvestre Ledru
cc8a0ee742 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-14 17:34:26 +00:00
Adam Vandolder
3198d33ca2 Bug 1685926 - Group disconnected radio buttons together. r=saschanaz,smaug
Differential Revision: https://phabricator.services.mozilla.com/D162349
2023-09-28 15:47:11 +00:00
Natalia Csoregi
1497f6f44d Backed out changeset 8f8492410799 (bug 1685926) for causing bustage on SVGAnimatedPathSegList.cpp. CLOSED TREE 2023-09-28 10:40:31 +03:00
Adam Vandolder
226c8aba6a Bug 1685926 - Group disconnected radio buttons together. r=saschanaz,smaug
Differential Revision: https://phabricator.services.mozilla.com/D162349
2023-09-28 06:35:44 +00:00
Olli Pettay
b632508d71 Bug 1843477, remove main thread only CC macros, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D187146
2023-09-26 12:36:20 +00:00
Cosmin Sabou
baf8a5cf23 Backed out 6 changesets (bug 1843477) for causing hazards failures. CLOSED TREE
Backed out changeset 64b093aa12a9 (bug 1843477)
Backed out changeset bdcd84c938d1 (bug 1843477)
Backed out changeset 05c882dd0d9a (bug 1843477)
Backed out changeset 1de814e5820d (bug 1843477)
Backed out changeset 6a0e19a60a5d (bug 1843477)
Backed out changeset 48942aff586f (bug 1843477)
2023-09-26 05:32:28 +03:00
Olli Pettay
ce2ffc54c9 Bug 1843477, remove main thread only CC macros, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D187146
2023-09-25 21:09:00 +00:00
Cristian Tuns
8ce555ea94 Backed out changeset 37ade77d181e (bug 1685926) for causing build bustages in PerformanceEventTiming.cpp CLOSED TREE 2023-09-25 12:40:22 -04:00
Adam Vandolder
190df7c40c Bug 1685926 - Group disconnected radio buttons together. r=saschanaz,smaug
Differential Revision: https://phabricator.services.mozilla.com/D162349
2023-09-25 14:39:08 +00:00
Cosmin Sabou
2b53f8d322 Backed out 3 changesets (bug 1843477) for causing hazards failures on TelemetryFixture.cpp. CLOSED TREE
Backed out changeset 4dd5d8ac600c (bug 1843477)
Backed out changeset e7bc0b63286a (bug 1843477)
Backed out changeset 4f45f40beaf7 (bug 1843477)
2023-09-08 20:21:46 +03:00
Olli Pettay
d7c56b8b4f Bug 1843477, remove main thread only CC macros, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D187146
2023-09-08 14:51:48 +00:00
Ryan VanderMeulen
8e8536da3e Bug 1851593 - Add missing ACCESSIBILITY guard. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D187450
2023-09-05 13:51:27 +00:00
Olli Pettay
0f41a21230 Bug 1851039 - Investigate if it is possible to reuse the text node when setting element.textContent, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187231
2023-09-04 09:38:09 +00:00
Sandor Molnar
956a7783df Backed out changeset 3451691c483d (bug 1851039) for causing mochitest failures in accessible/tests/browser/e10s/browser_caching_description.js CLOSED TREE 2023-09-04 05:48:44 +03:00
Olli Pettay
3903cddb4a Bug 1851039 - Investigate if it is possible to reuse the text node when setting element.textContent, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187231
2023-09-03 17:57:31 +00:00
Cristian Tuns
639f69e43f Backed out changeset e6370dc41077 (bug 1851039) for causing wpt failures in dynamic-mtext-like-001.html CLOSED TREE 2023-09-01 12:33:37 -04:00
Olli Pettay
ce54004465 Bug 1851039 - Investigate if it is possible to reuse the text node when setting element.textContent, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187231
2023-09-01 14:08:32 +00:00
Sean Feng
0a3d5faf4b Bug 1811129 - Implement the new dialog initial focus algorithm r=emilio
The main changes of the new algorithm are

* Make the dialog focusing steps look at sequentially focusable elements instead of any focusable element.
* Make the dialog element itself get focus if it has the autofocus attribute set.
* Make the dialog element itself get focus as a fallback instead of focus being "reset" to the body element.

Spec PR (merged): https://github.com/whatwg/html/pull/8199

Differential Revision: https://phabricator.services.mozilla.com/D181263
2023-08-02 13:35:47 +00:00
Norisz Fay
9de8b59a54 Backed out changeset cbf5ea1b17d2 (bug 1811129) for causing failures on modal-dialog-backdrop-opacity.html CLOSED TREE 2023-07-06 20:28:17 +03:00
Sean Feng
185848e40b Bug 1811129 - Implement the new dialog initial focus algorithm r=emilio
The main changes of the new algorithm are

* Make the dialog focusing steps look at sequentially focusable elements instead of any focusable element.
* Make the dialog element itself get focus if it has the autofocus attribute set.
* Make the dialog element itself get focus as a fallback instead of focus being "reset" to the body element.

Spec PR (merged): https://github.com/whatwg/html/pull/8199

Differential Revision: https://phabricator.services.mozilla.com/D181263
2023-07-06 15:33:33 +00:00
Masayuki Nakano
45d0d4e574 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
df7453527a Bug 1827516 - Cleanup some event target parent code. r=smaug
No behavior change here, but I was looking and this code can be simpler.

Differential Revision: https://phabricator.services.mozilla.com/D175714
2023-04-18 09:23:06 +00:00
Emilio Cobos Álvarez
641fa20731 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
Emilio Cobos Álvarez
5aa57269ec Bug 1825825 - Simplify inspector node walking. r=smaug
This doesn't change behavior but it's simpler. I found it while
debugging a failure with the previous patches.

Depends on D174316

Differential Revision: https://phabricator.services.mozilla.com/D174365
2023-04-03 09:21:35 +00:00
Alexander Surkov
366fa1626d Bug 1823757 - implement attr associated element, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D173337
2023-03-30 16:15:52 +00:00
Cathie Chen
a551a009d3 Bug 1823897 - Implement popover focusing steps, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D173714
2023-03-28 16:01:25 +00:00
Emilio Cobos Álvarez
91e6e4c5d4 Bug 1823686 - Share URLExtraData between SVG attribute mapping and style attribute. r=smaug
I don't think there's ever a way these should differ.

Got some include hell from removing ReferrerInfo.h from Document.h but
hopefully should be straight-forward to review.

Depends on D173154

Differential Revision: https://phabricator.services.mozilla.com/D173155
2023-03-22 14:54:43 +00:00
Emilio Cobos Álvarez
80a760bb0c Bug 1823686 - Unify ReferrerInfo::CreateFor{InternalCSS,SVG}Resources, since they're the same. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D173154
2023-03-22 11:50:56 +00:00
Ziran Sun
e1b24f642b 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
Olli Pettay
21d3624930 Bug 1816312, try to avoid creating Range objects in some common cases when spellchecker is disabled for contentEditable, r=masayuki
This is not very optimimal, but tracking spellchecking state in DOM tree is tricky because of multiple contentEditables and possibility to set spellcheck true/false anywhere etc.
At least this helps with the testcase quite a bit.

Differential Revision: https://phabricator.services.mozilla.com/D169870
2023-02-16 11:48:13 +00:00
Robert Longson
88d6e6fbaa Bug 1817075 - Use nsIFrame::HasAnyStateBits() whenever possible instead of GetStateBits() r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D170006
2023-02-16 08:10:28 +00:00
Emilio Cobos Álvarez
6c32b964cd Bug 1807003 - Centralize animation data in slots. r=smaug,firefox-animation-reviewers,boris
This should both be faster and simpler. Also will allow us in the future
to animate more pseudos without having to add a gazillion properties.

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

Differential Revision: https://phabricator.services.mozilla.com/D169860
2023-02-15 14:12:33 +00:00
Olli Pettay
e8b7bce992 Bug 1799354, replaceChildren should fire DOMNodeRemoved when needed (and not assert about 'Want to fire DOMNodeRemoved event, but it's not safe'), r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D161682
2022-11-16 20:29:53 +00:00
Sean Feng
c6d5b35934 Bug 1741936 - Implement focus delegate algorithm r=emilio
Spec: https://html.spec.whatwg.org/multipage/interaction.html#focus-delegate

Differential Revision: https://phabricator.services.mozilla.com/D153689
2022-10-14 01:20:08 +00:00
Olli Pettay
93acdfad59 Bug 1777574, automate CC zone handling, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D155084
2022-09-07 11:22:51 +00:00
Emilio Cobos Álvarez
255763ef57 Bug 1773070 - Unify Gecko and Servo EventState/ElementState bits. r=smaug
Add a dom/base/rust crate called just "dom" where we can share these.

Most of the changes are automatic:

  s/mozilla::EventStates/mozilla::dom::ElementState/
  s/EventStates/ElementState/
  s/NS_EVENT_STATE_/ElementState::/
  s/NS_DOCUMENT_STATE_/DocumentState::/

And so on. This requires a new cbindgen version to avoid ugly casts for
large shifts.

Differential Revision: https://phabricator.services.mozilla.com/D148537
2022-06-07 23:09:52 +00:00
Emilio Cobos Álvarez
6af42b7029 Bug 1771791 - Use regular ComputeIndexOf in ComputeFlatTreeIndexOf if there's no Shadow DOM involved. r=mrobinson
Untested, but seems like it should address the regression.

Differential Revision: https://phabricator.services.mozilla.com/D147865
2022-06-02 09:24:16 +00:00
Martin Robinson
cac491e1fd Bug 1477524 - Update quotes and counters to work trough the flattened tree r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D146693
2022-05-26 16:12:46 +00:00
Norisz Fay
28db98ade1 Backed out changeset ce66cc2cbb95 (bug 1477524) for causing build bustages on nsCounterManager.cpp CLOSED TREE 2022-05-26 15:24:40 +03:00