Commit Graph

1801 Commits

Author SHA1 Message Date
Jonathan Kew
553fdd24fc Bug 1711479 - Support various metrics (not only ex-height) as the basis for font-size-adjust calculations in the gfx font implementations. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D115211
2021-06-14 12:32:37 +00:00
Csoregi Natalia
1fa90cf8b2 Backed out 5 changesets (bug 1711479) for multiple failures e.g. test_css-properties-db.js. CLOSED TREE
Backed out changeset f1b19a0463cd (bug 1711479)
Backed out changeset 3d1d2b4a2713 (bug 1711479)
Backed out changeset 4e689776fe5d (bug 1711479)
Backed out changeset 85b6b2648f60 (bug 1711479)
Backed out changeset a15cec1f0554 (bug 1711479)
2021-06-07 13:55:29 +03:00
Jonathan Kew
ddbc4e9bed Bug 1711479 - Support various metrics (not only ex-height) as the basis for font-size-adjust calculations in the gfx font implementations. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D115211
2021-06-07 08:58:12 +00:00
Matt Woodrow
0346da0140 Bug 1540737 - Don't use nsDisplayBorder's IsInvisibleInRect implementation for nsMathMLmtable, since it uses a custom style context. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D114674
2021-05-19 01:11:31 +00:00
Csoregi Natalia
1f3f5df2ce Backed out 8 changesets (bug 1540737) for causing graphics crashes in Bug 1711718. a=backout
Backed out changeset 37628894ffd5 (bug 1540737)
Backed out changeset 4b5f53d5127b (bug 1540737)
Backed out changeset a73e041f1f1d (bug 1540737)
Backed out changeset 81f1a9d1a5e1 (bug 1540737)
Backed out changeset b3d0cc460b24 (bug 1540737)
Backed out changeset f929de495b87 (bug 1540737)
Backed out changeset 2f5b8369d061 (bug 1540737)
Backed out changeset b4c93d182ef4 (bug 1540737)
2021-05-18 19:06:20 +03:00
Matt Woodrow
24bb612fe3 Bug 1540737 - Don't use nsDisplayBorder's IsInvisibleInRect implementation for nsMathMLmtable, since it uses a custom style context. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D114674
2021-05-17 23:53:44 +00:00
Emilio Cobos Álvarez
390c6943fe Bug 1702676 - Change public LookAndFeel API to accept a color scheme. r=mstange
This shouldn't change behavior, but is the biggest cross-platform part
of the change so I'd like to get it landed sooner rather than later.

The two calls like:

  GetColor(ColorID::TextSelectBackground, color);
  if (color == 0x000000) {
    mColorTextSelectForeground = NS_RGB(0xff, 0xff, 0xff);
  } else {
    mColorTextSelectForeground = NS_DONT_CHANGE_COLOR;
  }

that I'm removing are just broken. They were calling the version of
GetColor the function that took a default value when the color wasn't
available, not the version of the color with the outparam.

To prevent such mistakes, add two signatures, GetColor(), returning a
Maybe<nscolor> and Color(), returning a color with a fallback.

Differential Revision: https://phabricator.services.mozilla.com/D110651
2021-04-02 12:22:14 +00:00
Emilio Cobos Álvarez
e7d8e6bfae Bug 1702216 - Paint auto-style outline with webrender if possible. r=mstange
I noticed we weren't doing this when looking at bug 1701910.

We remove support for auto style outlines in trees, which is unused
(checked that thunderbird and FF trees don't use outline: auto) and for
some mathml debugging code, which seems ok.

Differential Revision: https://phabricator.services.mozilla.com/D110399
2021-04-02 12:21:25 +00:00
Narcis Beleuzu
e9fb777466 Backed out changeset 597b9606c3ca (bug 1702676) for reftest failures on mq_prefers_reduced_motion_reduce.html CLOSED TREE 2021-04-02 09:34:53 +03:00
Bogdan Tara
be061ee475 Backed out changeset 96866f6d4543 (bug 1702216) for css-ui/outline-*, 375508-1.html, z-index-1.html failures CLOSED TREE 2021-04-02 04:43:22 +03:00
Emilio Cobos Álvarez
f7f84a3c53 Bug 1702676 - Change public LookAndFeel API to accept a color scheme. r=mstange
This shouldn't change behavior, but is the biggest cross-platform part
of the change so I'd like to get it landed sooner rather than later.

The two calls like:

  GetColor(ColorID::TextSelectBackground, color);
  if (color == 0x000000) {
    mColorTextSelectForeground = NS_RGB(0xff, 0xff, 0xff);
  } else {
    mColorTextSelectForeground = NS_DONT_CHANGE_COLOR;
  }

that I'm removing are just broken. They were calling the version of
GetColor the function that took a default value when the color wasn't
available, not the version of the color with the outparam.

To prevent such mistakes, add two signatures, GetColor(), returning a
Maybe<nscolor> and Color(), returning a color with a fallback.

Differential Revision: https://phabricator.services.mozilla.com/D110651
2021-04-02 00:21:37 +00:00
Emilio Cobos Álvarez
70c869cd11 Bug 1702216 - Paint auto-style outline with webrender if possible. r=mstange
I noticed we weren't doing this when looking at bug 1701910.

We remove support for auto style outlines in trees, which is unused
(checked that thunderbird and FF trees don't use outline: auto) and for
some mathml debugging code, which seems ok.

Differential Revision: https://phabricator.services.mozilla.com/D110399
2021-04-02 00:18:29 +00:00
Cosmin Sabou
4ed0046f14 Backed out changeset b8e2adcbf67c (bug 1702216) for android reftest failures on outline-027/028.html. CLOSED TREE 2021-04-01 23:11:14 +03:00
Emilio Cobos Álvarez
9fa51f30db Bug 1702216 - Paint auto-style outline with webrender if possible. r=mstange
I noticed we weren't doing this when looking at bug 1701910.

We remove support for auto style outlines in trees, which is unused
(checked that thunderbird and FF trees don't use outline: auto) and for
some mathml debugging code, which seems ok.

Differential Revision: https://phabricator.services.mozilla.com/D110399
2021-04-01 19:01:47 +00:00
Simon Giesecke
ad01a10a3b Bug 1634281 - Use nsTHashMap instead of nsDataHashtable. r=xpcom-reviewers,necko-reviewers,jgilbert,nika,valentin
Note that this patch only transforms the use of the nsDataHashtable type alias
to a directly equivalent use of nsTHashMap. It does not change the specification
of the hash key type to make use of the key class deduction that nsTHashMap
allows for in some cases. That can be done in a separate step, but requires more
attention.

Differential Revision: https://phabricator.services.mozilla.com/D106008
2021-03-10 10:47:47 +00:00
Simon Giesecke
9af107a839 Bug 1691913 - Rename nsBaseHashtable::Put to InsertOrUpdate. r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.

Differential Revision: https://phabricator.services.mozilla.com/D105473
2021-02-26 09:11:46 +00:00
Simon Giesecke
9ab4b4f5d3 Bug 1693001 - Remove redundant nullptr checks of return value of infallible new in layout/. r=emilio
Depends on D105289

Differential Revision: https://phabricator.services.mozilla.com/D105290
2021-02-16 15:52:09 +00:00
Emilio Cobos Álvarez
4b58806ec7 Bug 1690225 - Unify focus-visible rules in ua.css. r=edgar
We had different rules with the same declarations for all namespaces, so
simplify that setup by having a single rule.

Remove redundant *|* from selectors while at it (there's no default
namespace in ua.css, so there's no need to do that).

Differential Revision: https://phabricator.services.mozilla.com/D103753
2021-02-03 10:25:21 +00:00
Emilio Cobos Álvarez
217ddbe75f Bug 1690225 - Remove focus-visible feature flag. r=edgar
This shipped in 85, we can remove the feature flag now. Keep
:-moz-focusring as an alias to :focus-visible at parse time.

Differential Revision: https://phabricator.services.mozilla.com/D103752
2021-02-02 23:45:25 +00:00
Mihai Alexandru Michis
ac5549ffd4 Backed out 2 changesets (bug 1690225) for causing multiple bc failures.
CLOSED TREE

Backed out changeset 381ee01f5034 (bug 1690225)
Backed out changeset cde1d10aae1c (bug 1690225)
2021-02-03 01:42:37 +02:00
Emilio Cobos Álvarez
63fd5123dd Bug 1690225 - Unify focus-visible rules in ua.css. r=edgar
We had different rules with the same declarations for all namespaces, so
simplify that setup by having a single rule.

Remove redundant *|* from selectors while at it (there's no default
namespace in ua.css, so there's no need to do that).

Depends on D103752

Differential Revision: https://phabricator.services.mozilla.com/D103753
2021-02-02 22:32:14 +00:00
Emilio Cobos Álvarez
df079e8f9d Bug 1690225 - Remove focus-visible feature flag. r=edgar
This shipped in 85, we can remove the feature flag now. Keep
:-moz-focusring as an alias to :focus-visible at parse time.

Differential Revision: https://phabricator.services.mozilla.com/D103752
2021-02-02 22:28:40 +00:00
Ting-Yu Lin
a43cae175a Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-26 02:47:40 +00:00
Csoregi Natalia
0492d8333a Backed out 8 changesets (bug 1686603) for causing crashtest failures. CLOSED TREE
Backed out changeset 94b5d0986d27 (bug 1686603)
Backed out changeset e7edf6fcc41d (bug 1686603)
Backed out changeset 4c9271f07178 (bug 1686603)
Backed out changeset 7013b95266ae (bug 1686603)
Backed out changeset cf7a55638aef (bug 1686603)
Backed out changeset 7717a0f2a37b (bug 1686603)
Backed out changeset c82593b13a61 (bug 1686603)
Backed out changeset fd1d95a1e706 (bug 1686603)
2021-01-26 04:32:13 +02:00
Ting-Yu Lin
ffce5ed7d6 Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-25 22:29:31 +00:00
Mihai Alexandru Michis
b6b2f1e5f4 Backed out 7 changesets (bug 1686603) for causing crashtest assertion failures.
CLOSED TREE

Backed out changeset 19cba7d34a7f (bug 1686603)
Backed out changeset 3a0d0155ea5e (bug 1686603)
Backed out changeset f1f672cdd0c6 (bug 1686603)
Backed out changeset 63020922e2fd (bug 1686603)
Backed out changeset 8766ce79ba5e (bug 1686603)
Backed out changeset 965dbe8de1e1 (bug 1686603)
Backed out changeset b1328ee45f43 (bug 1686603)
2021-01-21 09:21:12 +02:00
Ting-Yu Lin
d0c462cb81 Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-21 04:17:59 +00:00
Kartik Gautam
5d5093a494 Bug 1679452 - Replace :not(X):not(Y) with :not(X, Y) r=ntim
Differential Revision: https://phabricator.services.mozilla.com/D100147
2020-12-19 11:24:13 +00:00
Simon Giesecke
6fac745ea4 Bug 1673931 - Remove dependency of BindingUtils.h on Document.h.
Differential Revision: https://phabricator.services.mozilla.com/D95048

Depends on D95047
2020-11-23 16:08:03 +00:00
Simon Giesecke
971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Tim Nguyen
082c712f75 Bug 1525737 - Remove/replace usages of XUL grid display values. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D53300
2020-11-17 01:20:34 +00:00
Ting-Yu Lin
545a6376cd Bug 1677635 Part 4 - Rename nsOverflowAreas to OverflowAreas, and move it into mozilla namespace. r=layout-reviewers,emilio
This patch is generated via the rename functionality in my editor; add
`mozilla::` prefix to `OverflowAreas` in headers; and remove the
`OverflowType` alias added in Part 1.

Differential Revision: https://phabricator.services.mozilla.com/D97235
2020-11-18 00:08:12 +00:00
Mats Palmgren
a5415dec54 Bug 1674594 - Remove the obsolete nsMathMLmfencedFrame and associated pref and tests. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D95451
2020-11-05 22:36:43 +00:00
Ting-Yu Lin
1c052b9ff3 Bug 1674931 Part 2 - Add WritingMode argument to SizeComputationInput::ComputedLogicalBorderPadding(), and adapt callers. r=jfkthame
This patch is similar to Part 1, but for ComputedLogicalBorderPadding().

Differential Revision: https://phabricator.services.mozilla.com/D95662
2020-11-03 19:57:40 +00:00
Ting-Yu Lin
9910d9e651 Bug 1674931 Part 1 - Add WritingMode argument to SizeComputationInput::ComputedLogicalMargin(), and adapt callers. r=jfkthame
It's straightforward to determine which writing mode is required to pass
to ComputedLogicalMargin() by looking at any subsequent method called on
the margin.

For example, if we see

```
ComputedLogicalMargin().BStartEnd(wm);
```

the writing mode needed to pass to `ComputedLogicalMargin()` is `wm`.

Differential Revision: https://phabricator.services.mozilla.com/D95661
2020-11-03 19:44:58 +00:00
Ricky Stewart
02a7b4ebdf Bug 1654103: Standardize on Black for Python code in mozilla-central.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Ting-Yu Lin
b5d7c879c0 Bug 1673056 - Remove nsLayoutUtils::MIN_ISIZE and nsLayoutUtils::PREF_ISIZE. r=mats
Both are aliases to IntrinsicISizeType::MinISize and
IntrinsicISizeType::PrefISize.

Remove MOZ_ASSERT in nsLayoutUtils::IntrinsicForAxis and
nsContainerFrame::DoInlineIntrinsicISize since IntrinsicISizeType is a
enum class nowadays, which cannot have other values.

I've compiled this patch with DEBUG_INTRINSIC_WIDTH defined in
nsLayoutUtils.cpp, and fixed aWM undefined in
nsLayoutUtils::MinSizeContributionForAxis().

Differential Revision: https://phabricator.services.mozilla.com/D94618
2020-10-23 22:52:02 +00:00
Bogdan Tara
da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart
c0cea3b0fa Bug 1654103: Standardize on Black for Python code in mozilla-central. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Dorel Luca
1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart
50762dacab Bug 1654103: Standardize on Black for Python code in mozilla-central. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Razvan Maries
365b429d6e Backed out changeset 20fadec3e9dc (bug 1187682) for perma failures on layout/reftests/mathml/stretchy-munderover-1c.html. CLOSED TREE 2020-10-02 17:11:33 +03:00
Frederic Wang
6391eed8cc Bug 1187682 - Use ScriptPercentScaleDown and ScriptScriptPercentScaleDown constants. r=emilio
The math-depth implementation is refined to take into account the
ScriptPercentScaleDown and ScriptScriptPercentScaleDown constants (if the
parent's first valid font has a MATH table) in order to calculate the
scale factor between math-deth 0 and 1, and between 0 and 2 respectively.

Behavior is unchanged if the legacy scriptsizemultiplier attribute is
specified or if no MATH table is available.

The preference layout.css.math-depth.enabled remains disabled in nightly
until the remaining bit (support for font-size: math) is implemented in
bug 1667090.

Differential Revision: https://phabricator.services.mozilla.com/D91604
2020-10-02 11:33:34 +00:00
Botond Ballo
e6c29de3e7 Bug 1667594 - Move nsLayoutUtils::SurfaceFromElementResult to its own file. r=emilio
Along with a dependent struct DirectDrawInfo.

This allows nsImageRenderer.h and CanvasRenderingContext2D.h to
avoid including nsLayoutUtils.h.

For nsImageRenderer.h in particular, a forward declaration is
not sufficient as nsImageRenderer stores SurfaceFromElementResult
by value.

A couple of method definitions elsewhere are moved out of line
to keep things compiling without including nsLayoutUtils.h in
additional headers.

Differential Revision: https://phabricator.services.mozilla.com/D91684
2020-09-30 21:05:34 +00:00
Frederic Wang
3a9862e638 Bug 1667719: Add preferences, warnings and telemetry for the scriptminsize and scriptsizemultiplier attributes. r=emilio
These attributes have been removed from MathML Core and their use case
could be handled by other ways:
1. Rely on font.minimum-size.x-math and/or improve CSS math-depth to avoid
  that the font-size due to math-depth change becomes very small.
2. Implement support for the OpenType MATH parameters to customize the
  scaling factor and/or improve math-depth to accept float values, so that
  people can customize the automatic scaling down.

This patch is a tentative to remove these attributes. They will be disabled
under a preference flag on nightly and have warning/telemetry on other
channels. Note that the effect of the default scriptminsize (8pt) is not
disabled from cascade.rs's handle_mathml_scriptlevel_if_needed yet. This
part will require more care (see bug 1548471).

Differential Revision: https://phabricator.services.mozilla.com/D91569
2020-09-28 14:12:27 +00:00
Frederic Wang
42b117ee83 Bug 1667527 - Implement CSS parsing for the math-depth property r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D91500
2020-09-28 10:42:49 +00:00
Botond Ballo
1976364433 Bug 1667594 - Avoid including nsLayoutUtils.h from various headers. r=kats
This patch covers thw low-hanging fruit: headers that either don't use
nsLayoutUtils.h at all, or where only method implementations that can
easily be moved to the .cpp file use it.

Differential Revision: https://phabricator.services.mozilla.com/D91504
2020-09-26 17:55:00 +00:00
Frederic Wang
0eebca3c33 Bug 1667118 - Rename -moz-math-script-level to math-depth. r=emilio
This renames the internal -moz-math-script-level property in order to
prepare for full math-depth support. Currently, the property is guarded
under a disabled-by-default flag, so there should be no observable
behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D91285
2020-09-26 03:04:56 +00:00
Narcis Beleuzu
679469fad8 Backed out changeset 239f29a99c4f (bug 1667118) for bc failure on browser_parsable_css.js . CLOSED TREE 2020-09-25 23:39:15 +03:00
Frederic Wang
5461921d85 Bug 1667118 - Rename -moz-math-script-level to math-depth. r=emilio
This renames the internal -moz-math-script-level property in order to
prepare for full math-depth support. Currently, the property is guarded
under a disabled-by-default flag, so there should be no observable
behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D91285
2020-09-25 18:37:39 +00:00