Граф коммитов

950 Коммитов

Автор SHA1 Сообщение Дата
Markus Stange 1df2886427 Bug 1852866 - Make LifecycleCallbackArgs::mName a RefPtr<nsAtom>. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D188100
2023-09-13 18:15:02 +00:00
Markus Stange fe7358f6c8 Bug 1843949 - Preallocate attribute array with the known size from parsing. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D183809
2023-09-02 18:46:30 +00:00
Emilio Cobos Álvarez 0c622556aa Bug 1850161 - Remove the concept of intrinsic states and related code. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D187109
2023-08-31 09:20:40 +00:00
Cristina Horotan 4487727b74 Backed out 3 changesets (bug 1850238, bug 1850161) for causing multiple failures at Element.cpp CLOSED TREE
Backed out changeset 30526c800ca7 (bug 1850161)
Backed out changeset ebc81e5e7750 (bug 1850161)
Backed out changeset e66a62c2f8c5 (bug 1850238)
2023-08-31 12:12:05 +03:00
Emilio Cobos Álvarez b886d263c1 Bug 1850161 - Remove the concept of intrinsic states and related code. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D187109
2023-08-31 07:46:24 +00:00
Emilio Cobos Álvarez 7855659a73 Bug 1850238 - Make Link states not intrinsic. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D186877
2023-08-30 09:18:32 +00:00
Emilio Cobos Álvarez 33968f7c4e Bug 1850293 - Make editable states not intrinsic. r=smaug,masayuki
This one is tricky because form controls, though I think I got it right...

This fixes a pre-existing bug where we're not following the spec for readonly
inside content-editable.

I filed this as bug 1850390 but other browsers match the spec so add a test and
fix it while at it. This allows cheaper checks for readonlyness in a couple
places.

Differential Revision: https://phabricator.services.mozilla.com/D186896
2023-08-30 09:18:31 +00:00
Olli Pettay fe6ec03ab9 Bug 1843473 - Don't dispatch DOMActivate if there are no listeners for it, r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D186473
2023-08-18 06:01:16 +00:00
Markus Stange 943e3c05a7 Bug 1843946 - Use an atom for the full class attribute value, to reduce string hash key cost during the AtomArrayCache lookup. r=emilio
This generalizes the previous "set single class from parser" fast-path to
also apply when there are multiple classes in the class attribute.

The main benefit is the cheaper cache lookup.
Another benefit is that this avoids a string copy (the same copy that the original
"set single class from parser" optimization avoided).

We now always atomize the full class attribute value before parsing it,
e.g. when somebody uses setAttribute. In the common case of a single class,
this atomization cost would have been paid anyway.

Before: https://share.firefox.dev/4576ulw
After: https://share.firefox.dev/3rNGBsH (though this is not the full story
because the atomization work is moved outside of nsHtml5TreeOperation::SetHTMLElementAttributes)

Differential Revision: https://phabricator.services.mozilla.com/D183813
2023-08-17 19:02:40 +00:00
CanadaHonk a117230132 Bug 1824121 - Implement the <search> element r=hsivonen,Jamie,emilio
Implemented the new <search> HTML element.
All WPT tests for it now pass (except one for iso-8859-8, not done generally).

A11y role uses just landmark as recommended instead of a new search role (for now).

Co-authored-by: Henri Sivonen <hsivonen@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D176967
2023-08-07 22:11:05 +00:00
Stanca Serban 183a888a39 Backed out 3 changesets (bug 1824121) for causing wpt failures in html5lib_search-element.html. CLOSED TREE
Backed out changeset e3aec91d79e4 (bug 1824121)
Backed out changeset e3a3324b1732 (bug 1824121)
Backed out changeset 6ff5c272ab8e (bug 1824121)
2023-08-07 21:20:18 +03:00
CanadaHonk 631b819e14 Bug 1824121 - Implement the <search> element r=hsivonen,Jamie,emilio
Implemented the new <search> HTML element.
All WPT tests for it now pass (except one for iso-8859-8, not done generally).

A11y role uses just landmark as recommended instead of a new search role (for now).

Co-authored-by: Henri Sivonen <hsivonen@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D176967
2023-08-07 14:05:32 +00:00
Cosmin Sabou b0f9a6e63d Backed out changeset c309e9b48aec (bug 1824121) for causing element related mochitest failures. CLOSED TREE 2023-08-07 16:05:13 +03:00
CanadaHonk 23a0c9beff Bug 1824121 - Implement the <search> element r=hsivonen,Jamie,emilio
Implemented the new <search> HTML element.
All WPT tests for it now pass (except one for iso-8859-8, not done generally).

A11y role uses just landmark as recommended instead of a new search role (for now).

Co-authored-by: Henri Sivonen <hsivonen@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D176967
2023-08-07 12:30:50 +00:00
David Shin ec30a6eea6 Bug 1845744: Move selector-specific node flags to a separate field. r=emilio
Upcoming :has invalidation (Bug 1792501) requires 4 more flags, and we're out of space.
This change consumes the remaining 32-bit hole in `nsINode` to migrate selector-specific
node flags.
This has implications on 32-bit platforms, specifically on text nodes.

Differential Revision: https://phabricator.services.mozilla.com/D184718
2023-08-01 00:29:56 +00:00
Mathew Hodson 21cd613492 Bug 1564391 - Rename internal uses of `mozInputSource`. r=emilio,pip-reviewers,tabbrowser-reviewers,dao,kpatenio
This allows us to deprecate `mozInputSource` for the Web while
avoiding console warnings for internal uses, which now use the
ChromeOnly `inputSource` attribute.

Differential Revision: https://phabricator.services.mozilla.com/D183643
2023-07-26 09:27:45 +00:00
Sandor Molnar aa6a466e90 Backed out 2 changesets (bug 1843035) for causing assertion failures in dom/html/nsGenericHTMLElement.cpp CLOSED TREE
Backed out changeset d44bf85938f0 (bug 1843035)
Backed out changeset 238e99b4449c (bug 1843035)
2023-07-18 17:30:09 +03:00
Mirko Brodesser ce75e797f8 Bug 1843035: part 2) Assert correctness of popover attribute state at all relevant callers of `GetPopoverAttributeState()`. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D183477
2023-07-18 08:57:26 +00:00
Vincent Hilla dac4116354 Bug 1814310 - Improve runtime of nsGenericHTMLFormElement::UpdateFormOwner. r=smaug
Avoid intermediate DOMString in GetAttr, optimize calls to GetFormInternal.

Differential Revision: https://phabricator.services.mozilla.com/D182789
2023-07-17 13:35:34 +00:00
Mirko Brodesser 8a8c38279e Bug 1841505: postpone setting the popover invoker in the "show popover" algo. r=emilio
See
<https://github.com/whatwg/html/issues/9383#issuecomment-1602227494>.

Differential Revision: https://phabricator.services.mozilla.com/D182709
2023-07-12 10:12:23 +00:00
Razvan Cojocaru 74639ffcbe Bug 1842072 - Prevent IntCoordTyped's constructor from accepting non-integral parameters. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D182936
2023-07-08 07:45:44 +00:00
Emilio Cobos Álvarez 4cc6758558 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Emilio Cobos Álvarez 7bddcf9e5a 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 17:22:03 +00:00
Cristian Tuns 6957543e5e Backed out changeset a3e55d5f9f13 (bug 1839223) for causing multiple failures in Document.cpp CLOSED TREE 2023-06-22 11:34:15 -04:00
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
Tom Schuster 75e3147782 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 ec7ac1b850 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 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
Kershaw Chang 5149a41b0e 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 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
Jan-Niklas Jaeschke bfe0baa6d6 Bug 1828469, part 2: Moved some logic from `nsRange` to `AbstractRange` to support `StaticRange`s 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 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
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
Noemi Erli 61ed1c4c8c 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 0bf8a22c8f Bug 1828469, part 2: Moved some logic from `nsRange` to `AbstractRange` to support `StaticRange`s 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 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 1c967006ab 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 cbb25b7480 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 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
Emilio Cobos Álvarez 8b5b7ad998 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 8ea3ac776a 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 c47c1d4f4c 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 7dfe52adaf 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 168555a743 Backed out changeset 96da9dcee2b0 (bug 1823757) for causing failures on popover-invoking-attribute.html. CLOSED TREE 2023-04-11 09:43:08 +03:00