Commit graph

130 commits

Author SHA1 Message Date
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
abc0486620 Bug 1876702 - Remove unnecessary distinction between TYPE_FALLBACK and TYPE_NULL. r=smaug
The frame constructor always treats them the same nowadays
(TYPE_FALLBACK used to mean "show the pluginproblem code").

Differential Revision: https://phabricator.services.mozilla.com/D199719
2024-01-29 16:14:09 +00:00
Emilio Cobos Álvarez
2f666ebfd4 Bug 1875822 - Remove unused TYPE_FAKE_PLUGIN from nsObjectLoadingContent. r=dom-core,webidl,peterv,smaug
Bonus clean-up.

Differential Revision: https://phabricator.services.mozilla.com/D199271
2024-01-25 18:41:16 +00:00
Emilio Cobos Álvarez
f140e6c997 Bug 1875822 - nsObjectLoadingContent doesn't need to inherit from nsImageLoadingContent anymore. r=smaug
After bug 1875466, this is no longer needed and simplifies the code
quite a bit.

Differential Revision: https://phabricator.services.mozilla.com/D199252
2024-01-22 23:15:17 +00:00
Masayuki Nakano
4bb761eb3e 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
Emilio Cobos Álvarez
1258d560fb Bug 1850238 - Make BROKEN state non-intrinsic. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D187108
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
cbfc2b9552 Bug 1850238 - Make BROKEN state non-intrinsic. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D187108
2023-08-31 07:46:24 +00:00
Emilio Cobos Álvarez
6070e00f0a Bug 1850342 - Remove non-standard, un-tested :-moz-loading pseudo-class. r=layout-reviewers,jfkthame
This is technically web-exposed, but if we needed to introduce it for
compat we could always re-introduce it matching false.

Differential Revision: https://phabricator.services.mozilla.com/D186938
2023-08-30 10:38:52 +00:00
Iulian Moraru
9a9b90c906 Backed out changeset f0edb489e577 (bug 1850342) for causing dt failures on browser_rules_inactive_css_visited.js. CLOSED TREE 2023-08-30 01:24:44 +03:00
Emilio Cobos Álvarez
afdec6f2a3 Bug 1850342 - Remove non-standard, un-tested :-moz-loading pseudo-class. r=layout-reviewers,jfkthame
This is technically web-exposed, but if we needed to introduce it for
compat we could always re-introduce it matching false.

Differential Revision: https://phabricator.services.mozilla.com/D186938
2023-08-29 20:57:30 +00:00
Cosmin Sabou
5b129b77c5 Backed out changeset f14569b8319b (bug 1850342) for causing dt failures on browser_rules_inactive_css_visited.js. CLOSED TREE 2023-08-29 21:14:42 +03:00
Emilio Cobos Álvarez
286082f4f1 Bug 1850342 - Remove non-standard, un-tested :-moz-loading pseudo-class. r=layout-reviewers,jfkthame
This is technically web-exposed, but if we needed to introduce it for
compat we could always re-introduce it matching false.

Differential Revision: https://phabricator.services.mozilla.com/D186938
2023-08-29 16:56:37 +00:00
Natalia Csoregi
62728fe34c Backed out changeset b387df97a255 (bug 392994) for causing failures on test_interactive_content_in_label.html. CLOSED TREE 2023-07-19 09:19:56 +03:00
Jonathan Kingston
1018b9b1fe Bug 392994 - Remove support for usemap for Object and Input elements. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D182684
2023-07-19 05:22:06 +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
Emilio Cobos Álvarez
9ac32645f7 Bug 1837382 - Remove nsIContent::IsDoneAddingChildren. r=smaug
It's only called once for a place where it knows it's a select element.

Differential Revision: https://phabricator.services.mozilla.com/D180312
2023-06-08 14:59:31 +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
e3d2060438 Bug 1740989 - Implement focus fixup rule. r=smaug
This implements the proposal in the linked spec issue, and makes
it nightly-only pending resolution + edits.

Differential Revision: https://phabricator.services.mozilla.com/D155970
2022-09-01 11:28:47 +00:00
Iulian Moraru
c4572532eb Backed out changeset d8f983951128 (bug 1740989) for causing mochitest-chrome failures on test_modal_prompts.html. CLOSED TREE 2022-09-01 01:03:29 +03:00
Emilio Cobos Álvarez
c5ffe23435 Bug 1740989 - Implement focus fixup rule. r=smaug
This implements the proposal in the linked spec issue, and makes
it nightly-only pending resolution + edits.

Differential Revision: https://phabricator.services.mozilla.com/D155970
2022-08-31 17:10:17 +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
Masayuki Nakano
25a3c48305 Bug 1732845 - Add nsINode::IsInDesignMode() to check whether the node is directly in design mode r=smaug
There are a lot of check of `Document`'s editable state **with** comments. This
means that it's unclear for developers that only `Document` node is editable in
design mode.

Additionally, there are some points which use composed document rather than
uncomposed document even though the raw API uses uncomposed document. Comparing
with the other browsers, checking uncomposed document is compatible behavior,
i.e., nodes in shadow trees are not editable unless `contenteditable`.

Therefore, `nsINode` should have a method to check whether it's in design mode
or not.

Note that it may be called with a node in UA widget.  Therefore, this patch
adds new checks if it's in UA widget subtree or native anonymous subtree,
checking whether it's in design mode with its host.

Differential Revision: https://phabricator.services.mozilla.com/D126764
2021-10-12 03:14:43 +00:00
Edgar Chen
5ffd708a31 Bug 1556351 - Part 2: Add nsGenericHTMLFormControlElement; r=smaug
The end goal of this inheritance changes is,
- The common codes that could be shared between form-assciated custom elements
  (FACE) and other form-assciated elements would be left in nsGenericHTMLFormElement.
- The codes that doesn't require for FACE would be moved to nsGenericHTMLFormControlElement.
- The nsGenericHTMLFormControlElement would inherit the nsIFormControl instead.
- HTMLElement would inherit nsGenericHTMLFormElement in order to make it could be
  add into HTMLFormElement or HTMLFieldElement if it is a FACE.

This part is just a skeleton change, code movement and adjustment are in subsequent parts.

Differential Revision: https://phabricator.services.mozilla.com/D124785
2021-10-04 20:51:26 +00:00
Edgar Chen
af2f2867e6 Bug 1721349 - Move mSubmitter from HTMLFormSubmission to FormData and make it participate in cycle collection; r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D120334
2021-07-21 09:52:20 +00:00
Edgar Chen
b56843e83d Bug 1666184 - Defer loading object when setting attribute; r=nika
Differential Revision: https://phabricator.services.mozilla.com/D116819
2021-07-14 14:46:12 +00:00
Emilio Cobos Álvarez
2b0eae6061 Bug 1715134 - Make form control type an enum class. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D117087
2021-06-08 09:43:59 +00:00
David Parks
7a4e918916 Bug 1682030 - Clean up NPAPI plugin fallback behavior. r=jmathies,emilio
Similifies use of EventStates and ObjectType/FallbackType enums since most states they represented are no longer valid with the removal of NPAPI plugins.  The state machine for (unsupported) plugin elements is now much simpler but still distinguishes between HTML fallbacks, fallbacks leading to a "BROKEN" state (e.g. failing to load the image the element refers to), and fallbacks that would simply lead the element to occupy an empty region.  The last type of fallback is behind a pref "layout.use-plugin-fallback" and is disabled by default.

Simplifying the state machine allows us to clean up nsObjectLoadingContent.  We also update many of the enums which refered to plugins, which would otherwise get confusing.

Differential Revision: https://phabricator.services.mozilla.com/D107158
2021-04-06 19:28:18 +00:00
David Parks
cd6fd9bfe5 Bug 1682030 - Remove more dead NPAPI code from dom/plugins and related spots. r=jmathies,mconley,emilio
This is the second of two patches in this series that removes a large amount of now dead code from dom/plugins as part of removing all NPAPI plugin support.

Differential Revision: https://phabricator.services.mozilla.com/D107150
2021-04-06 19:28:15 +00:00
David Parks
4db3910bdb Bug 1682030 - Remove nsIPluginDocument. r=jmathies,emilio
Removes nsIPluginDocument and its implementation as part of removing all NPAPI plugin support.

Differential Revision: https://phabricator.services.mozilla.com/D107145
2021-04-06 19:28:13 +00:00
Csoregi Natalia
d68661e2cc Backed out 24 changesets (bug 1682030) for bustage on ProcessHangMonitor.cpp and nsCOMPtr.h. CLOSED TREE
Backed out changeset 5b1644096477 (bug 1682030)
Backed out changeset 35ae60eea3c7 (bug 1682030)
Backed out changeset 3eca76a6d639 (bug 1682030)
Backed out changeset 259c45447ad9 (bug 1682030)
Backed out changeset de9222dc8c31 (bug 1682030)
Backed out changeset 2986c7e14349 (bug 1682030)
Backed out changeset 6af3410bdb93 (bug 1682030)
Backed out changeset 42b0621c2927 (bug 1682030)
Backed out changeset 366e3e371858 (bug 1682030)
Backed out changeset 9adb2865adea (bug 1682030)
Backed out changeset 6af6af3bc03a (bug 1682030)
Backed out changeset da94a91b35ae (bug 1682030)
Backed out changeset 9143da258d0e (bug 1682030)
Backed out changeset 5e20d06952ba (bug 1682030)
Backed out changeset 6253d7e1ce7d (bug 1682030)
Backed out changeset 0e06ddeea3e2 (bug 1682030)
Backed out changeset 9c58d57c9e44 (bug 1682030)
Backed out changeset e90edd89430e (bug 1682030)
Backed out changeset 5861b8166b10 (bug 1682030)
Backed out changeset b4b88cdc7993 (bug 1682030)
Backed out changeset b80054e9805c (bug 1682030)
Backed out changeset 580d857674c0 (bug 1682030)
Backed out changeset a9cdf93c2662 (bug 1682030)
Backed out changeset 9c9c8b4998e2 (bug 1682030)
2021-04-06 03:54:12 +03:00
David Parks
ef8f5b1e09 Bug 1682030 - Clean up NPAPI plugin fallback behavior. r=jmathies,emilio
Similifies use of EventStates and ObjectType/FallbackType enums since most states they represented are no longer valid with the removal of NPAPI plugins.  The state machine for (unsupported) plugin elements is now much simpler but still distinguishes between HTML fallbacks, fallbacks leading to a "BROKEN" state (e.g. failing to load the image the element refers to), and fallbacks that would simply lead the element to occupy an empty region.  The last type of fallback is behind a pref "layout.use-plugin-fallback" and is disabled by default.

Simplifying the state machine allows us to clean up nsObjectLoadingContent.  We also update many of the enums which refered to plugins, which would otherwise get confusing.

Differential Revision: https://phabricator.services.mozilla.com/D107158
2021-04-05 23:48:42 +00:00
David Parks
30be5dc789 Bug 1682030 - Remove more dead NPAPI code from dom/plugins and related spots. r=jmathies,mconley,emilio
This is the second of two patches in this series that removes a large amount of now dead code from dom/plugins as part of removing all NPAPI plugin support.

Differential Revision: https://phabricator.services.mozilla.com/D107150
2021-04-05 23:48:39 +00:00
David Parks
aca228b08f Bug 1682030 - Remove nsIPluginDocument. r=jmathies,emilio
Removes nsIPluginDocument and its implementation as part of removing all NPAPI plugin support.

Differential Revision: https://phabricator.services.mozilla.com/D107145
2021-04-05 23:48:36 +00:00
Emilio Cobos Álvarez
2a1828662f Bug 1696507 - Remove support for NO_UNLINK version of cycle collector macros. r=smaug
And fix existing users of course.

The frame loader one is the only one slightly scary (but if it causes
trouble we could make nsObjectLoadingContent::Unlink a no-op).

Differential Revision: https://phabricator.services.mozilla.com/D107269
2021-03-10 19:50:40 +00:00
Mats Palmgren
b41a2b9d21 Bug 1687239 part 2 - Remove plugin support from layout/. r=emilio
Note that there's still a little plugin related code in
widget/ and gfx/ etc after this.  That can be removed
once we remove plugin support from dom/ etc.
The removal from layout/ should be pretty complete though.

Differential Revision: https://phabricator.services.mozilla.com/D102140
2021-01-25 11:53:49 +00:00
Masayuki Nakano
968d02a1a9 Bug 1683226 - part 12: Get rid of nsIWidget::SetPluginFocus() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D100386
2020-12-24 02:46:02 +00:00
Masayuki Nakano
d876b20aaa Bug 1683226 - part 2: Make HTMLEmbedElement and HTMLObjectElement stop overriding nsIContent::GetDesiredIMEState() r=smaug
Currently, they are never focusable when its type is "plugin".
So, making stop them returning `IMEEnabled::Plugin` won't change
anything, but it guarantees that nobody will see `IMEEnabled::Plugin`
at runtime.  This is a preparation for the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D100101
2020-12-21 05:52:26 +00:00
Masayuki Nakano
d27602eee6 Bug 1683226 - part 1: Make IMEState::Enabled an enum class r=m_kato,geckoview-reviewers
Before deleting `IMEState::Enabled::PLUGIN`, let's make it an enum class
for making the change safer.  Almost all of this change is done by
"replace" of VSCode.

Differential Revision: https://phabricator.services.mozilla.com/D100100
2020-12-21 05:52:03 +00:00
David Parks
3ad73d34d7 Bug 1675349: Forbid elements representing blocked plugins from accepting focus r=jmathies
As part of the fallback for unsupported plugin elements, we deny them focus.  Since elements can be programmatically changed, and object/embed elements can change internal "type" by updating their data/src attributes, and because that type is decided asynchronously, we may need to give up focus if our element has it.

Differential Revision: https://phabricator.services.mozilla.com/D95903
2020-11-18 15:55:52 +00:00
Bogdan Tara
56346a0425 Backed out 19 changesets (bug 1675349) for lint failures on browser_ext_browsingData_pluginData and test_archive CLOSED TREE
Backed out changeset 244e0f2b410c (bug 1675349)
Backed out changeset ba5724069dd4 (bug 1675349)
Backed out changeset 37fca259c7e9 (bug 1675349)
Backed out changeset f2b16caca1fc (bug 1675349)
Backed out changeset 28835d4935be (bug 1675349)
Backed out changeset eb913f58953a (bug 1675349)
Backed out changeset 19e3cb80f469 (bug 1675349)
Backed out changeset d9723f3a3a7e (bug 1675349)
Backed out changeset c888dfcdf70e (bug 1675349)
Backed out changeset 48f153341af6 (bug 1675349)
Backed out changeset 7fc67a9b2932 (bug 1675349)
Backed out changeset 1cee4d97f801 (bug 1675349)
Backed out changeset 59a0cb79c7c1 (bug 1675349)
Backed out changeset 43d349fa37b1 (bug 1675349)
Backed out changeset c84bfb6eae59 (bug 1675349)
Backed out changeset 38e9af69ae57 (bug 1675349)
Backed out changeset 3255c1ab3059 (bug 1675349)
Backed out changeset 2f3eaf9c342c (bug 1675349)
Backed out changeset 769e5c0db4c2 (bug 1675349)
2020-11-18 06:06:36 +02:00
David Parks
3c0d56e32c Bug 1675349: Forbid elements representing blocked plugins from accepting focus r=jmathies
As part of the fallback for unsupported plugin elements, we deny them focus.  Since elements can be programmatically changed, and object/embed elements can change internal "type" by updating their data/src attributes, and because that type is decided asynchronously, we may need to give up focus if our element has it.

Differential Revision: https://phabricator.services.mozilla.com/D95903
2020-11-18 03:04:02 +00:00
Sylvestre Ledru
fde06f6d21 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 17:04:01 +00:00
Butkovits Atila
964cca3198 Backed out changeset c0adbf7522dc (bug 1674637) for bustage on GMPParent.cpp. CLOSED TREE 2020-11-04 10:54:36 +02:00
Sylvestre Ledru
5f29324f60 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 08:29:00 +00:00
Edgar Chen
797c3c86a1 Bug 1608501 - Part 2: Rename nsObjectLoadingContent::DestroyContent to ::Destroy; r=smaug
Depends on D82729

Differential Revision: https://phabricator.services.mozilla.com/D84341
2020-07-21 16:11:29 +00:00
Edgar Chen
e10324adb1 Bug 1608501 - Part 1: Rename nsImageLoadingContent::DestroyImageLoadingContent to ::Destroy; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D82729
2020-07-21 12:08:14 +00:00
Timothy Gu
6407f13ce3 Bug 1628500 - Remove aIgnoreTabindex argument from Element::IsInteractiveHTMLContent(). r=edgar
This argument is set to true everywhere, and soon HTML will no longer consider
tabindex for interactive content: https://github.com/whatwg/html/pull/5457.

Differential Revision: https://phabricator.services.mozilla.com/D72568
2020-04-28 11:22:32 +00:00