Commit Graph

208 Commits

Author SHA1 Message Date
serge-sans-paille
e54774d573 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-28 08:21:19 +00:00
Alexandru Marc
191ccbe7fe Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00
serge-sans-paille
53068cdf31 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 09:06:01 +00:00
Alexandru Marc
83543f20f2 Backed out changeset 448597bce69d (bug 1922838) for causing build bustages. CLOSED TREE 2024-10-24 11:37:49 +03:00
serge-sans-paille
c7a369b29a Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 07:38:30 +00:00
serge-sans-paille
737dee8ded Bug 1922563 - Reduce memory foot print of mozilla::dom::MathMLElement::MapGlobalMathMLAttributesInto()::values r=emilio
Use some kind of prefix table to avoid storing redundant string. Also
Avoid storing an array of enum when there's a direct mapping between
enum values and loop index.

This result in a reduction of 352 byte in the resulting binary, so this
may not be worth the effort, but it was great fun to write that patch.

Differential Revision: https://phabricator.services.mozilla.com/D224494
2024-10-14 19:46:41 +00:00
Butkovits Atila
807fdee6de Backed out changeset c518c29f1c31 (bug 1922563) for causing bustages at MathMLElement.cpp. CLOSED TREE 2024-10-14 20:36:15 +03:00
serge-sans-paille
9d69dc4c7d Bug 1922563 - Reduce memory foot print of mozilla::dom::MathMLElement::MapGlobalMathMLAttributesInto()::values r=emilio
Use some kind of prefix table to avoid storing redundant string. Also
Avoid storing an array of enum when there's a direct mapping between
enum values and loop index.

This result in a reduction of 352 byte in the resulting binary, so this
may not be worth the effort, but it was great fun to write that patch.

Differential Revision: https://phabricator.services.mozilla.com/D224494
2024-10-14 15:24:04 +00:00
pstanciu
55abcb2995 Backed out changeset 875fb891b6a9 (bug 1922563) for causing build bustages on MathMLElement.cpp CLOSED TREE 2024-10-14 15:11:22 +03:00
serge-sans-paille
430ae418b9 Bug 1922563 - Reduce memory foot print of mozilla::dom::MathMLElement::MapGlobalMathMLAttributesInto()::values r=emilio
Use some kind of prefix table to avoid storing redundant string. Also
Avoid storing an array of enum when there's a direct mapping between
enum values and loop index.

This result in a reduction of 352 byte in the resulting binary, so this
may not be worth the effort, but it was great fun to write that patch.

Differential Revision: https://phabricator.services.mozilla.com/D224494
2024-10-14 09:04:25 +00:00
Emilio Cobos Álvarez
f732f02a20 Bug 1922571 - Remove some unneeded use of compiler_specific.h outside of ipc. r=nika
We don't build with MSVC, so no need for any of this.

Differential Revision: https://phabricator.services.mozilla.com/D224503
2024-10-04 08:00:42 +00:00
Frédéric Wang
7701478779 Bug 1918308 - Remove dead code for legacy MathML color/background attributes. r=emilio
These attributes were deprecated in D43111, disabled in D89928 and
removed in D154087.

Differential Revision: https://phabricator.services.mozilla.com/D221990
2024-09-13 06:31:26 +00:00
Emilio Cobos Álvarez
6887add27f Bug 1899126 - Simplify text-transform representation. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D211731
2024-05-27 17:24:10 +00:00
Emilio Cobos Álvarez
3b42787268 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
5f05578314 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
38377227b8 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
06e782e1bf 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
6e94ca81e4 Bug 1883929 - Export test_math_tabindex_focus.html mochitest to WPT. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D203778
2024-03-06 19:09:35 +00:00
Emilio Cobos Álvarez
8925ee2d3d 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
633cce158c Bug 1868552 - Refactor nsIContent::IsFocusable for clarity. r=masayuki
Make it be output-only, not having that confusing in-out tab-index
parameter that is special for XUL to become focusable with
-moz-user-focus: normal. Instead, do that explicitly in
nsIFrame::IsFocusable().

Also, call it IsFocusableWithoutStyle(), since that's what it is.

Differential Revision: https://phabricator.services.mozilla.com/D195644
2023-12-08 11:34:06 +00:00
Stanca Serban
7e0c99b7ee Backed out 3 changesets (bug 1851970) for causing mochitests failures in browser_aboutNetError_csp_iframe.js.
Backed out changeset a2536c6c6c23 (bug 1851970)
Backed out changeset 23ddc229d1a1 (bug 1851970)
Backed out changeset b99a620a535c (bug 1851970)
2023-11-28 18:43:55 +02:00
Vincent Hilla
55400d97a2 Bug 1851970 - Part 2: Activation behavior method for links. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D183991
2023-11-28 14:09:02 +00:00
Tom Marble
faa34b0552 Bug 1855296 - convert .ini manifests to .toml: batch 9 dom/[m-s]**/mochitest.ini r=jmaher,media-playback-reviewers,alwu
Differential Revision: https://phabricator.services.mozilla.com/D189845
2023-10-03 19:35:22 +00:00
Emilio Cobos Álvarez
7855659a73 Bug 1850238 - Make Link states not intrinsic. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D186877
2023-08-30 09:18:32 +00:00
Emilio Cobos Álvarez
fb2d2a26f5 Bug 1850293 - Make INCREMENT_SCRIPT_LEVEL state non intrinsic. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D186894
2023-08-29 00:08:28 +00:00
Frederic Wang
f833c460e4 Bug 1847177 - Rewrite mochitests for MathML console message as WPT. r=emilio,flod
The warning message for deprecated math space values is tweaked a bit so
that the actual attribute value that triggered it is reported. This
provides correct message for 'negative*mathspace' values.

test_bug1845461.html, test_bug553917.html and test_bug827713-2.html are
rewritten as an internal testharness WPT test, with the following
modifications:

* Preferences are forced in the ini file, avoiding issues that happened
  in the past due to inconsistent values for Nightly and Beta.
  dom.use_components_shim is set to prevent the deprecation message for
  the Components object and confuse the test (bug 1845910).
  legacy_mathvariant_attribute and mathspace_names are disabled to
  to properly test deprecated mathvariant and math space values.

* Console messages are triggered inside an iframe, allowing to test
  multiple source codes for the same deprecation warning. In particular,
  all mathvariant and named space values are now tested.

* Helper testMessageForMarkup/testNoMessageForMarkup functions are
  introduced to easily test some markup and improve readability.
  The expected message is provided as a regexp argument for more
  flexibility and severity level (error or warning) is verified.

* It's not clear why the tests for InvalidChild don't test msup or why
  they use this specific number of children. Keep them but add new ones
  for msub/msub/msubsup with the usual number of children.

Differential Revision: https://phabricator.services.mozilla.com/D185399
2023-08-04 14:19:21 +00:00
Frederic Wang
abdcf26c27 Bug 1845461 - Add deprecation warning and use counter for deprecated mathvariant usages. r=emilio,flod
Differential Revision: https://phabricator.services.mozilla.com/D184561
2023-08-01 07:47:15 +00:00
Iulian Moraru
0ffa23bced Backed out changeset 9c19f2cfc93a (bug 1845461) for causing Bug 1845910. 2023-07-30 16:50:35 +03:00
Frederic Wang
0209ed8be9 Bug 1845461 - Add deprecation warning and use counter for deprecated mathvariant usages. r=emilio,flod
Differential Revision: https://phabricator.services.mozilla.com/D184561
2023-07-28 03:22:47 +00:00
Natalia Csoregi
4079a6e0f7 Backed out changeset b1b74e5913ac (bug 1845461) for causing failures on browser_misused_characters_in_strings.js. CLOSED TREE 2023-07-27 22:31:12 +03:00
Frederic Wang
e914187052 Bug 1845461 - Add deprecation warning and use counter for deprecated mathvariant usages. r=emilio,flod
Differential Revision: https://phabricator.services.mozilla.com/D184561
2023-07-27 17:24:45 +00:00
Frederic Wang
611cb127f5 Bug 1788605: Align scriptlevel's syntax on MathML Core. r=emilio
The ToInteger function is not very strict, so scriptlevel parsing
currently accepts invalid values like "+-1", "--1", "+z1", "+ 1",
"2.0", "-3\"" or "200px". To fix that, we perform an extra check
during parsing to ensure that the part after the optional leading
sign is really an <unsigned> number (string of digits).

This patch also fixes some issues in attribute-mapping-002.html
(previously attached attribute not removed, not handling
none/mprescripts specially, gather checks in one loop) and add
more test cases such as the ones mentioned above. The situation of
leading/trailing whitespace is unclear, so testing for things like
" +1" and "+1 " is ignored for now.

Differential Revision: https://phabricator.services.mozilla.com/D156160
2023-07-26 09:59:14 +00:00
Frederic Wang
9ad02dda76 Bug 1788637 - Remove MathML preferences scriptminsize_attribute and scriptsizemultiplier_attribute. r=emilio
This commit removes the runtime flags and related code for the
scriptminsize and scriptsizemultiplier, which have been disabled by
default for a while. The hardcoded default values
kMathMLDefaultScriptSizeMultiplier and kMathMLDefaultScriptMinSizePt
are still used in some places and are preserved for now.

Differential Revision: https://phabricator.services.mozilla.com/D157426
2023-07-24 10:02:24 +00:00
Frederic Wang
8343f88354 Bug 1821980: Align mathvariant implementation on MathML Core. r=emilio,jfkthame
In MathML Core, the recommendation is to directly use the proper
character from the Mathematical Alphanumeric Symbols instead of the
mathvariant attribute. The exception is for automatic italicization on
single-char `<mi>` element. This is implemented via a new text-transform
value "math-auto" [1] which is the default on the `<mi>` element. The
mathvariant attribute is now restricted to that element and to value
"normal" in order to force upright text instead [2]. This CL implements
this restriction together with that new text-transform value under the
mathml.legacy_mathvariant_attribute.disabled flag.

Some legacy MathML cases where math-auto alone does not work are
still handled via MathMLTextRunFactory.

[1] https://w3c.github.io/mathml-core/#new-text-transform-values
[2] https://w3c.github.io/mathml-core/#the-mathvariant-attribute

Differential Revision: https://phabricator.services.mozilla.com/D172395
2023-07-14 19:44:04 +00:00
Cristian Tuns
9f238811ed Backed out changeset db50582c2b9f (bug 1821980) for causing mochitest failures in browser_mathml.js CLOSED TREE 2023-07-14 13:49:13 -04:00
Frederic Wang
0a3179c31f Bug 1821980: Align mathvariant implementation on MathML Core. r=emilio,jfkthame
In MathML Core, the recommendation is to directly use the proper
character from the Mathematical Alphanumeric Symbols instead of the
mathvariant attribute. The exception is for automatic italicization on
single-char `<mi>` element. This is implemented via a new text-transform
value "math-auto" [1] which is the default on the `<mi>` element. The
mathvariant attribute is now restricted to that element and to value
"normal" in order to force upright text instead [2]. This CL implements
this restriction together with that new text-transform value under the
mathml.legacy_mathvariant_attribute.disabled flag.

Some legacy MathML cases where math-auto alone does not work are
still handled via MathMLTextRunFactory.

[1] https://w3c.github.io/mathml-core/#new-text-transform-values
[2] https://w3c.github.io/mathml-core/#the-mathvariant-attribute

Differential Revision: https://phabricator.services.mozilla.com/D172395
2023-07-14 15:53:34 +00:00
Iulian Moraru
68cbf5e276 Backed out changeset 6cceaca5e653 (bug 1821980) for causing multiple failures. CLOSED TREE 2023-07-14 15:41:31 +03:00
Frederic Wang
1e731ab03c Bug 1821980: Align mathvariant implementation on MathML Core. r=emilio,jfkthame
In MathML Core, the recommendation is to directly use the proper
character from the Mathematical Alphanumeric Symbols instead of the
mathvariant attribute. The exception is for automatic italicization on
single-char `<mi>` element. This is implemented via a new text-transform
value "math-auto" [1] which is the default on the `<mi>` element. The
mathvariant attribute is now restricted to that element and to value
"normal" in order to force upright text instead [2]. This CL implements
this restriction together with that new text-transform value under the
mathml.legacy_mathvariant_attribute.disabled flag.

Some legacy MathML cases where math-auto alone does not work are
still handled via MathMLTextRunFactory.

[1] https://w3c.github.io/mathml-core/#new-text-transform-values
[2] https://w3c.github.io/mathml-core/#the-mathvariant-attribute

Differential Revision: https://phabricator.services.mozilla.com/D172395
2023-07-14 10:52:59 +00:00
Emilio Cobos Álvarez
7bddcf9e5a Bug 1839223 - Remove nsMappedAttributes. r=smaug
Instead, lazily schedule evaluation of them before styling, much like we
were doing for SVG.

A subtle tweak is that we only remain scheduled while in the document.
This allows us to use the "in document" bit plus the "mapped attributes
dirty" bit to know our scheduled status. It also prevents doing silly
work for disconnected elements, and having to do hashmap lookups on
adoption and node destruction.

Differential Revision: https://phabricator.services.mozilla.com/D181549
2023-06-22 17:22:03 +00:00
Cristian Tuns
6957543e5e Backed out changeset a3e55d5f9f13 (bug 1839223) for causing multiple failures in Document.cpp CLOSED TREE 2023-06-22 11:34:15 -04:00
Emilio Cobos Álvarez
2c6de5f038 Bug 1839223 - Remove nsMappedAttributes. r=smaug
Instead, lazily schedule evaluation of them before styling, much like we
were doing for SVG.

A subtle tweak is that we only remain scheduled while in the document.
This allows us to use the "in document" bit plus the "mapped attributes
dirty" bit to know our scheduled status. It also prevents doing silly
work for disconnected elements, and having to do hashmap lookups on
adoption and node destruction.

Differential Revision: https://phabricator.services.mozilla.com/D181549
2023-06-22 14:31:16 +00:00
Emilio Cobos Álvarez
25b79c7b15 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
51758cfc9b 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
ee4c38a50c 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
Emilio Cobos Álvarez
39aeca9d9c Bug 1449669 - Remove IsNodeOfType. r=longsonr
Depends on D172893

Differential Revision: https://phabricator.services.mozilla.com/D172894
2023-03-17 19:22:14 +00:00
Adam Vandolder
151aa8e164 Bug 1575154 - Add autofocus attribute to HTMLOrForeignElement. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D163753
2022-12-19 15:09:15 +00:00
Narcis Beleuzu
6da804aed4 Backed out changeset 34ec63cced63 (bug 1575154) for causing wpt failures on idlharness.https.html . CLOSED TREE 2022-12-15 23:10:35 +02:00
Adam Vandolder
8a69b66390 Bug 1575154 - Add autofocus attribute to HTMLOrForeignElement. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D163753
2022-12-15 18:37:28 +00:00
sskcvqikf
c53abb7b6e Bug 1797012 - Change NS_STYLE_MATH_STYLE_* macros to enum StyleMathStyle. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160016
2022-10-24 17:47:34 +00:00
Marian-Vasile Laza
e80c0a7ce7 Backed out changeset f39d284f4db7 (bug 1797012) for causing wpt failures on frac-1.html. CLOSED TREE 2022-10-24 15:46:12 +03:00