This reverts commit d46abe6d76.
Revert "Bug 1981346 - Add referenceTarget support for the form attribute. r=credential-management-reviewers,webidl,dimi,Jamie,smaug"
This reverts commit df11a4666d.
Revert "Bug 1981345 - Implement referenceTarget support for multiple element attributes. r=dom-core,Jamie,smaug"
This reverts commit 89cc779f5e.
Revert "Bug 1984685 - Refactor: consistently return Maybe<nsTArray<RefPtr<Element>>> when getting attr-associated elements, and key AttrRelProviders on nsAtom rather than nsString. r=dom-core,morgan,Jamie,smaug"
This reverts commit 33130e712d.
Revert "Bug 1981344 - Implement referenceTarget support for single-element attributes. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,emilio,keithamus,smaug,mtigley"
This reverts commit d6440c4cae.
Revert "Bug 1983766 - Split single element attribute getters into bindings/internals versions. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,smaug,keithamus,jwatt,mtigley"
This reverts commit 83b70e0645.
Revert "Bug 1989323 - Make `referenceTarget` IDL attributes on ShadowRoot, HTMLTemplateElement and ShadowRootInit nullable. r=dom-core,webidl,saschanaz,smaug"
This reverts commit 3a0b29121e.
This reverts commit 1b5cf4cdf8.
Revert "Bug 1981346 - Add referenceTarget support for the form attribute. r=credential-management-reviewers,webidl,dimi,Jamie,smaug"
This reverts commit 2394d9205a.
Revert "Bug 1981345 - Implement referenceTarget support for multiple element attributes. r=dom-core,Jamie,smaug"
This reverts commit 571a17ff82.
Revert "Bug 1984685 - Refactor: consistently return Maybe<nsTArray<RefPtr<Element>>> when getting attr-associated elements, and key AttrRelProviders on nsAtom rather than nsString. r=dom-core,morgan,Jamie,smaug"
This reverts commit 3b389fdd62.
Revert "Bug 1981344 - Implement referenceTarget support for single-element attributes. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,emilio,keithamus,smaug,mtigley"
This reverts commit 5cc2a12756.
Revert "Bug 1983766 - Split single element attribute getters into bindings/internals versions. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,smaug,keithamus,jwatt,mtigley"
This reverts commit 68e2d26aa9.
Revert "Bug 1989323 - Make `referenceTarget` IDL attributes on ShadowRoot, HTMLTemplateElement and ShadowRootInit nullable. r=dom-core,webidl,saschanaz,smaug"
This reverts commit 1234b31599.
This now uses an EnumTable rather than custom code, which simplifies the
logic while also enabling case insensitivity for the enumerated values.
Differential Revision: https://phabricator.services.mozilla.com/D256015
This refactoring aligns the button activation behaviour to the exact
steps specified in HTML, which has some small changes from the prior
implementation:
- button activation returns early after submitting, or resetting, not
triggering popovers or command/commandfor.
- buttons with form owners and a type attribute in the Auto state must
return early, not triggering popovers or command/commandfor.
This also has some other non-observable changes to the code:
- collapses the HandleCommandForAction method directly into
ActivationBehavior.
- adds code comments for each of the spec steps
Differential Revision: https://phabricator.services.mozilla.com/D254715
This reverts commit d33dcda2c6.
Revert "Bug 1950338 - Part 8: Rename invoketarget->commandfor, invokeaction->command r=webidl,devtools-reviewers,nchevobbe,smaug"
This reverts commit 0fe8930d32.
Revert "Bug 1950338 - Part 7: Move command&commandfor logic to HTMLButtonElement r=smaug"
This reverts commit 5a9255cd0b.
Revert "Bug 1950338 - Part 6: Rename invoker functions to command functions r=dom-core,masayuki"
This reverts commit 76f840a55a.
Revert "Bug 1950338 - Part 5: Remove InvokeEvent, migrate .invoker to CommandEvent .source r=webidl,devtools-reviewers,nchevobbe,emilio,smaug"
This reverts commit f7d2727969.
Revert "Bug 1950338 - Part 4: Move invokeTargetElement, invokeAction to HTMLButtonElement IDL r=webidl,smaug"
This reverts commit a7a025a843.
Revert "Bug 1950338 - Part 3: Expose CommandEvent in commandfor pref; move from chrome-webidl to webidl r=webidl,emilio"
This reverts commit eb133a45e6.
Revert "Bug 1950338 - Part 2: Move invokers meta ini to correct directory r=dom-core,sefeng"
This reverts commit face866adb.
Revert "Bug 1950338 - Part 1: Rename `dom.element.invokers` flag to `dom.element.commandfor` r=webidl,devtools-reviewers,nchevobbe,smaug"
This reverts commit 532bb887b5.
This doesn't change behavior on its own, but it's likely we want to make
the tab focusability more complicated in bug 1895184, and this will make
changes to this area less painful.
Differential Revision: https://phabricator.services.mozilla.com/D209525
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
Add a RAII helper to notify of multiple state changes together for
these.
The UpdateState CustomElementInternals calls that are getting removed
are unnecessary (the state should be up-to-date by then, there's nothing
changing there particularly).
Same for the call in nsGenericHTMLFormElement::UnbindFromTree. ClearForm
already does an state update.
Differential Revision: https://phabricator.services.mozilla.com/D187033
ParseAttribute ideally would be const (see bug 1829138), but the SVG and
SMIL code is rather messy. Still, now that BeforeSetAttr can't really
fail, swapping the order of ParseAttribute and BeforeSetAttr shouldn't
really change behavior.
Sorry for the extra `virtual` keyword removal and such. I had to do this
one by hand unlike the dependent bugs, and I went a bit drive-by, lmk if
you want me to split those changes.
Differential Revision: https://phabricator.services.mozilla.com/D176086
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
rg BeforeSetAttr -l | xargs sed -i 's/nsresult BeforeSetAttr/void BeforeSetAttr/g'
rg ::BeforeSetAttr -l | xargs sed -i 's/nsresult \(.*\)::BeforeSetAttr/void \1::BeforeSetAttr/g'
Plus trivial fixes, plus clang-format.
The only meaningful changes are in nsXULElement::BeforeSetAttr. Two
things could fail:
chromemargin: I removed it because we don't use the parsed attribute any
other place than here:
https://searchfox.org/mozilla-central/rev/31f5847a4494b3646edabbdd7ea39cb88509afe2/dom/xul/ChromeObserver.cpp#136
And that deals just fine with it not being parsed.
usercontextid: We have a debug assertion that we don't dynamically change it.
I kept it but I don't think it's worth failing to set the attribute on release for that
Differential Revision: https://phabricator.services.mozilla.com/D176069
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
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
BindContext was going to have way more information at first, but then I realized
that most of the things I wanted to know were basically a flag away using the
parent node.
Still I think it's worth it, now experimenting with BindToTree will only mean
adding a field to a struct that's included from a couple cpp files, instead of a
massive pain.
I also think this is clearer, and doing this highlights quite a few
inconsistencies in our code which I've left untouched, but commented with
FIXMEs.
Steps are:
$ for file in $(rg 'nsresult BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's#nsresult BindToTree(Document\* aDocument, nsIContent\* aParent,#nsresult BindToTree(BindContext\&, nsINode\& aParent)#g' $file; done
$ for file in $(rg 'nsresult BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's# nsIContent\* aBindingParent) override#override#g' $file; done
$ for file in $(rg '::BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's#::BindToTree(Document\* aDocument, nsIContent\* aParent,#::BindToTree(BindContext\& aContext, nsINode\& aParent)#g' $file; done
$ for file in $(rg '::BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's#nsIContent\* aBindingParent)##g' $file; done
$ for file in $(rg '::BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's#::BindToTree(aDocument, aParent, aBindingParent)#::BindToTree(aContext, aParent)#g' $file; done
$ ./mach clang-format
Then manual fixups.
Depends on D32948
Differential Revision: https://phabricator.services.mozilla.com/D32949
$ for file in $(rg UnbindFromTree | cut -d : -f 1 | sort | uniq); do sed -i 's#UnbindFromTree(bool aDeep = true,#UnbindFromTree(#g' $file; done
$ for file in $(rg UnbindFromTree | cut -d : -f 1 | sort | uniq); do sed -i 's#UnbindFromTree(bool aDeep,#UnbindFromTree(#g' $file; done
$ for file in $(rg UnbindFromTree | cut -d : -f 1 | sort | uniq); do sed -i 's#UnbindFromTree(aDeep,#UnbindFromTree(#g' $file; done
$ ./mach clang-format
And fix the two callers and little use of the aDeep argument (see the "Manual
changes" patch attached to bug).
Differential Revision: https://phabricator.services.mozilla.com/D32898
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.
Overall it's not a very interesting patch I think.
nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.
I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.
While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
Allow untrusted Events and Custom events to be dispatched at disabled form element. This is for interop and some developers have asked for this.
Differential Revision: https://phabricator.services.mozilla.com/D10000
Various places in dom/ use the pattern:
already_AddRefed<NodeInfo> ni = ...;
which is supposed to be disallowed by our static analysis code, but
isn't, for whatever reason. To fix our static analysis code, we need to
eliminate instances of the above pattern.
Unfortunately, eliminating this pattern requires restructuring how Nodes
are created. Most Node subclasses take `already_AddRefed<NodeInfo>&` in
their constructors, and a few accept `already_AddRefed<NodeInfo>&&`. We
need to enforce the latter pattern consistently, which requires changing
dozens of source files.
Since sed on multiple lines ended up being such a pain and I didn't end up
writing a script for this because I didn't think it'd end up being so boring, I
may have made a couple cleanups here and there as well...
Differential Revision: https://phabricator.services.mozilla.com/D2887
Mostly automatic via sed. Only parts which I touched manually (apart from a
couple ones where I fixed indentation or which had mispelled arguments) are the
callers. I may have removed a couple redundant `virtual` keywords as well when
I started to do it manually, I can revert those if wanted.
Most of them are just removing the argument, but in Element.cpp I also added an
assertion for GetBindingParent when binding the ShadowRoot's kids (the binding
parent is set from the ShadowRoot constructor, and I don't think we bind a
shadow tree during unlink or what not which could cause a behavior difference).
Differential Revision: https://phabricator.services.mozilla.com/D2574
MozReview-Commit-ID: 2oIgatty2HU