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
ElementInternal implements nsIFormControl and QueryInterface HTMLElement to a
nsIFormControl would return its associated ElementInternal instead.
Differential Revision: https://phabricator.services.mozilla.com/D125211
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
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
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
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
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
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
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