Removed the Reflow Input in nsIFrame. Added includes for ReflowInput as
necessary in cpp files. Also Forward Declared nsLineLayout in 3 header
files.
Differential Revision: https://phabricator.services.mozilla.com/D298203
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
This deals with ::backdrop's placeholder correctly.
In general, this frameset code looks like it could get a rewrite but...
Differential Revision: https://phabricator.services.mozilla.com/D285220
If you make a fullscreen <frameset>, it goes out of flow and now we
create a backdrop.
Framesets are super weird, they create child frames on Init()... They
are also supposed to not be out of flow, but fullscreen trumps that.
This keeps effectively the pre-regression state of affairs.
Differential Revision: https://phabricator.services.mozilla.com/D284401
I looked at this because in bug 2014331 I need to mark more pseudos as
element-backed, and it's kinda silly the state our setup is in right
now.
This is all a somewhat historical mess, because in the old style system
pseudo-elements were just atoms, and we had that different types of atom
setup. The source of truth for these right now lives in a header macro
file, which isn't very flexible.
But now we have PseudoStyleType which represents both pseudos and anon
boxes, and is similar to the rust side PseudoElement enum.
Plus, the ::-moz-tree pseudo-elements are defined as anon boxes which
doesn't make any sense, so move them to pseudo-elements while at it.
Unify this in a similar way we treat CSS properties: Source of truth is
in pseudo_elements.toml / anon_boxes.toml, and we generate Rust and C++
as needed. This allows removing the nsStaticAtom subclass thing from
XPCOM, too.
This avoids some nasty duplication around which pseudos are pref-gated
and what not as well.
Differential Revision: https://phabricator.services.mozilla.com/D282076
I looked at this because in bug 2014331 I need to mark more pseudos as
element-backed, and it's kinda silly the state our setup is in right
now.
This is all a somewhat historical mess, because in the old style system
pseudo-elements were just atoms, and we had that different types of atom
setup. The source of truth for these right now lives in a header macro
file, which isn't very flexible.
But now we have PseudoStyleType which represents both pseudos and anon
boxes, and is similar to the rust side PseudoElement enum.
Plus, the ::-moz-tree pseudo-elements are defined as anon boxes which
doesn't make any sense, so move them to pseudo-elements while at it.
Unify this in a similar way we treat CSS properties: Source of truth is
in pseudo_elements.toml / anon_boxes.toml, and we generate Rust and C++
as needed. This allows removing the nsStaticAtom subclass thing from
XPCOM, too.
This avoids some nasty duplication around which pseudos are pref-gated
and what not as well.
Differential Revision: https://phabricator.services.mozilla.com/D282076
Now that these two data members are set in exactly one place after
initialization, we can see that they always have the same value as the length
of mRowSizes and mColSizes, so remove the members. Hopefully the extra overhead
from the integer conversions isn't relevant.
Differential Revision: https://phabricator.services.mozilla.com/D267674
Nobody ever checks the failure value, so return the Span directly.
This drops the setting of mNumRows and mNumCols in MouseDrag(), because we
already require that the number of rows or columns does not change. This is
checked via an assertion in GenerateRowCol().
Differential Revision: https://phabricator.services.mozilla.com/D267673
A later patch will remove these data members, so do this change
separately to clean things up a bit.
Also, clean up a few for loop variables.
Differential Revision: https://phabricator.services.mozilla.com/D267672
The calculate and generate methods rely on the aValues and aSpecs arrays having
the same number of elements, so document that with an assertion.
Differential Revision: https://phabricator.services.mozilla.com/D267419
preserve3d means that transforms on child frames are in a shared 3d transform space with their parent; rather than transforming the child in it's own 3d space and then rendering the 2d depiction of that and then the parent applies it's own transform to the flat representation of the child frame. And this can be extended down the DOM tree: each direct descendant with preserve3d then participates in the same shared 3d space. The tree of all frames that are all in one shared preserve3d space form a preserve3d context.
Setting preserve3d on a frame makes the frame considered to be transformed (whether it has an actual transform or not).
combines3d means that the parent frame is preserve3d AND this frame is either transformed or is backface-visibility: hidden.
A leaf in the preserve3d context is a frame that is combines3D but is not preserve3d itself. So it is the last frame in the preserve3d context. In other words, it's a frame that is not preserve3d but its parent is preserve3d, AND it's either transformed or backface-visibility: hidden.
To make this work in the display list, items get wrapped in transform items. Specifically, after we've built the display list for a preserve3d frame (preserve3d makes the frame transformed, so it's a stacking context) we determine if every item is a participant in that preserve3d context or a non-participant. A participant is a transform or perspective item for a frame that is in the same preserve3d context. A non-participant is anything else. Non-participants get wrapped in a new transform item whose frame is the current preserve3d frame and the transform item gets tagged as a transform seperator.
We defined preserve3d leaf frame above (the last frame that is in the preserve3d context). We define a preserve3d leaf transform display item as one where the frame is a preserve3d leaf, or the item is tagged as a transform seperator (note the small difference). This makes sense since the display item contained in the transform seperator item is not part of the preserve3d context.
Thus for every preserve3d context there is a set of leaf transform display items that contain all of the content to draw. Every other item in the context that is above these leaf transform items is a transform item of a frame in the preserve3d context that is not a leaf transform item. And below these leaf transform items is the display items for the content to draw. We don't need to worry about these non-leaf transform items because whenever we get the transform for a leaf transform item we accumulate the whole transform from the root of the preserve3d context down to the leaf item.
Hit testing is done by first finding this set of leaf transform items and then iterating over them in the usual way.
However there is a subtle issue with this: backface-visibility: hidden frames are combines3d (and thus part of the preserve3d context) but are not transformed, so they don't generate transform items. So when doing the wrapping process from above they are considered to be non-participants and they get wrapped with a transform seperator item, and that transform seperator item is what is considered the leaf. This setup works fine for most things but it does not work fine when hittesting the backface-visibility: hidden leaf. Because the backface-visibility: hidden check happens in the transform item hittest function, and there is no transform item for the backface-visibility: hidden frame. The transform item knows that the transform is showing the backface, but it's frame is not backface-visibility: hidden. And the item for the backface-visibility: hidden frame is not a transform item, so it doesn't know the current transform.
To fix this we put a little state in the hit testing state that tracks if the transform shows the backface. We reset this bit whenever we actually exit the preserve3d context (by checking if the item is no longer combines3d). And then when hittesting the item, the item can combine that state with its local backface-visibility to determine if it is hit or not.
Differential Revision: https://phabricator.services.mozilla.com/D252978
- Expand `SizeToAvailSize()` at callsites since it is only used twice, and the
callsites already have called `SetOverflowAreasToDesiredBounds()`.
- Revise obsolete comment for `nsLeafFrame`.
- Remove redundant `virtual` keyword.
Differential Revision: https://phabricator.services.mozilla.com/D215999
`nsIFrame` already provides `GetIntrinsicSize()` for subclasses to override.
Therefore, `nsLeafFrame` doesn't need to introduce another version for its
subclasses.
This patch (hopefully) shouldn't change the behavior.
Differential Revision: https://phabricator.services.mozilla.com/D215998
`nsIFrame::GetCursor()` can never return `Nothing()` after bug 1687239, which
removes `nsPluginFrame`. Therefore `mLastFrameConsumedSetCursor` in
`EventStateManager` can never be true.
Differential Revision: https://phabricator.services.mozilla.com/D200890
We have more readable and faster versions (that just omit the namespace
arg).
Mostly done via sed, with a couple helpers to use the faster lookups
where possible.
Differential Revision: https://phabricator.services.mozilla.com/D181795
In the description of the mTruncated bit, its purpose is the same as calling
SetInlineLineBreakBeforeAndReset(). We've removed all its usages in previous
patches, so the bit is no longer needed.
Differential Revision: https://phabricator.services.mozilla.com/D151461
These are only used for frameset painting and the non-e10s <select>
dropdown focus codepath. We have other more appropriate standard
colors for this.
Differential Revision: https://phabricator.services.mozilla.com/D129992
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
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
Actually, there's not so much we can improve right now, in the sense
that:
* We need the ::-moz-page-content pseudo-element to be able to set
`display` on the page, since that's a style rule rather than a @page
rule. We could get away without it.
* Keeping the current code-path (slightly cleaned up) is less code, for
now at least. We can have a separate code-path or what not that
actually performs the @page rule selector-matching and what not if
needed when we get to named pages or other page selectors. Selectors
like :first should be pretty trivial to implement, actually.
We make some paged mode anon boxes non-inheriting anon boxes. This
allows us to share the styles and is generally nicer. They don't need to
inherit from anywhere.
We could remove the origin handling and don't look at UA rules or what
not, but it seems pretty harmless to do that.
We also fix the name of the pseudo-elements to match the capitalization.
Differential Revision: https://phabricator.services.mozilla.com/D104772