Commit Graph

226 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
1c58e2a928 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
8a7f413128 Bug 1770684 - Mark IMEStateManager::SetIMEState and its callers in IMEStateManager as MOZ_CAN_RUN_SCRIPT r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D147071
2022-05-26 04:37:21 +00:00
Kagami Sascha Rosylight
e433f95621 Bug 1768189 - Part 14: Apply modernize-concat-nested-namespaces to dom/html/HTMLTableCellElement.h ... r=andi
Depends on D145747

Differential Revision: https://phabricator.services.mozilla.com/D145748
2022-05-09 20:41:08 +00:00
Emilio Cobos Álvarez
22985336fb Bug 1709790 - Implement HTMLElement.outerText. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D136240
2022-01-19 12:49:29 +00:00
Kagami Sascha Rosylight
7ebc3f5a8e Bug 1539884 - Part 14: Mark nsGenericHTMLElement::Click/DispatchSimulatedClick as CAN_RUN_SCRIPT r=masayuki
Depends on D134104

Differential Revision: https://phabricator.services.mozilla.com/D134105
2021-12-17 13:27:51 +00:00
Edgar Chen
2d5e0fe078 Bug 1556370 - Part 2: Implement reportValidity() of ElementInternals; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D130287
2021-12-09 18:06:04 +00:00
somdatta
3e78dc40a6 Bug 1586014- Factor out RecompileScriptEventListeners r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D129974
2021-11-04 18:24:58 +00:00
Edgar Chen
601e4b79df Bug 1556352 - Part 2: Implement formAssociatedCallback; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D129197
2021-10-28 10:29:38 +00:00
Edgar Chen
e089ec0b48 Bug 1556363 - Part 3: Implement formDisabledCallback; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D129201
2021-10-25 20:43:11 +00:00
Edgar Chen
b7f93a5d5c Bug 1556351 - Part 9: Implement FACE upgrade; r=smaug
ElementInternal implements nsIFormControl and QueryInterface HTMLElement to a
nsIFormControl would return its associated ElementInternal instead.

Differential Revision: https://phabricator.services.mozilla.com/D125211
2021-10-04 20:51:28 +00:00
Edgar Chen
d39adb2dfd Bug 1556351 - Part 8: Make HTMLElement inherit nsGenericHTMLFormElement; r=smaug
And add checks in form codes to ensure they won't be run on HTMLElement that
isn't a FACE.

Differential Revision: https://phabricator.services.mozilla.com/D125210
2021-10-04 20:51:28 +00:00
Edgar Chen
90bc145869 Bug 1556351 - Part 7: Move mForm and mFieldSet to nsGenericHTMLFormControlElement; r=smaug
HTMLElement which will inherit nsGenericHTMLElement in subsequent part has its
own implementation for FACE.

Differential Revision: https://phabricator.services.mozilla.com/D124806
2021-10-04 20:51:28 +00:00
Edgar Chen
676c3f9fb8 Bug 1556351 - Part 6: Move IsAutofocusable to nsGenericHTMLFormControlElement; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D124805
2021-10-04 20:51:27 +00:00
Edgar Chen
4929cc1a94 Bug 1556351 - Part 5: Make nsGenericHTMLFormControlElement implement nsIFormControl; r=smaug
nsGenericHTMLFormElement doesn't implement nsIFormControl now as HTMLElement would
inherit it to be able to be added into HTMLFormElement and HTMLFieldSetElement and
support some common form feature.

So some places that call the nsIFormControl method on nsGenericHTMLFormElement
directly would need to queryInterface it to nsIFormControl first, this should be
fine as those places are not in a hot path.

Differential Revision: https://phabricator.services.mozilla.com/D124788
2021-10-04 20:51:27 +00:00
Edgar Chen
3d425ac03d Bug 1556351 - Part 4: Move methods that doesn't need to be used for FACE to nsGenericHTMLFormControlElement; r=smaug
This is basically just code movement, doesn't change any logic.
The only difference is that
- Make CanBeDisabled() and DoesReadOnlyApply() protected.
- Make CanBeDisabled() and DoesReadOnlyApply() virtual as FACE would have different
  implementation.

Differential Revision: https://phabricator.services.mozilla.com/D124787
2021-10-04 20:51:26 +00:00
Edgar Chen
92a1fc095f Bug 1556351 - Part 3: Rename nsGenericHTMLFormElementWithState to nsGenericHTMLFormControlElementWithState; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D124786
2021-10-04 20:51:26 +00:00
Edgar Chen
b5ebddd6e6 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
Makoto Kato
eabc28145c Bug 1731931 - More clean up IMEStateManager::SetIMEState. r=masayuki
Depends on D126574

Differential Revision: https://phabricator.services.mozilla.com/D126575
2021-09-27 12:41:40 +00:00
Edgar Chen
6e77be7384 Bug 1729358 - Part 3: Move GetFormAction to nsGenericHTMLFormElementWithState; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D124695
2021-09-07 09:47:10 +00:00
Edgar Chen
f967568415 Bug 1729358 - Part 2: Move RestoreState to nsGenericHTMLFormElementWithState; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D124694
2021-09-07 09:47:10 +00:00
Edgar Chen
cd1f327b86 Bug 1729358 - Part 1: Move FocusState to TextControlElement; r=smaug
And convert FocusTristate to enum class.

Differential Revision: https://phabricator.services.mozilla.com/D124693
2021-09-07 09:47:09 +00:00
Edgar Chen
65159a887b Bug 1728664 - Move IsDisabledForEvents out of nsIFormControl; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D124319
2021-09-02 13:26:09 +00:00
Edgar Chen
da8d018c08 Bug 1728537 - Part 2: Move RestoreState out of nsIFormControl; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D124180
2021-09-01 16:51:58 +00:00
Edgar Chen
3f6076d6b0 Bug 1728537 - Part 1: Move SaveState out of nsIFormControl; r=smaug
And make it return void as the return value isn't used at callsites.

Differential Revision: https://phabricator.services.mozilla.com/D124179
2021-09-01 16:51:58 +00:00
Edgar Chen
1e314a7ab1 Bug 1723010 - Part 2: Stop iterating to find next element for an accesskey once the accesskey has been processed; r=masayuki
even if the focus isn't changed.

Depends on D122787

Differential Revision: https://phabricator.services.mozilla.com/D122349
2021-08-20 19:32:43 +00:00
Edgar Chen
685690e0c7 Bug 1726393 - Part 2: Rename nsIFormControl::GetFormElement to GetForm; r=smaug
Depends on D122995

Differential Revision: https://phabricator.services.mozilla.com/D122996
2021-08-19 09:20:24 +00:00
Butkovits Atila
795d5635ff Backed out 2 changesets (bug 1723010) for causing mochitest failures on test_bug226361.xhtml. CLOSED TREE
Backed out changeset 62facfd599d0 (bug 1723010)
Backed out changeset 94c9836864cf (bug 1723010)
2021-08-18 16:10:07 +03:00
Edgar Chen
ddc4a77aa4 Bug 1723010 - Part 2: Stop iterating to find next element for an accesskey once the accesskey has been processed; r=masayuki
even if the focus isn't changed.

Depends on D122787

Differential Revision: https://phabricator.services.mozilla.com/D122349
2021-08-18 09:12:51 +00:00
Makoto Kato
df879c0ea1 Bug 1647596 - Make setting action hint simple. r=masayuki
This is follow up issue of implementing enterkeyhint attribute.

Differential Revision: https://phabricator.services.mozilla.com/D122407
2021-08-12 04:38:38 +00:00
Kagami Sascha Rosylight
e826dafcc0 Bug 1723050 - Part 14: Replace typedef by using in dom/html/ r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D121312
2021-08-09 13:37:27 +00:00
Masayuki Nakano
627e7c3853 Bug 1713758 - Make everyone outside editor module use EditorBase instead of TextEditor if the instance can be an HTMLEditor instance r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D117119
2021-06-09 23:51:37 +00:00
Emilio Cobos Álvarez
3daca083b1 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
Emilio Cobos Álvarez
d6aab62f2e Bug 1481400 - Don't dispatch a simulated click on keyup for default-prevented keydown. r=masayuki
I decided to go with a separate flag instead of reusing :active because
the :active handling WebKit uses for buttons is extremely weird: They
apply :active only to the button, not to the whole element chain like
mouse activeness does, and something like this keeps the :active state
in the button ~forever:

  <!doctype html>
  <style>
    :active { outline: 2px solid red; }
  </style>
  <button onkeyup="return false">ABC</button>

Differential Revision: https://phabricator.services.mozilla.com/D116585
2021-06-03 08:15:24 +00:00
Emilio Cobos Álvarez
680ad75223 Bug 1481400 - Centralize keyboard activation code. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D116584
2021-06-03 08:15:24 +00:00
Edgar Chen
e8d94d8206 Bug 1037709 - Part 1: Remove nsGenericHTMLElement::RegAccessKey/UnregAccessKey; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D110425
2021-04-01 17:52:39 +00:00
Emilio Cobos Álvarez
6ddc96e2db Bug 1700640 - Map width and height to aspect-ratio in <canvas>, <input type=image>, and <video>. r=boris
As per https://html.spec.whatwg.org/#attributes-for-embedded-content-and-images:

> The width and height attributes map to the aspect-ratio property on
> img, canvas, and video elements, and input elements with a type
> attribute in the Image Button state.

See https://github.com/whatwg/html/issues/6527 for the parsing issue
with canvas and zero. For now allow both behaviors in the tests.

We also remove the width-and-height-map-to-aspect-ratio pref, as it is
true everywhere and has been for a while.

Differential Revision: https://phabricator.services.mozilla.com/D109618
2021-03-24 22:18:55 +00:00
Edgar Chen
562263f785 Bug 1694674 - Unify nsXULElement::RegUnRegAccessKey and nsGenericHTMLElement::RegUnregAccessKey; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D109087
2021-03-19 23:26:21 +00:00
Emilio Cobos Álvarez
07e9744706 Bug 1699570 - Make mouse_focuses_formcontrol on chrome documents match the old behavior. r=mstange
For that, we make accessibility.mouse_focuses_formcontrol a static pref,
and make it work in all platforms because it's simpler and allows to
test mac-specific things on other platforms more easily.

Differential Revision: https://phabricator.services.mozilla.com/D109006
2021-03-18 23:01:45 +00:00
Edgar Chen
05d0b80d8b Bug 1686037 - Part 1: Move nsGenericHTMLElement::GetPresContext to Element; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D102321
2021-01-21 14:19:57 +00:00
Kagami Sascha Rosylight
57713cdf51 Bug 1680167 - Part 2: MOZ_CAN_RUN_SCRIPT in dom/html r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D98625
2020-12-03 22:15:56 +00:00
Simon Giesecke
5efd1faf25 Bug 1678062 - Remove unnecessary includes. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D97467

Depends on D96561
2020-11-23 16:12:02 +00:00
Simon Giesecke
ca547db942 Bug 1673931 - Avoid including Element.h from header files.
Differential Revision: https://phabricator.services.mozilla.com/D96535

Depends on D96534
2020-11-23 16:08:40 +00:00
Simon Giesecke
ab6f0a7137 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Makoto Kato
95b81668b2 Bug 1425291 - Part 1. Implement autocapitalize attribute. r=webidl,smaug
Virtual keyboard on Android (and API level of GTK) supports autocapitalization
that is automatically capitalize words and etc.

atucapitalize attribute inherits from form element if the element is button,
fieldset, input, output, select and textarea. Its tests are included in wpt.

WebKit on iOS and Blink on Android already support this HTML attribute, so I
would like to support this on Firefox/GeckoView Nightly.

Differential Revision: https://phabricator.services.mozilla.com/D86674
2020-09-15 14:33:27 +00:00
Emilio Cobos Álvarez
c82f3fdf39 Bug 1664685 - Simplify HTML{Image,Input}Element.{width,height} getters. r=edgar
By moving it to nsImageLoadingContent we don't need to pass a reference
to the current request and can just use the member.

The weird reference-passing was introduced in bug 987140 and broke in
bug 1534608.

Also make it return a CSSIntSize rather than an nsSize, since it's what
it returns, nsSize is supposed to be in app units, not in CSS pixels :-)

Differential Revision: https://phabricator.services.mozilla.com/D90036
2020-09-15 09:04:59 +00:00
Kagami Sascha Rosylight
85449cb17c Bug 1659028 - Move IsDisabled() from nsGeneralHTMLElement to Element r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D87022
2020-08-14 08:36:36 +00:00
Alexander Surkov
6f2ab69c5d Bug 1655722 - add HTMLElement::inert property r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D82943
2020-07-30 17:30:46 +00:00
Narcis Beleuzu
68bef387e7 Backed out 2 changesets (bug 921504) for wpt failures on inert-retargeting-iframe.tentative.html . CLOSED TREE
Backed out changeset 8b75cd744e80 (bug 921504)
Backed out changeset a56b2d354613 (bug 921504)
2020-07-22 23:53:55 +03:00
Alexander Surkov
463e1d51ba Bug 921504 - add HTMLElement::inert r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D82943
2020-07-21 15:33:48 +00:00
Narcis Beleuzu
4b8246ad9e Backed out 2 changesets (bug 921504) for mochitest failures on test_animation-type-longhand.html . CLOSED TREE
Backed out changeset e87edffd46b9 (bug 921504)
Backed out changeset eb53880e5f0e (bug 921504)
2020-07-20 17:37:32 +03:00