194 Commits
Author SHA1 Message Date
Jonathan Kew 24130114c1 Bug 2045733 - Check for font support before using the capital es-zet (U+1E9E) in uppercase transform. r=layout-reviewers,emilio
And update reftests to check behavior both with and without U+1E9E in the font.

Differential Revision: https://phabricator.services.mozilla.com/D305199
2026-06-10 14:08:55 +00:00
serge-sans-paille d58c18b09a Bug 2030235 - Decouple ServoStyleConsts from nsGkAtoms.h r=emilio,necko-reviewers,geckoview-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,kershaw,m_kato
And remove unused includes of nsGkAtoms.h in the process. The few
dependencies have been moved to ServoStyleConstsInlines.h

The used command to remove the now unused dependency was:

git grep -l nsGkAtoms.h | while read line; do grep -v nsGkAtoms.h $line | grep -q -E '\<nsGkAtoms\>' || sed -i -e '/nsGkAtoms.h/d' $line  ; done

Differential Revision: https://phabricator.services.mozilla.com/D292697
2026-04-09 10:05:25 +00:00
Silaghi 81930b22ee Revert "Bug 2030235 - Decouple ServoStyleConsts from nsGkAtoms.h r=emilio,necko-reviewers,geckoview-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,kershaw,m_kato" for causing build bustages at style/nsStyleUtil
This reverts commit b97e69b590.
2026-04-09 08:09:15 +00:00
serge-sans-paille b97e69b590 Bug 2030235 - Decouple ServoStyleConsts from nsGkAtoms.h r=emilio,necko-reviewers,geckoview-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,kershaw,m_kato
And remove unused includes of nsGkAtoms.h in the process. The few
dependencies have been moved to ServoStyleConstsInlines.h

The used command to remove the now unused dependency was:

git grep -l nsGkAtoms.h | while read line; do grep -v nsGkAtoms.h $line | grep -q -E '\<nsGkAtoms\>' || sed -i -e '/nsGkAtoms.h/d' $line  ; done

Differential Revision: https://phabricator.services.mozilla.com/D292697
2026-04-09 06:41:33 +00:00
Sylvestre Ledru 55481ac4b5 Bug 2023419 - Remove Emacs/Vim modelines from layout/ r=emilio,firefox-style-system-reviewers,layout-reviewers
replaced by .editorconfig

Differential Revision: https://phabricator.services.mozilla.com/D287852
2026-03-17 12:05:43 +00:00
Jonathan Kew 35da0b7f0f Bug 2003721 - Convert GetCasingFor() in nsTextRunTransformations to use nsStyleUtil::MatchesLanguagePrefix. r=layout-reviewers,emilio
This doesn't change behavior, just cleans up the code a bit by using the
nsStyleUtil helper.

Differential Revision: https://phabricator.services.mozilla.com/D275280
2025-12-06 00:24:15 +00:00
iulian moraru 98714f708a Revert "Bug 2003721 - Convert GetCasingFor() in nsTextRunTransformations to use nsStyleUtil::MatchesLanguagePrefix. r=layout-reviewers,emilio" for causing multiple failures.
This reverts commit 33dfc6cf93.

Revert "Bug 2003721 - Slightly simplify intl::QuotesForLang, now that the lang tag in nsStyleFont is known to be canonicalized. r=layout-reviewers,emilio"

This reverts commit a876179e45.

Revert "Bug 2003721 - Add some tests for case-insensitivity of language tag matching. r=layout-reviewers,emilio"

This reverts commit c6b00b95bb.

Revert "Bug 2003721 - Rename 'kmr' hyphenation locale data to 'ku' to match canonicalized Locale code. r=layout-reviewers,emilio"

This reverts commit 7ef07f8cb4.

Revert "Bug 2003721 - Update reftests for language-dependent rendering with non-canonical lang tags. r=layout-reviewers,emilio"

This reverts commit 7a63ee4efd.

Revert "Bug 2003721 - Canonicalize lang-subtag case during attribute mapping. r=layout-reviewers,emilio"

This reverts commit 527055fac7.
2025-12-05 20:08:34 +00:00
Jonathan Kew 33dfc6cf93 Bug 2003721 - Convert GetCasingFor() in nsTextRunTransformations to use nsStyleUtil::MatchesLanguagePrefix. r=layout-reviewers,emilio
This doesn't change behavior, just cleans up the code a bit by using the
nsStyleUtil helper.

Differential Revision: https://phabricator.services.mozilla.com/D275280
2025-12-05 18:25:12 +00:00
Tom Schuster b8d11d463f Bug 1951893 - Remove unneeded StaticAtom suffixes. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D240598
2025-03-11 11:36:09 +00:00
Jonathan Kew 0928e25d7e Bug 1761482 - Re-enable text-transform:uppercase for Georgian. r=platform-i18n-reviewers,nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D232266
2024-12-17 10:59:06 +00:00
serge-sans-paille 262f78c07f 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 a5eb905bf4 Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00
serge-sans-paille 07101ac24d 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 004e704b22 Backed out changeset 448597bce69d (bug 1922838) for causing build bustages. CLOSED TREE 2024-10-24 11:37:49 +03:00
serge-sans-paille 2c916d4973 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
Jonathan Kew a93a779c56 Bug 1919511 - Rename gfxFontGroup::BuildFontList to EnsureFontList, and defer calling it until we really need the resolved font instances. r=layout-reviewers,emilio
This is preparation for splitting out separate per-script resolved font lists in gfxFontGroup.
By itself, it should not change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D222748
2024-10-12 15:37:18 +00:00
Tamas Szentpeteri 5c914102f8 Backed out changeset 8c451596a34f (bug 1919511) for causing mochitest failures on gfxUserFontSet.cpp. CLOSED TREE 2024-10-10 16:13:48 +03:00
Jonathan Kew da08a70728 Bug 1919511 - Rename gfxFontGroup::BuildFontList to EnsureFontList, and defer calling it until we really need the resolved font instances. r=layout-reviewers,emilio
This is preparation for splitting out separate per-script resolved font lists in gfxFontGroup.
By itself, it should not change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D222748
2024-10-10 09:43:59 +00:00
Jonathan Kew 4e2fe9beb2 Bug 1911550 - Make text-transform:capitalize work even if no textrun is available, for <select> intrinsic sizing. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D218533
2024-08-06 08:36:20 +00:00
Iulian Moraru f9358dfd32 Backed out 2 changesets (bug 1911550) for causing non-unified build bustages on nsTextRunTransformations.cpp. CLOSED TREE
Backed out changeset f855c6502e4d (bug 1911550)
Backed out changeset 9d74a91ccb79 (bug 1911550)
2024-08-05 22:51:30 +03:00
Jonathan Kew 56322e4227 Bug 1911550 - Make text-transform:capitalize work even if no textrun is available, for <select> intrinsic sizing. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D218533
2024-08-05 17:28:25 +00:00
Emilio Cobos Álvarez f9b44817e4 Bug 1899126 - Simplify text-transform representation. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D211731
2024-05-27 17:24:10 +00:00
Jonathan Kew ac182b0589 Bug 1888941 - Ensure any potential emergency-wrap positions are marked in nsTransformedTextRun instances. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206363
2024-04-04 17:44:27 +00:00
Jonathan Kew c0bbae65ef Bug 1852811 - Tighten up assertions in TransformString, and make it clear that the parallel arrays have the same length. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D188579
2023-09-19 13:34:19 +00:00
Jonathan Kew 70313d8021 Bug 1850184 - Add support for the Small Kana Extension block to the full-size-kana mapping. r=dholbert
Testing: there's a new WPT (text-transform-full-size-kana-008.html) coming from upstream that will cover this.

Note that the current version of the test, just landed in WPT, has a typo that will cause it to fail if it merges
in its current form. I've left a comment on the WPT commit to get this corrected:
https://github.com/web-platform-tests/wpt/commit/3412a27c237316ef2d4a3167c943dc15c0364766#r125601740)

Differential Revision: https://phabricator.services.mozilla.com/D186883
2023-08-26 21:18:49 +00:00
Frederic Wang fdbed17109 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 26d6e46ac1 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 3cd57ef95a 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 d048395e91 Backed out changeset 6cceaca5e653 (bug 1821980) for causing multiple failures. CLOSED TREE 2023-07-14 15:41:31 +03:00
Frederic Wang 48e18e6261 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
Jonathan Kew 9f1fe759af Bug 1826629 - Implement CSS and rendering (but not copy/paste) support for the (non-standard) -webkit-text-security property. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D174951
2023-04-18 11:47:07 +00:00
Jonathan Kew 5306d1f504 Bug 1697980 - Implement new uppercase mapping of eszett (U+00DF) to U+1E9E, but preffed-off by default due to inconsistent font support. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175620
2023-04-18 07:06:09 +00:00
Norisz Fay 4069ba4b67 Backed out changeset 9e43f68395b4 (bug 1697980) for causing reftest failures on 1425243-2.html CLOSED TREE 2023-04-17 21:57:08 +03:00
Jonathan Kew a6d4a7b915 Bug 1697980 - Implement new uppercase mapping of eszett (U+00DF) to U+1E9E, but preffed-off by default due to inconsistent font support. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175620
2023-04-17 12:46:49 +00:00
Jonathan Kew 60150a69e1 Bug 1823215 - Use ElementOrArray<T> to simplify the management of glyphrun(s) in gfxTextRun. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D172940
2023-03-19 16:36:06 +00:00
Ben Freist c0a7e99398 Bug 1799346 - [refactor] Remove unused nsStylePage and nsStyleText defines r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D161405
2022-11-07 00:28:48 +00:00
Emilio Cobos Álvarez 2610e02f11 Bug 1744152 - Make the aAllUpperCase parameter of TransformString more generic. r=jfkthame
Bug 1744009 will stop creating frames for <option>s, but will need to
support text-transform on the option strings to calculate the right
intrinsic size for the <select> element.

The reason why we want to calculate the intrinsic size without having
into account the option styles is so that changing the selected option
doesn't change the width of the combobox, which is something that can
happen now.

This is similar to:

  https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/layout/layout_box.cc;l=307;drc=32f574f6df1d37b0d9ed765fe138270414d79e49

This patch will allow to achieve this (and not regress tests like
html/rendering/non-replaced-elements/form-controls/text-transform.html.ini).

Differential Revision: https://phabricator.services.mozilla.com/D132746
2021-12-03 11:45:48 +00:00
Jonathan Kew 79cced18e4 Bug 1684497 - Hoist ResetGlyphRuns out of the conditional statement. r=heycam
This matches how it's done at the other callsite.
(Also add an assertion that would've caught the omission sooner.)

Differential Revision: https://phabricator.services.mozilla.com/D100779
2021-01-05 21:53:40 +00:00
Jonathan Kew 050d789263 Bug 1665773 - Ensure CompressedGlyph::SetComplex() always clears the glyphCount to zero; let gfxShapedText::SetDetailedGlyphs() own the setting of this field. r=heycam
We also rearrange bits in the CompressedGlyph so that the advance field doesn't need to be shifted,
and remove unnecessary glyphCount parameters from various setter methods.

Differential Revision: https://phabricator.services.mozilla.com/D90678
2020-09-30 21:16:44 +00:00
Jonathan Kew cd3f39bde9 Bug 1663230 - Ensure MergeCharactersInTextRun clears the old glyph record before storing new details; also prefer simple glyph storage where possible. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D89380
2020-09-08 08:47:40 +00:00
Jonathan Kew cd9157d032 Bug 1655364 - Rename gfxShapedText::SetGlyphs to SetDetailedGlyphs and make it just set glyph information, not clobber character-type flags. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D85187
2020-07-30 11:48:06 +00:00
Mihai Alexandru Michis cb2845b746 Backed out changeset 3c88adc13a06 (bug 1655364) for causing assertion failures regarding glyphs.
CLOSED TREE
2020-07-30 13:25:04 +03:00
Jonathan Kew dcf27fc2cc Bug 1655364 - Rename gfxShapedText::SetGlyphs to SetDetailedGlyphs and make it just set glyph information, not clobber character-type flags. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D85187
2020-07-30 07:56:05 +00:00
Simon Giesecke ea268054bd Bug 1628715 - Part 7: Add MOZ_NONNULL_RETURN to infallible nsTArray::AppendElements. r=xpcom-reviewers,necko-reviewers,nika,valentin
Differential Revision: https://phabricator.services.mozilla.com/D70831
2020-04-24 13:31:14 +00:00
Emilio Cobos Álvarez 778b011866 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
This was done by:

This was done by applying:

```
diff --git a/python/mozbuild/mozbuild/code-analysis/mach_commands.py b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
index 789affde7bbf..fe33c4c7d4d1 100644
--- a/python/mozbuild/mozbuild/code-analysis/mach_commands.py
+++ b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
@@ -2007,7 +2007,7 @@ class StaticAnalysis(MachCommandBase):
         from subprocess import Popen, PIPE, check_output, CalledProcessError

         diff_process = Popen(self._get_clang_format_diff_command(commit), stdout=PIPE)
-        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format]
+        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format, '-sort-includes']

         if not output_file:
             args.append("-i")
```

Then running `./mach clang-format -c <commit-hash>`

Then undoing that patch.

Then running check_spidermonkey_style.py --fixup

Then running `./mach clang-format`

I had to fix four things:

 * I needed to move <utility> back down in GuardObjects.h because I was hitting
   obscure problems with our system include wrappers like this:

0:03.94 /usr/include/stdlib.h:550:14: error: exception specification in declaration does not match previous declaration
0:03.94 extern void *realloc (void *__ptr, size_t __size)
0:03.94              ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/malloc_decls.h:53:1: note: previous declaration is here
0:03.94 MALLOC_DECL(realloc, void*, void*, size_t)
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozilla/mozalloc.h:22:32: note: expanded from macro 'MALLOC_DECL'
0:03.94     MOZ_MEMORY_API return_type name##_impl(__VA_ARGS__);
0:03.94                                ^
0:03.94 <scratch space>:178:1: note: expanded from here
0:03.94 realloc_impl
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozmemory_wrap.h:142:41: note: expanded from macro 'realloc_impl'
0:03.94 #define realloc_impl mozmem_malloc_impl(realloc)

   Which I really didn't feel like digging into.

 * I had to restore the order of TrustOverrideUtils.h and related files in nss
   because the .inc files depend on TrustOverrideUtils.h being included earlier.

 * I had to add a missing include to RollingNumber.h

 * Also had to partially restore include order in JsepSessionImpl.cpp to avoid
   some -WError issues due to some static inline functions being defined in a
   header but not used in the rest of the compilation unit.

Differential Revision: https://phabricator.services.mozilla.com/D60327
2020-01-20 16:19:48 +00:00
Emilio Cobos Álvarez 2efdea1ee5 Bug 1609996 - Remove mozilla/Move.h. r=froydnj
rg -l 'mozilla/Move.h' | xargs sed -i 's/#include "mozilla\/Move.h"/#include <utility>/g'

Further manual fixups and cleanups to the include order incoming.

Differential Revision: https://phabricator.services.mozilla.com/D60323
2020-01-20 16:18:20 +00:00
Emilio Cobos Álvarez 1fccbabe09 Bug 1602317 - Switch style system to associated constants-in-body. r=heycam
This is closer to the equivalent Rust code.

Differential Revision: https://phabricator.services.mozilla.com/D56306
2019-12-09 03:32:28 +00:00
Gabriele Svelto eeb9bfc398 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in accessible/, browser/, caps/, chrome/, devtools/, docshell/, editor/, extensions/, gfx/, hal/, image/, intl/, ipc/, js/, layout/, and media/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55443
2019-12-06 09:16:44 +00:00
Alex Henrie fd5feb4ae7 Bug 1591490 - Use the NS_IS_SURROGATE_PAIR macro everywhere. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D50697
2019-10-27 05:05:51 +00:00
Jonathan Kew c62ec6349f Bug 1573249 - patch 2 - Don't apply skip-ink to runs of CJK text, because it looks bad with many fonts. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D42529
2019-08-21 15:07:20 +00:00