Commit Graph
87 Commits
Author SHA1 Message Date
Daniel Holbert 648f3a95c5 Bug 2044510: Pass already_AddRefed types by-value instead of by rvalue reference, in dom/html. r=dom-core-reviewers,smaug
Differential Revision: https://phabricator.services.mozilla.com/D304360
2026-06-05 21:06:40 +00:00
Jan-Niklas Jaeschke 64079ed7ab Bug 1974784 - Customizable Select: Support options inside wrapper elements. r=emilio
Extends the option list, disabled state, and optgroup notification logic to
handle options nested inside wrapper elements (e.g. <div> inside <select>),
per the spec's "list of options" and "concept-option-disabled" algorithms.

Differential Revision: https://phabricator.services.mozilla.com/D290555
2026-06-03 19:06:13 +00:00
Jan-Niklas Jaeschke 03b7ff43b3 Bug 2038588 - Customizable Select: Implement selectedcontent update machinery. r=emilio
Implements the algorithms that keep <selectedcontent> elements in sync with
the selected <option>: RunSelectednessSettingAlgorithm (replaces
CheckSelectSomething), ScheduleSelectedContentUpdate /
UpdateDescendantSelectedContentElements (microtask-based), per-element
CloneOptionIntoSelectedContent, and HTMLSelectedContentElement BindToTree
disabled computation per PR #12263.

Differential Revision: https://phabricator.services.mozilla.com/D290554
2026-06-03 19:06:11 +00:00
Alexandru Marc 244264d460 Revert (Bug 1974784, Bug 2038588) for causing wpt failures @ options-length-too-large.html
This reverts commit f8f9651896.

Revert "Bug 2038588 - Customizable Select: Implement selectedcontent update machinery. r=emilio"

This reverts commit 0d1eba0a10.
2026-06-02 15:29:25 +00:00
Henri Sivonen d13776d321 Bug 2038124 - Optimize setting attributes on non-custom HTML elements from parser. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D302276
2026-06-02 09:12:39 +00:00
Alexandru Marc 16e384440d Revert "Bug 2038124 addendum - Simplify the attribute holder in the HTML parser. r=smaug" for causing build bustages @ Element.cpp
This reverts commit 82b2e13b45.

Revert "Bug 2038124 - Optimize setting attributes on non-custom HTML elements from parser. r=smaug"

This reverts commit 2d1ee1cd69.
2026-06-02 07:41:40 +00:00
Henri Sivonen 2d1ee1cd69 Bug 2038124 - Optimize setting attributes on non-custom HTML elements from parser. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D302276
2026-06-02 07:07:26 +00:00
Atila Butkovits d68e85e91d Revert "Bug 2038124 addendum - Simplify the attribute holder in the HTML parser. r=smaug" for causing bustages at Element.cpp.
This reverts commit 9dd3f6b595.

Revert "Bug 2038124 - Optimize setting attributes on non-custom HTML elements from parser. r=smaug"

This reverts commit b1774ce65e.
2026-06-01 21:47:14 +00:00
Henri Sivonen b1774ce65e Bug 2038124 - Optimize setting attributes on non-custom HTML elements from parser. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D302276
2026-06-01 20:50:16 +00:00
Jan-Niklas Jaeschke f8f9651896 Bug 1974784 - Customizable Select: Support options inside wrapper elements. r=emilio
Extends the option list, disabled state, and optgroup notification logic to
handle options nested inside wrapper elements (e.g. <div> inside <select>),
per the spec's "list of options" and "concept-option-disabled" algorithms.

Differential Revision: https://phabricator.services.mozilla.com/D290555
2026-06-01 12:55:52 +00:00
Jan-Niklas Jaeschke 0d1eba0a10 Bug 2038588 - Customizable Select: Implement selectedcontent update machinery. r=emilio
Implements the algorithms that keep <selectedcontent> elements in sync with
the selected <option>: RunSelectednessSettingAlgorithm (replaces
CheckSelectSomething), ScheduleSelectedContentUpdate /
UpdateDescendantSelectedContentElements (microtask-based), per-element
CloneOptionIntoSelectedContent, and HTMLSelectedContentElement BindToTree
disabled computation per PR #12263.

Differential Revision: https://phabricator.services.mozilla.com/D290554
2026-06-01 12:55:50 +00:00
Sylvestre Ledru d2ee2c8fb9 Bug 2036402 - Apply std::move in dom/html where values can be moved instead of copied r=dom-core,firefox-svg-reviewers,smaug,longsonr
Differential Revision: https://phabricator.services.mozilla.com/D298099
2026-05-04 15:16:20 +00:00
Emilio Cobos Álvarez b9a0d71900 Bug 2034055 - Make HTMLOptionsCollection use nsContentList. r=dom-core,smaug
Make nsIHTMLCollection the first base for nsContentList and co, since
it's needed for WebIDL bindings to work properly and shouldn't change
behavior in practice.

Move the handling of selected option and validity to HTMLSelectElement's
mutation observer.

Differential Revision: https://phabricator.services.mozilla.com/D295818
2026-04-28 07:38:24 +00:00
agoloman 8d40053465 Revert "Bug 2034055 - Make HTMLOptionsCollection use nsContentList. r=dom-core,smaug" for causing failures @nsContentList.cpp.
This reverts commit fd37a5a8cb.
2026-04-28 06:17:53 +00:00
Emilio Cobos Álvarez fd37a5a8cb Bug 2034055 - Make HTMLOptionsCollection use nsContentList. r=dom-core,smaug
Make nsIHTMLCollection the first base for nsContentList and co, since
it's needed for WebIDL bindings to work properly and shouldn't change
behavior in practice.

Move the handling of selected option and validity to HTMLSelectElement's
mutation observer.

Differential Revision: https://phabricator.services.mozilla.com/D295818
2026-04-27 23:07:56 +00:00
Sylvestre Ledru 9eb1a31a98 Bug 2023419 - Remove Emacs/Vim modelines from dom/ r=emilio,media-playback-reviewers,webidl,padenot
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287843
2026-03-16 21:02:32 +00:00
Emilio Cobos Álvarez 4021464773 Bug 2011709 - Make combobox select use a shadow tree for its contents. r=jjaschke,layout-reviewers,firefox-style-system-reviewers,accessibility-platform-reviewers,smaug,Jamie,jfkthame,dshin
For now, replicate the label + icon structure.

Use pseudo-elements for them. We could use select.css instead, but we
need a way to to prevent the display fix-up from applying (this is
needed because otherwise <select style=display:flex> starts getting the
label and button on different lines), and pseudo-elements is easier.

Use a <span> for the icon since we basically otherwise have a hidden,
unfocusable button and it simplifies the styling that way.

Use the same for the input file content since it simplifies the logic on
the frame constructor.

nsListControlFrame gets some clean-up as well since I was trying to make
sense of nsISelectFrame, but I could split that out if needed.

Tests for bug 323656 fail now because it tests explicit inheritance from
the <select> to the <option>, and now that goes through a <slot>.

Other elements have the same issue, see
https://github.com/whatwg/html/issues/3748. So for now remove those
tests.

Differential Revision: https://phabricator.services.mozilla.com/D280041
2026-02-03 14:33:36 +00:00
Alice Boxhall d5493de262 Bug 1981346 - Add referenceTarget support for the form attribute. r=credential-management-reviewers,webidl,dimi,Jamie,smaug
This change adds attr-associated element observers, which observe changes in the element associated with a single-element attribute.
For example, if an element has an attribute |attr| with a value |value|, and an AttrTargetObserver has been added for |attr| on that element, the observer would fire if an element with an ID matching |value| was added to the element's document or shadow root.

Attr-associated element observers are tracked in mAttrElementObserverMap in an element's nsExtendedDOMSlots.

An attr-associated element can change in multiple ways:
- The attribute value changes;
- An element matching the content attribute value is added or removed from the element's document or shadow root;
- The explicitly-set attr element is added or removed from the element's document or shadow root;
- The resolved reference target for the explicitly set attr-element or the element whose ID matches the string value of the attribute changes.

The resolved reference target can likewise change in multiple ways:
- The referenceTarget property of the element's shadow root is added, changed or removed;
- An element whose ID matches the element's shadow root's referenceTarget value is added or removed from the shadow root;
- The resolved reference target of the element whose ID matches the shadow root's referenceTarget value changes.

These changes are tracked via reference target change observers, which observe changes to an element's resolved reference target.
Reference target change observers are added on the host element's document or shadow root, and fired when one of the above circumstances occurs.

Differential Revision: https://phabricator.services.mozilla.com/D261367
2026-01-14 18:03:46 +00:00
Sandor Molnar 8faede9a1f Revert "Bug 1981349 - Add referenceTarget support for label/for, label wrapped and output/for. r=credential-management-reviewers,webidl,dimi,Jamie,smaug" for causing accessibility crashes (bug 2008970)
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.
2026-01-07 16:08:51 +00:00
Alice Boxhall df11a4666d Bug 1981346 - Add referenceTarget support for the form attribute. r=credential-management-reviewers,webidl,dimi,Jamie,smaug
This change adds attr-associated element observers, which observe changes in the element associated with a single-element attribute.
For example, if an element has an attribute |attr| with a value |value|, and an AttrTargetObserver has been added for |attr| on that element, the observer would fire if an element with an ID matching |value| was added to the element's document or shadow root.

Attr-associated element observers are tracked in mAttrElementObserverMap in an element's nsExtendedDOMSlots.

An attr-associated element can change in multiple ways:
- The attribute value changes;
- An element matching the content attribute value is added or removed from the element's document or shadow root;
- The explicitly-set attr element is added or removed from the element's document or shadow root;
- The resolved reference target for the explicitly set attr-element or the element whose ID matches the string value of the attribute changes.

The resolved reference target can likewise change in multiple ways:
- The referenceTarget property of the element's shadow root is added, changed or removed;
- An element whose ID matches the element's shadow root's referenceTarget value is added or removed from the shadow root;
- The resolved reference target of the element whose ID matches the shadow root's referenceTarget value changes.

These changes are tracked via reference target change observers, which observe changes to an element's resolved reference target.
Reference target change observers are added on the host element's document or shadow root, and fired when one of the above circumstances occurs.

Differential Revision: https://phabricator.services.mozilla.com/D261367
2026-01-06 16:16:26 +00:00
iulian moraru e162366a25 Revert "Bug 1981349, Bug 1981346, Bug 1981345, Bug 1984685, Bug 1981344, Bug 1983766, Bug 1989323 - Add referenceTarget support for label/for, label wrapped and output/for. r=credential-management-reviewers,webidl,dimi,Jamie,smaug" for causing android build bustages.
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.
2025-12-24 15:16:52 +00:00
Alice Boxhall 2394d9205a Bug 1981346 - Add referenceTarget support for the form attribute. r=credential-management-reviewers,webidl,dimi,Jamie,smaug
This change adds attr-associated element observers, which observe changes in the element associated with a single-element attribute.
For example, if an element has an attribute |attr| with a value |value|, and an AttrTargetObserver has been added for |attr| on that element, the observer would fire if an element with an ID matching |value| was added to the element's document or shadow root.

Attr-associated element observers are tracked in mAttrElementObserverMap in an element's nsExtendedDOMSlots.

An attr-associated element can change in multiple ways:
- The attribute value changes;
- An element matching the content attribute value is added or removed from the element's document or shadow root;
- The explicitly-set attr element is added or removed from the element's document or shadow root;
- The resolved reference target for the explicitly set attr-element or the element whose ID matches the string value of the attribute changes.

The resolved reference target can likewise change in multiple ways:
- The referenceTarget property of the element's shadow root is added, changed or removed;
- An element whose ID matches the element's shadow root's referenceTarget value is added or removed from the shadow root;
- The resolved reference target of the element whose ID matches the shadow root's referenceTarget value changes.

These changes are tracked via reference target change observers, which observe changes to an element's resolved reference target.
Reference target change observers are added on the host element's document or shadow root, and fired when one of the above circumstances occurs.

Differential Revision: https://phabricator.services.mozilla.com/D261367
2025-12-24 13:41:54 +00:00
Jan-Niklas Jaeschke 3c4c3d7c9a Bug 1951607 - nsFind should find <options> inside an <optgroup>. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D269163
2025-10-19 17:58:48 +00:00
Masayuki Nakano b2e5258254 Bug 769207 - part 5: Make Element::GetAttributeChangeHit() use AttrModType r=smaug,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D263056
2025-09-08 00:27:48 +00:00
Emilio Cobos Álvarez 791917d8af Bug 1976665 - Sort headers in dom/. r=dom-core,media-playback-reviewers,webrtc-reviewers,dom-storage-reviewers,padenot,janv,smaug,jesup,jib
Most changes are automated. Relevant bit is dom/.clang-format. I had to
manually disable clang-format in a few places where importing external
files and so on that aren't self-contained, and fix a couple includes /
forward declarations.

Differential Revision: https://phabricator.services.mozilla.com/D256800
2025-08-05 11:47:34 +00:00
Emilio Cobos Álvarez d25d53b6fc Bug 1909311 - Remove nsIFormControlFrame and nsITextControlFrame. r=masayuki,layout-reviewers,dholbert
It's a rather useless interface:

 * nsITextControlFrame is only implemented by nsTextControlFrame, so we
   can just use that.
 * nsIFormControlFrame had very few actual functionality, mostly
   scattered around:
    * SetFormProperty(select) was only useful for nsTextControlFrame.
    * SetFormProperty(value) was only called on file controls.
    * SetFocus() did mostly nothing, or things that can be done in
      ElementStateChanged instead.

There are some do_QueryFrame calls that I replaced for better checks in
font inflation and nsIFrame, but I'll adjust to preserve behavior if you
insist (it just such a somewhat-random check).

Differential Revision: https://phabricator.services.mozilla.com/D217322
2024-07-23 16:16:18 +00:00
Emilio Cobos Álvarez 7506fc5879 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 76e9b5e83c Bug 1850293 - Make CHECKED/DEFAULT states not intrinsic. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D186933
2023-08-30 09:18:31 +00:00
Emilio Cobos Álvarez 529c9ee321 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Olli Pettay 53ef1a4e52 Bug 1837522 - HTMLOptionElement text setter should not reuse textnode, r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D180394
2023-06-09 08:10:47 +00:00
Emilio Cobos Álvarez c1c1e7460b Bug 1829225 - Make BeforeSetAttr take the parsed nsAttrValue. r=smaug
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
2023-04-21 09:25:17 +00:00
Emilio Cobos Álvarez ded1458b5b 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 c881eb2941 Bug 1829189 - Make BeforeSetAttr infallible. r=smaug
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
2023-04-21 08:56:27 +00:00
Ben Freist a87769d277 Bug 1300405 - Fix insertion of already selected options r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D166955
2023-02-12 20:44:50 +00:00
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
Edgar Chen c791a38187 Bug 1728081 - Part 3: Merge nsIForm into HTMLFormElement; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D123951
2021-08-30 18:44:51 +00:00
Edgar Chen 492d02e96b Bug 1685421 - Part 2: Stop using NS_ERROR_DOM_HIERARCHY_REQUEST_ERR in nsINode; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D113344
2021-06-02 13:43:39 +00:00
Sylvestre Ledru 68b806d604 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 a6e7dcc53f Backed out changeset c0adbf7522dc (bug 1674637) for bustage on GMPParent.cpp. CLOSED TREE 2020-11-04 10:54:36 +02:00
Sylvestre Ledru 8f709b39e8 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
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
Jonathan Watt 3b22e68804 Bug 1634474. Make dom/html/ buildable outside of unified-build environment. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D73309
2020-05-04 14:29:02 +00:00
Chris H-C bd97e241a8 Bug 40545 - Options to use label attribute when present r=emilio,jfkthame,mats
According to spec, option elements with label attributes should show and use
those labels rather than their element text. So let's do that.

Requires some trickery because the option element is a block element (so it
lays out its width based on its text content) so we put its label (if it has
one) in its ::before and skip frame generation so it measures the text of its
label, not of its text node children.

Differential Revision: https://phabricator.services.mozilla.com/D63545
2020-04-06 16:06:36 +00:00
Gurzau Raul 7488b7888f Backed out changeset 813e1405e501 (bug 40545) for Android failures at test_bug659596.html on a CLOSED TREE. 2020-04-01 19:35:32 +03:00
Chris H-C b9fca9539f Bug 40545 - Options to use label attribute when present r=emilio,jfkthame,mats
According to spec, option elements with label attributes should show and use
those labels rather than their element text. So let's do that.

Requires some trickery because the option element is a block element (so it
lays out its width based on its text content) so we put its label (if it has
one) in its ::before and skip frame generation so it measures the text of its
label, not of its text node children.

Differential Revision: https://phabricator.services.mozilla.com/D63545
2020-04-01 09:20:21 +00:00
Sean Feng fbd3ec536a Bug 1377999 - Make TextNode to adapt the DOMArena changes r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D62353
2020-03-17 14:53:54 +00:00
Sean Feng e2b8b11349 Bug 1377999 - Make HTML Element to adapt the DOMArena changes r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D57699
2020-03-17 14:53:08 +00:00
Simon Giesecke 968040c445 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/html. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D63171
2020-02-20 16:19:15 +00:00
Emilio Cobos Álvarez a3b32df884 Bug 1555216 - Change the signature of BindToTree to be (BindContext&, nsINode& aParentNode). r=bzbarsky
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
2019-05-31 23:31:52 +02:00
Emilio Cobos Álvarez 9160cd2967 Bug 1555143 - Remove unused aDeep argument from UnbindFromTree. r=bzbarsky
$ 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
2019-05-28 22:47:08 +00:00