Commit Graph

1025 Commits

Author SHA1 Message Date
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
Adam Vandolder
1dce51d395 Bug 1712140 - Part 4: Add parseHTMLUnsafe and setHTMLUnsafe methods. r=dom-core,webidl,hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D193676
2023-12-04 17:35:49 +00:00
Adam Vandolder
699de11e10 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-04 17:35:48 +00:00
Stanca Serban
3fa8347485 Backed out 6 changesets (bug 1712140) for causing wpt failures in declarative-shadow-dom-opt-in.html.
Backed out changeset 554a46ed8046 (bug 1712140)
Backed out changeset 14ebbfca2e84 (bug 1712140)
Backed out changeset 98dd5766dd46 (bug 1712140)
Backed out changeset 4241a7241a9b (bug 1712140)
Backed out changeset 59ee434d503e (bug 1712140)
Backed out changeset ff3bb42f91d1 (bug 1712140)
2023-12-01 03:26:27 +02:00
Adam Vandolder
451614f805 Bug 1712140 - Part 4: Add parseHTMLUnsafe and setHTMLUnsafe methods. r=dom-core,webidl,hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D193676
2023-11-30 23:17:15 +00:00
Adam Vandolder
4f990cf528 Bug 1712140 - Part 2: Allow ShadowRoots to be clonable and declarative. r=webidl,emilio,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D193674
2023-11-30 23:17:15 +00:00
Stanca Serban
8d6a9ece7a Backed out 3 changesets (bug 1851970) for causing mochitests failures in browser_aboutNetError_csp_iframe.js.
Backed out changeset a2536c6c6c23 (bug 1851970)
Backed out changeset 23ddc229d1a1 (bug 1851970)
Backed out changeset b99a620a535c (bug 1851970)
2023-11-28 18:43:55 +02:00
Vincent Hilla
4a2ca2ff09 Bug 1851970 - Part 2: Activation behavior method for links. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D183991
2023-11-28 14:09:02 +00:00
Tom Schuster
3889192065 Bug 1864838 - Update our Sanitizer to the new proposed WebIDL. r=emilio,freddyb
The new proposed WebIDL is at https://github.com/WICG/sanitizer-api/issues/181#issuecomment-1761270913.
Sadly we don't have a real spec for this yet. Luckily this is mostly
just a renaming. The biggest change is that every <element> in elements: now has a list of allowed and removed attributes.

Differential Revision: https://phabricator.services.mozilla.com/D193642
2023-11-28 11:04:03 +00:00
Emilio Cobos Álvarez
c27730d3df Bug 1364813 - Remove IsFrameOfType, use non-virtual checks. r=jwatt
Extend the per-frame-class bit we have to devirtualize IsLeaf to also
devirtualize IsFrameOfType. That is, move this data to FrameClasses.py.

This was done by going through all the frame classes, trying to preserve
behavior.

The only quirky thing is that I had to add two more trivial frame
classes, `nsAudioFrame` for audio elements, and
`nsFloatingFirstLetterFrame`. That's because these frame classes were
returning different answers at runtime, but they do this only on
conditions that trigger frame reconstruction (floating, and being an
audio element, respectively).

Differential Revision: https://phabricator.services.mozilla.com/D194703
2023-11-26 22:17:28 +00:00
keithamus
2c3b3f4d43 Bug 1861466 - Add CustomStateSet and :state() pseudo. r=emilio,smaug
Differential Revision: https://phabricator.services.mozilla.com/D191988
2023-11-08 13:38:02 +00:00
CanadaHonk
aa654b839c Bug 1622090 - Implement loading=lazy for <iframe> r=emilio
Initial implementation for <iframe loading=lazy>

Also cleaned up some image lazy loading to be generalised
(sharing an intersection observer and some enums/funcs in Element).

Unimplemented details:
 - Window load should not wait for in view lazy loading iframes.
   Unplanned for this patch and ship for now.
   (Chromium fail, WebKit pass)

We also pass some other WPTs other engines do not too already too.
Also added a WPT to ensure using parse-time base URI for lazy -> eager iframes.

Differential Revision: https://phabricator.services.mozilla.com/D190662
2023-10-18 14:13:29 +00:00
Jan Varga
272327b326 Bug 1855134 - Move existing MOZ_TRY macros to a dedicated header file; r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D189226
2023-09-28 20:46:07 +00:00
Valentin Gosu
cdd5195292 Bug 1848694 - Remove/avoid global references to nsIIOService r=mccr8,necko-reviewers,kershaw
This patch removes the static pointer to nsIIOService in nsContentUtils,
replacing it to calls to mozilla::components::IO::Service.

It also makes nsScriptSecurityManager::sIOService a StaticRefPtr.

Differential Revision: https://phabricator.services.mozilla.com/D188714
2023-09-22 12:49:44 +00:00
Sandor Molnar
a8db14100e Backed out changeset b858a0740582 (bug 1848694) for causing build bustages on dom/base/Element.cpp CLOSED TREE 2023-09-21 16:45:57 +03:00
Valentin Gosu
e058782d44 Bug 1848694 - Remove/avoid global references to nsIIOService r=mccr8,necko-reviewers,kershaw
This patch removes the static pointer to nsIIOService in nsContentUtils,
replacing it to calls to mozilla::components::IO::Service.

It also makes nsScriptSecurityManager::sIOService a StaticRefPtr.

Differential Revision: https://phabricator.services.mozilla.com/D188714
2023-09-21 12:39:20 +00:00
Markus Stange
fd848139b8 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
60a2550611 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
d16387d4ae 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
c37791a4a6 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
2e483535e5 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
18854ff8b5 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
3e9e56e2c8 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
22262b6f58 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
8f723e6f67 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
5cb777c583 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
923687f881 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
656774ad42 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
9b0941d691 Backed out changeset c309e9b48aec (bug 1824121) for causing element related mochitest failures. CLOSED TREE 2023-08-07 16:05:13 +03:00
CanadaHonk
7063dd9162 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
4fe5a9c651 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
28aa899942 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
24e7457734 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
0f87fa519a 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
64645ecc84 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
5beede8d62 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
c449c830ae 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
529c9ee321 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
a1007b18c6 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
f54a728824 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
a28183ac0e 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