This is mostly the result of running ./mach static-analysis check --fix
with the new linter activated, with the following caveats:
- use std::fill when it makes sense
- use appropriate names for the loop target variable
- fix constness
- use array default initialization instead of an explicit loop when it
makes sense
Differential Revision: https://phabricator.services.mozilla.com/D289172
The changeset has been generated automatically through:
./mach static-analysis check --output ./clang-tidy-bugprone.json --format json --fix
followed by manual adjustment when needed or when the auto-fixer bailed out.
This paves the way for Bug 2023527
Differential Revision: https://phabricator.services.mozilla.com/D287941
The changeset has been generated automatically through:
./mach static-analysis check --output ./clang-tidy-bugprone.json --format json --fix
followed by manual adjustment when needed or when the auto-fixer bailed out.
This paves the way for Bug 2023527
Differential Revision: https://phabricator.services.mozilla.com/D287941
These were used a while ago for mathml but I think I removed the usages
in bug 1449401 and related. Also for button ::-moz-focus-inner but that
is also gone now.
Differential Revision: https://phabricator.services.mozilla.com/D282097
Currently, when a size variant is used for large variants of stretchy
operators, we modify the bounding box of the glyph by substracting any
specified italic correction from the calculated width. This is to mimic
legacy behavior of old math fonts that were handling subscript of
slanted integrals by specifying a width smaller than the actual glyph
extent.
This causes rendering issues when one draws the background of the
corresponding `<mo>` element, or when a slanted integral is rendered in
right-to-left mode. This bug is also detected by WPT test
mathml/presentation-markup/scripts/subsup-parameters-2.html since
one case assumes subscript is placed at the right of the base minus
the italic correction. We strengthen it a bit by actually checking the
base's width is properly set.
MathML Core describes italic correction of all MathML boxes (
measurement of how slanted they are), how it can be calculated
recursively from the box's children and how it applies to sub/sup
script positioning. In this patch, we implement a simplified version
addressing above issues and covering simple cases currently supported
by browsers and actually useful in practice.
Differential Revision: https://phabricator.services.mozilla.com/D277987
Replace mathfontUnicode.properties with a harcoded table with sorted
entries and binary search.
There is no observable behavior change.
Differential Revision: https://phabricator.services.mozilla.com/D277022
After bug 1336058, nsPropertiesTable is only used for
mathfontUnicode.properties, so it can be renamed. Also do some
small cleanup for code that were assuming multiple instances of
nsPropertiesTable.
There is no behavior change.
Differential Revision: https://phabricator.services.mozilla.com/D277012
nsPropertiesTable had a concept of "primary font" (nsGlyphCode.font=0)
and "external fonts" (nsGlyphCode.font > 0) that was used in the past
for fonts like the STIX General set that were using glyphs coming from
multiple fonts to build stretchy operators. After bug 1336058,
nsPropertiesTable is only used for mathfontUnicode.properties which
does not use such external fonts. Additionally, nsOpenTypeTable always
uses nsGlyphCode.font=-1. So nsGlyphCode's font value can become a
boolean, indicating whether the nsGlyphCode is a glyph id or not.
There is no behavior change.
Differential Revision: https://phabricator.services.mozilla.com/D276998
This reverts commit a0b5057dab.
Revert "Bug 1007090 - Part 3: Rename nsPropertiesTable to nsUnicodeTable. r=emilio,layout-reviewers"
This reverts commit bfab0e2d2e.
Revert "Bug 1007090 - Part 2: Remove support for external fonts in nsPropertiesTable. r=emilio,layout-reviewers"
This reverts commit dc1f434489.
Revert "Bug 1007090 - Part 1: Fix size 0 of U+21A4 in mathfontUnicode.properties. r=emilio,layout-reviewers"
This reverts commit 9b9886bad6.
Replace mathfontUnicode.properties with a harcoded table with sorted
entries and binary search.
There is no observable behavior change.
Differential Revision: https://phabricator.services.mozilla.com/D277022
After bug 1336058, nsPropertiesTable is only used for
mathfontUnicode.properties, so it can be renamed. Also do some
small cleanup for code that were assuming multiple instances of
nsPropertiesTable.
There is no behavior change.
Differential Revision: https://phabricator.services.mozilla.com/D277012
nsPropertiesTable had a concept of "primary font" (nsGlyphCode.font=0)
and "external fonts" (nsGlyphCode.font > 0) that was used in the past
for fonts like the STIX General set that were using glyphs coming from
multiple fonts to build stretchy operators. After bug 1336058,
nsPropertiesTable is only used for mathfontUnicode.properties which
does not use such external fonts. Additionally, nsOpenTypeTable always
uses nsGlyphCode.font=-1. So nsGlyphCode's font value can become a
boolean, indicating whether the nsGlyphCode is a glyph id or not.
There is no behavior change.
Differential Revision: https://phabricator.services.mozilla.com/D276998
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
This reverts commit d4927b8866.
Revert "Bug 1994197 - patch 3 - Convert gfxTextRun text advance computation to nscoord values. r=layout-reviewers,emilio"
This reverts commit c2168d7fb8.
Revert "Bug 1994197 - patch 2 - Convert more text measurement to use integer nscoord values. r=layout-reviewers,TYLin"
This reverts commit 995e0ca47e.
Revert "Bug 1994197 - patch 1 - Use integer nscoord values rather than gfxFloat for gfxFont::Spacing fields. r=layout-reviewers,TYLin"
This reverts commit 8c9d04dcc3.