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
This commit is contained in:
Emilio Cobos Álvarez
2022-06-07 23:09:52 +00:00
parent 0b0fd89a89
commit 1c58e2a928
172 changed files with 1243 additions and 1501 deletions

View File

@@ -27,7 +27,6 @@ namespace mozilla {
class EventChainPostVisitor;
class EventChainPreVisitor;
class EventStates;
class PresState;
namespace dom {
@@ -70,7 +69,7 @@ class HTMLTextAreaElement final : public TextControlElement,
virtual void FieldSetDisabledChanged(bool aNotify) override;
virtual EventStates IntrinsicState() const override;
virtual ElementState IntrinsicState() const override;
void SetLastValueChangeWasInteractive(bool);
@@ -218,7 +217,7 @@ class HTMLTextAreaElement final : public TextControlElement,
void SetReadOnly(bool aReadOnly, ErrorResult& aError) {
SetHTMLBoolAttr(nsGkAtoms::readonly, aReadOnly, aError);
}
bool Required() const { return State().HasState(NS_EVENT_STATE_REQUIRED); }
bool Required() const { return State().HasState(ElementState::REQUIRED); }
MOZ_CAN_RUN_SCRIPT void SetRangeText(const nsAString& aReplacement,
ErrorResult& aRv);