Commit Graph
287 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
Valentin Gosu f618d10405 Bug 2020765 - Make nsIURI.rs usable in rust r=necko-reviewers,kershaw
- Moves URIParams Serialization to a different interface
- Moves SizeOfIncludingThis to a different interface

Differential Revision: https://phabricator.services.mozilla.com/D285809
2026-05-12 07:55:54 +00:00
Leo Tenenbaum 6e962ab821 Bug 2035843 - Handle dom.image.sizes_auto.enabled changing while document is loaded. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D297666
2026-05-05 15:21:59 +00:00
Leo Tenenbaum 6a1f63851b Bug 2035571 - Disable sizes=auto temporarily in release/beta. r=emilio,firefox-style-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D297090
2026-04-28 20:06:37 +00:00
Leo TenenbaumandVincent Hilla 945274bbfc Bug 1819581 - Implement auto-sizes for lazy-loaded images. r=edgar,layout-reviewers,firefox-style-system-reviewers,emilio,vhilla
Co-authored-by: Vincent Hilla <[email protected]>

Differential Revision: https://phabricator.services.mozilla.com/D281911
2026-03-20 15:37:13 +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
serge-sans-paille b093ca6e20 Bug 2020581 - Replace copy assignment by move assignment in dom/ r=media-playback-reviewers,webrtc-reviewers,dom-worker-reviewers,dom-core,asuth,padenot,smaug,bwc
Commit automatically generated through clang-tidy's
performance-use-std-move new pass.

- Maybe type has a dedicated move operator
- And TimingParams also have a dedicated move operator because of Maybe
  members
- OwningAnimationTarget benefits from being moved
- nsCOMPtr benefits from being moved
- std::vector benefits from being moved
- std::string benefits from being moved
- SMILTimeValueSpecParams benefits from being moved

Differential Revision: https://phabricator.services.mozilla.com/D285674
2026-03-05 00:58:38 +00:00
Andreea Silaghi df905fef77 Revert "Bug 2020587 - Replace copy assignment by move assignment in xpcom/ r=xpcom-reviewers,jstutte" for causing failures at TestFileSystemHelpers This reverts commit d3c7b9c4d1.
This reverts commit 38c02da27e.
2026-03-04 08:20:03 +00:00
serge-sans-paille 38c02da27e Bug 2020581 - Replace copy assignment by move assignment in dom/ r=media-playback-reviewers,webrtc-reviewers,dom-worker-reviewers,dom-core,asuth,padenot,smaug,bwc
Commit automatically generated through clang-tidy's
performance-use-std-move new pass.

- Maybe type has a dedicated move operator
- And TimingParams also have a dedicated move operator because of Maybe
  members
- OwningAnimationTarget benefits from being moved
- nsCOMPtr benefits from being moved
- std::vector benefits from being moved
- std::string benefits from being moved
- SMILTimeValueSpecParams benefits from being moved

Differential Revision: https://phabricator.services.mozilla.com/D285674
2026-03-04 07:00:30 +00:00
Tooru Fujisawa 16cee5c6d8 Bug 2020099 - Part 1: Make HTMLImageElement.prototype.complete true for broken state. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D285400
2026-03-03 13:28:38 +00:00
Emilio Cobos Álvarez 968fc5a645 Bug 2015924 - Centralize lazyload checks, and observe only while in document. r=smaug
Now that stuff is a bit more complex and that we're adding media lazy
loading, factor the observer management down to Element.

Make UnbindContext more parallel to BindContext while at it. This
allows the new calls to work regardless of whether they get called
before or after the base class's Bind/UnbindFromTree, which is nice.

Differential Revision: https://phabricator.services.mozilla.com/D282723
2026-02-11 15:14:46 +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
Andrew McCreight 951b693098 Bug 2003652, part 2 - Add comments explaining why this nsIURI memory reporting doesn't cause double counting. r=emilio,jwatt
Differential Revision: https://phabricator.services.mozilla.com/D274857
2025-12-08 15:50:28 +00:00
Andrew McCreight bc71be21ec Bug 2003652, part 1 - Move the one nsISizeOf method into nsIURI. r=xpcom-reviewers,necko-reviewers,firefox-svg-reviewers,emilio,jesup,dholbert
Moving SizeOfIncludingThis from nsISizeOf to nsIURI makes using and
reasoning about this much easier.

When this nsIURI reporting was added in bug 682431, it was deliberately
added as a separate interface rather than on nsIURI. There's no explanation,
but that was in 2011 when compatibility for addons or whatever may have
been something they had to maintain. nsIURI has been changed a number of
times since 2015 without changing the UUID so I expect that isn't a
concern any more.

A few nsIURI subclasses get new SizeOfIncludingThis methods that don't
do anything, but we can fill these in if they show up on DMD reports.

Differential Revision: https://phabricator.services.mozilla.com/D274856
2025-12-08 15:50:25 +00:00
Andrew McCreight 64d037700e Bug 2003609, part 1 - Use nsISizeOf::SizeOfIncludingThis. r=emilio
These are pointers, so their `this` is not part of the current
object, so we need to call SizeOfIncludingThis. This looks like
a mixup during inlining in HTMLLinkElement that got copied by
the more recent uses.

Differential Revision: https://phabricator.services.mozilla.com/D274833
2025-12-03 13:55:52 +00:00
Jeff Muizelaar 9ded3da8be Bug 2002857 - Include the size of the url in Image elements. r=jwatt
This basically matches the behaviour of HTMLLinkElement.
It's important because there can be big data urls in images.

Differential Revision: https://phabricator.services.mozilla.com/D274339
2025-11-28 04:50:52 +00:00
Masayuki Nakano a27e993972 Bug 769207 - part 13: Get rid of MutationEvent r=smaug,dom-core,webidl
Differential Revision: https://phabricator.services.mozilla.com/D263064
2025-09-08 00:28:20 +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
longsonr 736b5b7ad6 Bug 1967531 - Unify SVG image and HTML image loading r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D251619
2025-06-24 19:25:36 +00:00
Cristina Horotan 43c1b60e40 Revert "Bug 1967531 - Unify SVG and HTML image loading r=emilio" on request by dholbert
This reverts commit 868b3de303.
2025-06-10 18:58:49 +00:00
longsonr 868b3de303 Bug 1967531 - Unify SVG and HTML image loading r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D251619
2025-06-01 09:25:56 +00:00
Daniel Holbert b5d8f25159 Bug 1965560 part 1: Move NaturalWidth() function from HTMLImageElement to its superclass nsImageLoadingContent.cpp. r=layout-reviewers,emilio
This patch doesn't change behavior; it's just moving this function from a
derived class to its superclass (because a later patch in this series will need
to call it from the superclass).

Differential Revision: https://phabricator.services.mozilla.com/D251985
2025-05-31 17:13:57 +00:00
Serban Stanca f7bd81420a Revert "Bug 1967531 - Unify SVG and HTML image loading r=emilio" for causing wpt failures in image-embedding-nesteder-data-url.html.
This reverts commit cc3e042e22.
2025-05-31 09:59:03 +00:00
longsonr cc3e042e22 Bug 1967531 - Unify SVG and HTML image loading r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D251619
2025-05-31 06:58:04 +00:00
Sylvestre Ledru 8ae54ea4f9 Bug 1519636 - Reformat recent changes to the Google coding style r=geckoview-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,nalexander,gstoll,tcampbell,janv,julienw
Updated with clang-format version 19.1.7 (taskcluster-DYvBxDZJRVqTi8E7pTSJAQ)

Differential Revision: https://phabricator.services.mozilla.com/D249880
2025-05-17 19:11:13 +00:00
Daniel Holbert 504aceae3c Bug 1965595: Change HTMLImageElement::NaturalSize return type to CSSIntSize. r=emilio
Before this patch, the return-type was nsIntSize, which is ambiguous about
units.

I'm switching to CSSIntSize because I believe the units are CSS Pixels. Note
that this function is essentially implementing the spec text at [1] which
includes an example that explicitly describes the result as "CSS Pixels". Also,
this function is analogous to nsImageLoadingContent::GetWidthHeightForImage()
which also returns CSSIntSize.  (And it's convenient to have those share the
same return type, because I'm planning to have these functions share more of
their internals in a later patch.)

[1] https://html.spec.whatwg.org/multipage/images.html#density-corrected-intrinsic-width-and-height

Differential Revision: https://phabricator.services.mozilla.com/D248674
2025-05-10 04:35:02 +00:00
Daniel Holbert 0a4181c58d Bug 1935269: Make HTMLImageElement::NaturalSize() fall back to the default 300x150 concrete object size instead of 0x0. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D248150
2025-05-09 03:37:39 +00:00
Daniel Holbert fd9ebf44e3 Bug 1965114 part 3: Use new imgIContainer intrinsicSize getter in place of width/height in a few places. r=tnikkel
This just demonstrates/tests proper use of the new API.

Differential Revision: https://phabricator.services.mozilla.com/D248527
2025-05-09 03:37:36 +00:00
longsonr e69829766c Bug 1847712 - support fetchpriority for SVG image, feImage and script elements r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D246863
2025-04-29 03:35:00 +00:00
Goloman Adrian 8262016029 Backed out changeset 63b702867240 (bug 1847712) for causing wpt failures @ttr-image-fetchpriority.html. CLOSED TREE 2025-04-28 12:41:32 +03:00
longsonr ef3debc812 Bug 1847712 - support fetchpriority for SVG image, feImage and script elements r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D246863
2025-04-28 08:19:38 +00:00
Emilio Cobos Álvarez 6e23ca21a0 Bug 1912115 - Fix conflict with bug 1789578.
MANUAL PUSH: Bustage fix CLOSED TREE
2024-08-11 18:12:29 +02:00
Emilio Cobos Álvarez 47d5fbefd0 Bug 1912115 - HTMLImageElement shouldn't be considered broken once a load task is ongoing. r=smaug
Clean-up some legacy nsImageLoadingContent state tracking while at it:

 * mLoading was not used to set ElementState anymore, and was only
   checked on the "loading" attribute handling, in what seems to be a
   poor man's way of preventing lazy loading to start once an image load
   is ongoing? However that should already be covered by the image load
   not being sync and checking mLazyLoad itself.

 * The depth tracking was unneeded, image notifications have been all
   async for ages.

Move some bools into nsImageLoadingContent to pack it better.

Differential Revision: https://phabricator.services.mozilla.com/D218971
2024-08-11 15:59:48 +00:00
Emilio Cobos Álvarez e38a772175 Bug 1789578 - Track responsive images not bound to a document. r=smaug
Either this or we need to make insertion a relevant mutation for srcset
as well...

Differential Revision: https://phabricator.services.mozilla.com/D218915
2024-08-11 15:55:51 +00:00
Norisz Fay b678d98104 Backed out changeset 57f6ebd3bfa9 (bug 1789578) for causing HTMLImageElement related wpt failures 2024-08-10 00:38:26 +03:00
Emilio Cobos Álvarez d8539460e7 Bug 1789578 - Track responsive images not bound to a document. r=smaug
Either this or we need to make insertion a relevant mutation for srcset
as well...

Differential Revision: https://phabricator.services.mozilla.com/D218915
2024-08-09 16:02:43 +00:00
Emilio Cobos Álvarez e9633ef6f4 Bug 1911605 - Make insertion into non-picture elements not a relevant mutation. r=smaug
This seems to be what Blink does in this case. Added some tests.

Differential Revision: https://phabricator.services.mozilla.com/D218570
2024-08-06 23:38:25 +00:00
Emilio Cobos Álvarez 20f8c8a6af Bug 1905646 - Don't trigger src="" load sync if there's no current request. r=smaug
Seems to match what other browsers do. Other browsers seem to fire
events at random some of the time tho, fun stuff as usual.

Differential Revision: https://phabricator.services.mozilla.com/D218603
2024-08-06 20:04:27 +00:00
Emilio Cobos Álvarez dd7e9f4a34 Bug 1076583 - Fix CSP tests regression from the previous patches. r=smaug
Add a way to override the JS calling location temporarily, and use it to
propagate it to the image load task.

Differential Revision: https://phabricator.services.mozilla.com/D218416
2024-08-05 12:23:45 +00:00
Emilio Cobos Álvarez bb2400428b Bug 1076583 - Make src attribute not load sync. r=smaug,extension-reviewers,devtools-reviewers,robwu,nchevobbe
This fixes src loads to be consistent with srcset/picture loads, modulo
the special synchronous case in the spec
(https://html.spec.whatwg.org/#update-the-image-data step 7), which
requires src loads to be sync if the image is available.

We now avoid triggering the load from the parser consistently for src /
srcset / picture, and unify the codepath with BindToTree. That should
avoid some useless task allocations.

Only the sync load code-path needs a script runner (mostly to deal with
anonymous content like the video poster <img> and such, but it also
helps not trigger sync loads at unexpected times like on adoption).

About the HTMLImageElement::Complete() getter change, we need to also
return false if there's an existing load task. That is the proposal in
https://github.com/whatwg/html/issues/4884, and prevents some failures
in the-img-element/{update-src-complete,img.complete}.html WPTs. It
technically changes our behavior on .srcset changes, but it makes it
consistent with .src changes and other browsers, so seems fine.

There are a couple regressions in CSP tests and the networkEvent stubs,
but these are really a pre-existing issue. What happens is that, since
the loads are now async, CSP can't figure out the script that triggered
the load anymore. I need to look if there's an easy way to propagate
that information in the image load tasks, but this is trivially
reproducible by changing these tests to use srcset rather than src.

The rest of the test changes are as expected: either new passes, or
expected test changes from this.

Differential Revision: https://phabricator.services.mozilla.com/D215519
2024-08-05 12:23:44 +00:00
Emilio Cobos Álvarez bf22d33f87 Bug 1895208 - Refactor IsFocusable checks to take flags rather than bool arguments. r=smaug
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
2024-05-06 21:54:37 +00:00
Emilio Cobos Álvarez 45b669a6a7 Bug 1036966 - Make accessibility.tabfocus default to 7 on macOS too. r=morgan,settings-reviewers,mac-reviewers,mstange
Stop supporting following the system preference, but keep macOS users
able to switch to just text controls (accessibility.tabfocus=1) in the
settings.

Change the meaning of the "Use the tab key to move focus between form
controls and links" checkbox in the Firefox settings, which was
introduced in bug 1628476 to override the system setting.

The intention, I think was that this checkbox being off resulted in
"follow the system" behavior, but that didn't quite happen due to a bug
in the preferences code (this[1] won't unset the pref, because of
this[2], which means we'll just return 0).

This patch changes it so that the checkbox instead always ignores the
system setting. There will no longer be a Firefox setting (neither in
the UI nor on about:config) that means "follow system setting".

This allows us to somewhat simplify the approach compared to the
previous patch in D196110, and keep the accessibility.tabfocus working
as the source of truth without a migration.

In the future, we can think of migrating accessibility.tabfocus to a
boolean pref, which would allow us to do the cleanups to the preferences
code that D196110 did.

[1]: https://searchfox.org/mozilla-central/rev/f1532761de0b60337e42c6c3f525288a523dabef/browser/components/preferences/main.js#2252
[2]: https://searchfox.org/mozilla-central/rev/f1532761de0b60337e42c6c3f525288a523dabef/toolkit/content/preferencesBindings.js#450,483

Differential Revision: https://phabricator.services.mozilla.com/D208602
2024-05-03 23:10:47 +00:00
Tamas Szentpeteri 453ac165cb Backed out changeset 644738c3ccfe (bug 1036966) for causing mochitest failures in test_tabindex.html. CLOSED TREE 2024-05-03 04:18:36 +03:00
Emilio Cobos Álvarez 87eeb156af Bug 1036966 - Make accessibility.tabfocus default to 7 on macOS too. r=morgan,settings-reviewers,mac-reviewers,mstange
Stop supporting following the system preference, but keep macOS users
able to switch to just text controls (accessibility.tabfocus=1) in the
settings.

Change the meaning of the "Use the tab key to move focus between form
controls and links" checkbox in the Firefox settings, which was
introduced in bug 1628476 to override the system setting.

The intention, I think was that this checkbox being off resulted in
"follow the system" behavior, but that didn't quite happen due to a bug
in the preferences code (this[1] won't unset the pref, because of
this[2], which means we'll just return 0).

This patch changes it so that the checkbox instead always ignores the
system setting. There will no longer be a Firefox setting (neither in
the UI nor on about:config) that means "follow system setting".

This allows us to somewhat simplify the approach compared to the
previous patch in D196110, and keep the accessibility.tabfocus working
as the source of truth without a migration.

In the future, we can think of migrating accessibility.tabfocus to a
boolean pref, which would allow us to do the cleanups to the preferences
code that D196110 did.

[1]: https://searchfox.org/mozilla-central/rev/f1532761de0b60337e42c6c3f525288a523dabef/browser/components/preferences/main.js#2252
[2]: https://searchfox.org/mozilla-central/rev/f1532761de0b60337e42c6c3f525288a523dabef/toolkit/content/preferencesBindings.js#450,483

Differential Revision: https://phabricator.services.mozilla.com/D208602
2024-05-02 22:19:53 +00:00
Frédéric Wang 0aa6bc1b77 Bug 1839313 - Add "fetchpriority" attribute to <img> element. r=smaug
This patch adds fetchpriority support for the `<img>` element, also
exposing the corresponding attribute in the WebIDL. As in D197493, we
try and minimize the change and rely on a mapping configurable under a
preference to ease future experiments. We use initial mapping
PRIORITY_LOW/PRIORITY_HIGH/PRIORITY_LOW for fetchpriority=low/high/auto
and allow further adjustments in the image code.

Internal fetchpriority mapping is covered by the following tests:
- `image-initial-load.h2.html` (typos fixed here)
- `image-dynamic-load.h2.html`

DOM tests are covered by the following tests (pref enabled to make them
pass):
- `idlharness.https.html`
- `attr-img-fetchpriority.html`

Differential Revision: https://phabricator.services.mozilla.com/D202222
2024-02-27 18:49:08 +00:00