Граф коммитов

152 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Kew 719dd66863 Bug 1702924 - Add support for the 'cap' font-relative unit. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D133101
2021-12-08 12:20:40 +00:00
Butkovits Atila 21676cf030 Backed out changeset 145c64b7ac17 (bug 1531223) for causing failures at gfxFontEntry.cpp. CLOSED TREE 2021-12-06 14:57:31 +02:00
Jonathan Kew ed3fd395ba Bug 1531223 - Add support for the 'ic' and 'cap' font-relative units. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D132818
2021-12-06 12:22:09 +00:00
Miko Mynttinen 76c9644105 Bug 1720804 - Part 1: Move majority of the display list code inside mozilla namespace r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D120041
2021-07-19 11:28:20 +00:00
Alexandru Michis fbd939b860 Backed out 2 changesets (bug 1720804) for causing bustages.
CLOSED TREE

Backed out changeset 5278e88c6d34 (bug 1720804)
Backed out changeset 1acb4ed79b6b (bug 1720804)
2021-07-16 18:10:11 +03:00
Miko Mynttinen ffc501ddc9 Bug 1720804 - Part 1: Move majority of the display list code inside mozilla namespace r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D120041
2021-07-16 14:36:34 +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
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 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
Emilio Cobos Álvarez 5adefab54c Bug 1449401 - Remove moz-math-anonymous ua-only pseudo. r=heycam
We do not expose it nor ever style it. Just use the parent style all the
time. This avoids problematic style resolution calls during reflow.

Differential Revision: https://phabricator.services.mozilla.com/D84358
2020-07-21 22:35:46 +00:00
Emilio Cobos Álvarez b9b9e38dd9 Bug 1646224 - Use mozilla::Length rather than nscoord to store font sizes. r=heycam,jfkthame
This avoids arbitrary precision loss when computing REM units and so on,
which is particularly important if we ever change the base of our app
units (but useful regardless).

Differential Revision: https://phabricator.services.mozilla.com/D79928
2020-06-22 09:45:40 +00:00
Cosmin Sabou 65d75a47f3 Backed out changeset 299e19193e11 (bug 1646224) for causing font related failures. CLOSED TREE 2020-06-18 18:26:51 +03:00
Emilio Cobos Álvarez 090e3d2409 Bug 1646224 - Use mozilla::Length rather than nscoord to store font sizes. r=heycam,jfkthame
This avoids arbitrary precision loss when computing REM units and so on,
which is particularly important if we ever change the base of our app
units (but useful regardless).

Differential Revision: https://phabricator.services.mozilla.com/D79928
2020-06-18 13:55:03 +00:00
Miko Mynttinen b376ee6512 Bug 1554499 - Part 8: Remove index from nsDisplayMathMLCharForeground, nsDisplayMathMLBar, nsDisplayNotation r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D74087
2020-05-11 16:57:08 +00:00
Simon Giesecke 9350e6b741 Bug 1613985 - Use MOZ_COUNTED_DEFAULT_CTOR_*/MOZ_COUNTED_DTOR_* macros. r=froydnj
This removes the need for explicit #ifdef NS_BUILD_REFCNT_LOGGING without
introducing user-defined destructors when it is not defined.

Also, some uses of virtual for declaring destructors are replaced by the
appropriate override declaration through these changes.

Differential Revision: https://phabricator.services.mozilla.com/D62604

--HG--
extra : moz-landing-system : lando
2020-02-20 11:40:14 +00:00
Dorel Luca d5f9df8ee1 Backed out 2 changesets (bug 1613985) for Build bustage on Windows2012. CLOSED TREE
Backed out changeset fd177b40b561 (bug 1613985)
Backed out changeset fb6d62b7f28d (bug 1613985)
2020-02-19 22:22:41 +02:00
Simon Giesecke 59b23375c0 Bug 1613985 - Use MOZ_COUNTED_DEFAULT_CTOR_*/MOZ_COUNTED_DTOR_* macros. r=froydnj
This removes the need for explicit #ifdef NS_BUILD_REFCNT_LOGGING without
introducing user-defined destructors when it is not defined.

Also, some uses of virtual for declaring destructors are replaced by the
appropriate override declaration through these changes.

Differential Revision: https://phabricator.services.mozilla.com/D62604

--HG--
extra : moz-landing-system : lando
2020-02-19 18:05:38 +00:00
Sebastian Hengst 80da66f898 Backed out 5 changesets (bug 1554499) for frequent crashes, at least on OS X (bug 1594381). a=backout
Backed out changeset 3a49bec95338 (bug 1554499)
Backed out changeset c802ab8cc730 (bug 1554499)
Backed out changeset f60fee484460 (bug 1554499)
Backed out changeset a49d1c9e8b14 (bug 1554499)
Backed out changeset 133cddb65f59 (bug 1554499)
2019-11-06 14:29:12 +01:00
Miko Mynttinen f8659a8bef Bug 1554499 - Remove member variables that were previously only used to calculate per frame index r=mattwoodrow
Depends on D50185

Differential Revision: https://phabricator.services.mozilla.com/D50186

--HG--
extra : moz-landing-system : lando
2019-11-05 15:10:20 +00:00
Alexis Beingessner 86bd968ca8 Bug 1554499 - Rename PerFrameKey -> PerFrameIndex for most methods r=mattwoodrow
This distinguishes better between the overloaded aspect of the PerFrameKey and the
actual mixed value.

Depends on D37803

Differential Revision: https://phabricator.services.mozilla.com/D37804

--HG--
extra : moz-landing-system : lando
2019-11-05 15:09:04 +00:00
Alexis Beingessner ffcc426ce5 Bug 1554499 - change ComputePerFrameKey to be a static method. r=mattwoodrow
This static method is assumed to have the same signature as the type's constructor,
and so we must have an implementation of ComputePerFrameKey for each constructor
a display item provides that is called by MakeDisplayItem. Notably this excludes
the MakeClone constructor for a lot of items.

There is a default varargs implementation on nsDisplayItem which everyone
inherits by default, so types which previously didn't overload this method
still don't need to.

Providing an implementation of ComputePerFrameKey on some display item type
shadows the varargs implementation, so one doesn't need to worry about overloading
one constructor but forgetting about another -- if you do, the compiler will only
see the overload and complain that the signature doesn't match.

One slightly annoying result of this is that display items which previously
inherited an overloaded implementation from a superclass now must provide
their own manual implementations. Although as far as I could tell, all of
those cases had a trivial implementation of key=0 (the super class supported
custom keys but the subclasses didn't make use of it).

In those cases I just hardcoded key=0, but it's possible that it would be
better to call into the superclass' implementation to be more robust to changes.

Differential Revision: https://phabricator.services.mozilla.com/D37803

--HG--
extra : moz-landing-system : lando
2019-11-05 15:08:53 +00:00
Frederic Wang 8957655bf3 Bug 1579602 - Rename nsMathMLElement to dom::MathMLElement. r=bzbarsky
This commit renames nsMathMLElement/nsMathMLElementFactory classes into
MathMLElement/MathMLElementFactory and moves the former into the mozilla::dom
namespace. This is a preliminary step to introduce MathML DOM (bug 1579602).
Code behavior is not changed.

Differential Revision: https://phabricator.services.mozilla.com/D45128

--HG--
rename : dom/mathml/nsMathMLElement.cpp => dom/mathml/MathMLElement.cpp
rename : dom/mathml/nsMathMLElement.h => dom/mathml/MathMLElement.h
rename : dom/mathml/nsMathMLElementFactory.cpp => dom/mathml/MathMLElementFactory.cpp
extra : moz-landing-system : lando
2019-09-13 16:27:54 +00:00
Brindusan Cristian 6e6b2f7568 Backed out 2 changesets (bug 1554499) for mochitest failures at test_restyles.html.
Backed out changeset 1a6a6a38c987 (bug 1554499)
Backed out changeset 789e5d3fcf18 (bug 1554499)
2019-07-18 21:36:22 +03:00
Alexis Beingessner bf3ef8ab03 Bug 1554499 - Rename PerFrameKey -> PerFrameIndex for most methods r=mattwoodrow
This distinguishes better between the overloaded aspect of the PerFrameKey and the
actual mixed value.

Differential Revision: https://phabricator.services.mozilla.com/D37804

--HG--
extra : moz-landing-system : lando
2019-07-17 20:13:20 +00:00
Alexis Beingessner f6d109ce74 Bug 1554499 - change ComputePerFrameKey to be a static method. r=mattwoodrow
This static method is assumed to have the same signature as the type's constructor,
and so we must have an implementation of ComputePerFrameKey for each constructor
a display item provides that is called by MakeDisplayItem. Notably this excludes
the MakeClone constructor for a lot of items.

There is a default varargs implementation on nsDisplayItem which everyone
inherits by default, so types which previously didn't overload this method
still don't need to.

Providing an implementation of ComputePerFrameKey on some display item type
shadows the varargs implementation, so one doesn't need to worry about overloading
one constructor but forgetting about another -- if you do, the compiler will only
see the overload and complain that the signature doesn't match.

One slightly annoying result of this is that display items which previously
inherited an overloaded implementation from a superclass now must provide
their own manual implementations. Although as far as I could tell, all of
those cases had a trivial implementation of key=0 (the super class supported
custom keys but the subclasses didn't make use of it).

In those cases I just hardcoded key=0, but it's possible that it would be
better to call into the superclass' implementation to be more robust to changes.

Differential Revision: https://phabricator.services.mozilla.com/D37803

--HG--
extra : moz-landing-system : lando
2019-07-17 20:24:30 +00:00
Emilio Cobos Álvarez 980074a5b2 Bug 1544242 - Cleanup selector-matching for nested pseudo-elements, match ::slotted correctly when there's no selector before it, and add tests. r=heycam,mats
D29542 fixed the bogus checks that was making nested pseudo-elements match
author rules. This adds tests and ends up being just a cleanup, though as it
turns out we it also fixes an issue with ::slotted() matched from
Element.matches.

Differential Revision: https://phabricator.services.mozilla.com/D27529

--HG--
extra : moz-landing-system : lando
2019-05-24 01:09:15 +00:00
Miko Mynttinen 2c5cb1519c Bug 1549751 - Part 2: Add nsPaintedDisplayItem r=mattwoodrow
Move ApplyOpacity(), CanApplyOpacity(), Paint() and PaintWithClip() methods to nsPaintedDisplayItem

Differential Revision: https://phabricator.services.mozilla.com/D30225

--HG--
extra : moz-landing-system : lando
2019-05-08 13:49:56 +00:00
Noemi Erli f1ef21cbc7 Backed out changeset 8c89fd37b79d (bug 1544242) for failures in browser_rules_shadowdom_slot_rules.js CLOSED TREE 2019-05-01 22:03:06 +03:00
Emilio Cobos Álvarez fb5b637f4f Bug 1544242 - Fix selector-matching for nested pseudo-elements. r=heycam,mats
We always include the combinator for pseudo-elements now (not including it was
just an optimization) in order to not match when nested pseudo-elements are
involved.

We could add a more generic check in `matches_simple_selector` like:

```
if element.is_pseudo_element() {
    match *selector {
        Component::PseudoElement(..) |
        Component::NonTSPseudoClass(..) => {},
        _ => return false,
    }
}
```

But even that wouldn't be enough to make selectors like `:hover::marker` not
match on the `::before::marker` pseudo-element, plus that code is really hot.

So for now do the check on the `next_element_for_combinator` function. It's a
bit hacky but it's the best I could came up with...

While at it, simplify some checks to use is_pseudo_element() instead of
implemented_pseudo_element() directly.

Only the Rust patch as-is would make markers for ::before and ::after on list
items not show up, so we also need to switch ::marker to use ProbeMarkerStyle()
rather than ProbePseudoElementStyle(), since the marker should exist even if it
matches no rules.

Differential Revision: https://phabricator.services.mozilla.com/D27529

--HG--
extra : moz-landing-system : lando
2019-05-01 17:19:08 +00:00
Miko Mynttinen 84624b4a42 Bug 1540785 - Part 2: Devirtualize nsDisplayItemBase::GetPerFrameKey() r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D27580

--HG--
extra : moz-landing-system : lando
2019-04-22 19:58:01 +00:00
Matt Woodrow d99a15fae2 Bug 1539673 - Support fallible display item construction. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D25167

--HG--
extra : moz-landing-system : lando
2019-04-01 16:53:11 +00:00
Masayuki Nakano b7fbcf781f Bug 1540015 - part 2: Make nsPresContext.h stop including nsIPresShel.h and nsIPresShellInlines.h r=smaug
`*Inlines.h` shouldn't be included by another header file, but `nsPresContext.h`
does it.  This causes include-hell which blocks the following fix.

Additionally, it causes an include hell between `PresShell.h` vs.
`nsIPresShell.h` and `nsPresContext.h if `Document.h` includes `PresShell.h`.
Therefore, this patch also solves this include hell with adding
`nsPresContextInlines.h`.

Differential Revision: https://phabricator.services.mozilla.com/D25333

--HG--
extra : moz-landing-system : lando
2019-03-29 15:11:22 +00:00
Dorel Luca 5a0fa68b78 Backed out 3 changesets (bug 1540015) for build bustage. CLOSED TREE
Backed out changeset 7b71c9da0214 (bug 1540015)
Backed out changeset 5723ddbc5c44 (bug 1540015)
Backed out changeset 9561d2c36fa5 (bug 1540015)
2019-03-29 16:14:26 +02:00
Masayuki Nakano 2137fa4b14 Bug 1540015 - part 2: Make nsPresContext.h stop including nsIPresShel.h and nsIPresShellInlines.h r=smaug
`*Inlines.h` shouldn't be included by another header file, but `nsPresContext.h`
does it.  This causes include-hell which blocks the following fix.

Additionally, it causes an include hell between `PresShell.h` vs.
`nsIPresShell.h` and `nsPresContext.h if `Document.h` includes `PresShell.h`.
Therefore, this patch also solves this include hell with adding
`nsPresContextInlines.h`.

Differential Revision: https://phabricator.services.mozilla.com/D25333

--HG--
extra : moz-landing-system : lando
2019-03-29 12:13:08 +00:00
Ryan Hunt b936c00a65 Bug 1523969 part 14 - Move method definition inline comments to new line in 'layout/'. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D21115

--HG--
extra : rebase_source : 4d65c07d8822f3a54ac881b5d0f55468ce884554
2019-02-25 16:09:24 -06:00
Emilio Cobos Álvarez dad3a20b22 Bug 1525955 - Include anon boxes in CSSPseudoElementType, to remove ComputedStyle::mPseudoTag. r=heycam
This is more consistent with what the Rust bits of the style system do, and
removes a pointer from ComputedStyle which is always nice.

This also aligns the Rust bits with the C++ bits re. not treating xul pseudos as
anonymous boxes. See the comment in nsTreeStyleCache.cpp regarding those.

Can't wait for XUL trees to die.

Depends on D19001

Differential Revision: https://phabricator.services.mozilla.com/D19002

--HG--
extra : moz-landing-system : lando
2019-02-19 13:44:33 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Gerald Squelart b099eab802 Bug 1488684 - Made nsIFrame-derived classes and some others 'final' where possible - r=dbaron
All classes deriving from nsIFrame that did not have any subclasses themselves
(at the time of writing this patch) have been marked with `final`.
Some other Layout classes have also been made final, but this was opportunistic
while working on nsIFrame subclasses, and is definitely not exhaustive, further
patches welcome; refer to bug 1332680.

Advantages of marking a class final include:
- Allowing the compiler to devirtualize some method calls (i.e., calling
  virtual functions directly instead of going through the vtable),
- Indicating that the class is not currently subclassed,
- Preventing subclassing without being aware that this would remove the
  finalization benefits of the parent class.
`final` does not signify that these classes should *never* be subclassed, this
is left for developers to decide.

Differential Revision: https://phabricator.services.mozilla.com/D5020

--HG--
extra : moz-landing-system : lando
2018-09-06 01:23:14 +00:00
Emilio Cobos Álvarez f39eaa5d48 Bug 1452080: Remove ComputedStyle::PresContext usage from layout and canvas code. r=xidorn
Couldn't find an easy way of splitting these up :(

MozReview-Commit-ID: 2kTZ5McREUT
2018-04-09 11:19:49 +02:00
Noemi Erli 5d9588e156 Backed out 3 changesets (bug 1452080) for bustage in /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp on a CLOSED TREE
Backed out changeset 7f5104c7a242 (bug 1452080)
Backed out changeset 806a9c95a243 (bug 1452080)
Backed out changeset bffebe8aa254 (bug 1452080)
2018-04-09 11:18:12 +03:00
Emilio Cobos Álvarez 2a427429ff Bug 1452080: Remove ComputedStyle::PresContext usage from layout and canvas code. r=xidorn
Couldn't find an easy way of splitting these up :(

MozReview-Commit-ID: 2kTZ5McREUT
2018-04-09 09:57:55 +02:00
Xidorn Quan 4cf9aed667 Bug 1449400 part 5 - Remove StyleSetHandle. r=emilio
This patch basically does:
* remove StyleSetHandle and its corresponding files
* revisit #includes of related header files and change correspondingly
* change nsIPresShell::mStyleSet to be UniquePtr<ServoStyleSet>
* change the creating path of ServoStyleSet to pass UniquePtr
* change other mentions of StyleSetHandle to ServoStyleSet*
* remove AsServo() calls on ServoStyleSet

Some unfortunate bits:
* some methods of (Servo)StyleSet only accepts ServoStyleSheet while
  many places call into the methods with StyleSheet, so there are many
  ->AsServo() added to sheets

MozReview-Commit-ID: K4zYnuhOurA

--HG--
extra : rebase_source : 459e8efeb171adad089d94272e143e8c244bd279
extra : source : 65ba2f174fcf7dba4e59c00ee8908b1bd0820a48
2018-03-29 22:15:46 +11:00
Jonathan Watt 82ebebe276 Bug 1448714 - Fix up comments referring to 'style context' after the rename of nsStyleContext. r=emilio 2018-03-23 13:49:21 +00:00
Emilio Cobos Álvarez e341b20ec4 Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE
MozReview-Commit-ID: JPopq0LudD
2018-03-22 20:06:24 +01:00
Emilio Cobos Álvarez 5dd797f154 Back out changeset b683bb3f22a1 (Bug 1447483) for not landing with all the files. r=me on a CLOSED TREE
This reverts commit 1808914126bb9f9e4a82d2c3d7ac961885fe7d62.

MozReview-Commit-ID: 5skESBseEvo
2018-03-22 20:05:22 +01:00
Emilio Cobos Álvarez ca5ac79cca Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt
MozReview-Commit-ID: JPopq0LudD
2018-03-22 19:48:42 +01:00
Matt Woodrow 4183152e2d Bug 1436904 - Part 1: Add a static constructor function for display items. r=Bas 2018-02-13 13:43:28 +13:00
Dorel Luca bd05e3853c Backed out 3 changesets (bug 1436904) for many crashes see bugs: 1440281, 1440302, 1440303, 1440313. a=backout
Backed out changeset 27f0762d4472 (bug 1436904)
Backed out changeset 27640f52e188 (bug 1436904)
Backed out changeset 2b4d117c27dc (bug 1436904)
2018-02-22 17:28:59 +02:00