* Make non-menulist popups just absolute positioned top-layer items.
* Simplify menulist popups to just be static-positioned items under
nsMenuFrame.
We need to keep kPopupList only for nsMenuFrame. In the future it can be
removed, see TODO in xul.css
Differential Revision: https://phabricator.services.mozilla.com/D161404
GetViewManager() may return null if the relevant presshell is being destroyed.
This is a guess fix, but the crash reports seem to hint about this issue.
Differential Revision: https://phabricator.services.mozilla.com/D161587
* Make non-menulist popups just absolute positioned top-layer items.
* Simplify menulist popups to just be static-positioned items under
nsMenuFrame.
We need to keep kPopupList only for nsMenuFrame. In the future it can be
removed, see TODO in xul.css
Differential Revision: https://phabricator.services.mozilla.com/D161404
With doing SnapCoord we mis-consider non-scrollable frames as scrollable in APZ,
thus it causes unexpected overscroll gutters.
Depends on D161417
Differential Revision: https://phabricator.services.mozilla.com/D161419
With onload event handler this reftest isn't in a good state, in other words
it's not stable on all platforms. Specifically on Windows 10 this testing html
is rendered at 1px upper than the reference html without pixel snapping on the
main-thread. Interestingly this reftest doesn't fail at least on my Windows 11
laptop without the pixel snapping. So there's something that metrics are timing
specific (e.g. font loading) to make this test flaky.
Differential Revision: https://phabricator.services.mozilla.com/D161417
With doing SnapCoord we mis-consider non-scrollable frames as scrollable in APZ,
thus it causes unexpected overscroll gutters.
Differential Revision: https://phabricator.services.mozilla.com/D161419
With onload event handler this reftest isn't in a good state, in other words
it's not stable on all platforms. Specifically on Windows 10 this testing html
is rendered at 1px upper than the reference html without pixel snapping on the
main-thread. Interestingly this reftest doesn't fail at least on my Windows 11
laptop without the pixel snapping. So there's something that metrics are timing
specific (e.g. font loading) to make this test flaky.
Differential Revision: https://phabricator.services.mozilla.com/D161417
* Make non-menulist popups just absolute positioned top-layer items.
* Simplify menulist popups to just be static-positioned items under
nsMenuFrame.
We need to keep kPopupList only for nsMenuFrame. In the future it can be
removed, see TODO in xul.css
Differential Revision: https://phabricator.services.mozilla.com/D161404
FontFaceSetWorkerImpl::GetURLExtraData should generally not return a
null pointer, but if it failed to initialize because the worker was
shutdown during FontFaceSetWorkerImpl initialization, then it may never
be created. This patch ensures we check for this race and handle it
appropriately.
Differential Revision: https://phabricator.services.mozilla.com/D161476
Instead of imposing the min-width as a max-size, make prefwidth act as
it should (as suggesting a preferred width, but with min-content as a
minimum).
This can be reproduced locally by applying a patch like:
```
diff --git a/toolkit/profile/content/profileSelection.xhtml b/toolkit/profile/content/profileSelection.xhtml
index 3dd1c864f79f1..7e8cbf8ce8c3e 100644
--- a/toolkit/profile/content/profileSelection.xhtml
+++ b/toolkit/profile/content/profileSelection.xhtml
@@ -17,7 +17,7 @@
data-l10n-id="profile-selection-window"
orient="vertical"
prefwidth="min-width"
- style="min-width: 30em;"
+ style="min-width: 10em;"
onload="startup();">
<dialog id="profileWindow"
buttons="accept,cancel"
```
Before patch, stuff overflowed. This patch guarantees that everything is
on-screen.
Differential Revision: https://phabricator.services.mozilla.com/D161229
Instead of imposing the min-width as a max-size, make prefwidth act as
it should (as suggesting a preferred width, but with min-content as a
minimum).
This can be reproduced locally by applying a patch like:
```
diff --git a/toolkit/profile/content/profileSelection.xhtml b/toolkit/profile/content/profileSelection.xhtml
index 3dd1c864f79f1..7e8cbf8ce8c3e 100644
--- a/toolkit/profile/content/profileSelection.xhtml
+++ b/toolkit/profile/content/profileSelection.xhtml
@@ -17,7 +17,7 @@
data-l10n-id="profile-selection-window"
orient="vertical"
prefwidth="min-width"
- style="min-width: 30em;"
+ style="min-width: 10em;"
onload="startup();">
<dialog id="profileWindow"
buttons="accept,cancel"
```
Before patch, stuff overflowed. This patch guarantees that everything is
on-screen.
Differential Revision: https://phabricator.services.mozilla.com/D161229
This shouldn't change any behavior, it just refactors the code to use a shared string-cropping function.
It's still an approximation, and theoretically could be quite inaccurate in the case of complex text shaping,
but in practice is "good enough" for the kind of UI-element display where we use it.
Differential Revision: https://phabricator.services.mozilla.com/D161328
This is basically copied from how nsTextBoxFrame handles truncation, and avoids breaking surrogate pairs
(or other grapheme clusters such as base character + diacritic). It's still a "poor man's" version
of truncation that doesn't correctly measure the string in the presence of complex font shaping.
Longer-term, we should unify all this kind of truncation/ellipsizing of labels etc to use an implementation
based on CSS text-overflow, but that doesn't yet support center-cropping so it's not a drop-in replacement.
So I think we should do this as an interim measure to fix the most egregious brokenness, and make treeview
cells at least work similarly to textbox labels.
Tested manually; seems difficult to do automated tests as it'd be sensitive to exact glyph metrics.
Differential Revision: https://phabricator.services.mozilla.com/D161251
[Int]CoordTyped no longer inherits Units because otherwise
instances of [Int]IntPointTyped may get one Base subobject because
it inherits Units, and others because of BasePoint's Coord members,
which end up increasing the [Int]CoordTyped's objects size (since
according to the ISO C++ standard, different Base subobject are
required to have different addresses).
Differential Revision: https://phabricator.services.mozilla.com/D160713
Two tweaks:
* Use nsPresContext::Medium to decide whether to start transitions.
This catches both the print emulation and the before/afterprint event
dispatching code too, which is desirable.
* Don't clone transition effects for print docs. This seems to match
other browsers (click "trigger transition", then Ctrl+P in Chromium
for example).
Move our existing css-animations tests to WPT. They were written for
compat with other browsers so we want to know if other browsers behave
differently.
Differential Revision: https://phabricator.services.mozilla.com/D161086
Before this patch, we implicitly invoke the default constructor for this
member-var, and then immediately stomp on the results with a reassignment.
This patch avoids that unnecessary usage of the default constructor, saving
ourslves a bit of work and getting this member-var more directly into a
fully-initialized/valid state.
Differential Revision: https://phabricator.services.mozilla.com/D159903
We want to encourage extension developers to use `browser_specific_settings` instead of `applications`, which will be unsupported in Manifest Version 3+. This patch makes sure test manifests in m-c won't cause any issues in the future.
Depends on D160541
Differential Revision: https://phabricator.services.mozilla.com/D160668
No need to be an out of band member function given the only callers are
in flex / grid code.
I was looking at this in the context of bug 1798396. This probably
doesn't matter for PGO, but it being a static method helps reason about
the flags being the same for all items.
Differential Revision: https://phabricator.services.mozilla.com/D161102
This needs to bypass the cache on ServoStyleSet when looking up styles with
named pages. We could possibly cache the last used named page style, which
would avoid extra style calculations for multiple sequential pages with the
same page name, but for now the cache is just ignored.
Differential Revision: https://phabricator.services.mozilla.com/D160976
This needs to bypass the cache on ServoStyleSet when looking up styles with
named pages. We could possibly cache the last used named page style, which
would avoid extra style calculations for multiple sequential pages with the
same page name, but for now the cache is just ignored.
Differential Revision: https://phabricator.services.mozilla.com/D160976
SetFrame() is equivalent to `operator=`, so external callers can use `operator=`
instead. For the two callers wanting to set `nsFrameList` to `AbsoluteFrameList`
in `nsCSSFrameConstructor`, removing SetFrame() disallows it. However, we can
easily change the declaration from `nsFrameList` to a `AbsoluteFrameList` to
resolve the problem.
Differential Revision: https://phabricator.services.mozilla.com/D160840
The removed SetFrames() is slow (it traverses the next sibling chain to find the
last sibling) and has only one caller. Let's remove it.
The rewrite in nsInlineFrame::PullOneFrame() doesn't change behavior because
`frame` is just removed from the overflow list, so it won't have any next
sibling. We are creating a frame list containing only `frame`.
Differential Revision: https://phabricator.services.mozilla.com/D160839
It's possible to change the timeline if the animation is in pending. So
we still need an animation tracker to track the scroll-linked
animations. Besides, per the spec, we should keep this animation in
pending if its timeline is inactive. So in this patch, we always put the
scroll-linked animations into ScrollTimelineAnimationTracker, and if we
change the timeline but the animation is still in pending, we move the
animation into the correct animation tracker if needed.
Using two different animation trackers because we would like to trigger
scroll-linked animations after frame construction and reflow,
and don't want to ensure the paint is scheduled.
Note:
1. All tests in scroll-timeline-dynamic.tentative.html are failed. We
will fix them in Bug 1774275.
2. Drop `animation-duration: infinite` from
progress-based-animation-animation-longhand-properties.tentative.html,
because infinite is not defined in animation-duration in [css-animations-1].
Differential Revision: https://phabricator.services.mozilla.com/D159650
The assertion is valid, but fixing it would be a bit of work (bug 1798240),
so now we degrade the assertion to make it harmless on fuzzers works.
Differential Revision: https://phabricator.services.mozilla.com/D160742
The @page rule may contain both 'page-orientation' and 'size' properties. The
'size' property can contain an orientation component which was being
represented as 'PageOrientation' prior to this patch. This patch changes that
to 'PageSizeOrientation' so that 'PageOrientation' can be used for
'page-orientation' in a subsequent patch.
Differential Revision: https://phabricator.services.mozilla.com/D160790
It's possible to change the timeline if the animation is in pending. So
we still need an animation tracker to track the scroll-linked
animations. Besides, per the spec, we should keep this animation in
pending if its timeline is inactive. So in this patch, we always put the
scroll-linked animations into ScrollTimelineAnimationTracker, and if we
change the timeline but the animation is still in pending, we move the
animation into the correct animation tracker if needed.
Using two different animation trackers because we would like to trigger
scroll-linked animations after frame construction and reflow,
and don't want to ensure the paint is scheduled.
Note:
1. All tests in scroll-timeline-dynamic.tentative.html are failed. We
will fix them in Bug 1774275.
2. Drop `animation-duration: infinite` from
progress-based-animation-animation-longhand-properties.tentative.html,
because infinite is not defined in animation-duration in [css-animations-1].
Differential Revision: https://phabricator.services.mozilla.com/D159650
certManager is the only thing using it (both here and in comm-central,
excluding suite/).
There are better ways to do it generally, so just remove it from elsewhere.
Differential Revision: https://phabricator.services.mozilla.com/D160720
This patch doesn't impact behavior.
The new const annotations will help to simplify reasoning about these various
helper classes & what states they could possibly be in.
Differential Revision: https://phabricator.services.mozilla.com/D160695
This patch doesn't impact behavior; it's just adding an annotation to activate
a static analysis check for various classes.
The annotation gives us some confidence that these instances are tightly scoped
to a particular function-call. This helps reduce concerns about to-what-extent
the affected classes might need to worry about the lifetimes of the objects
pointed to by their member-vars.
The specific classes I'm annotating are:
- gfxTextRunDrawCallbacks and PaintTextParams, both of which have multiple
subclasses, all of which will automatically inherit this annotation and
benefit from it.
- TextFrameIterator and CharIterator, two local utility classes in
SVGTextFrame.cpp.
Differential Revision: https://phabricator.services.mozilla.com/D160694
Before this patch, we had two `checkVisibilty` methods on the
nsISelectionController interface, backed by several layers of implementation,
ultimately backed by a single function on nsTextFrame (which didn't actually
do anything meaningful with any of the parameters).
As it turns out, this API only had one caller, in HTMLEditUtils.cpp.
This patch converts that caller to directly query nsTextFrame (if the given
node's primary frame is indeed a nsTextFrame). The direct function-call is
renamed to HasVisibleText(), to be a bit clearer about it being text-specific
and also to avoid confusion with the (unrelated) recently-specified HTML
checkVisibility() API.
With these changes, we can remove the API from the nsISelectionController
interface and its implementations.
This patch also updates the HTMLEditUtils::IsInVisibleTextFrames documentation
(with s/all/any/) to reflect the reality of what the nsTextFrame impl actually
does.
Differential Revision: https://phabricator.services.mozilla.com/D160563
C++20 deprecates some operations between enums and floating point types:
https://clang.llvm.org/docs/DiagnosticsReference.html#wenum-float-conversion
dom/canvas/CanvasRenderingContext2D.cpp:4743:58 [-Wenum-float-conversion] arithmetic between enumeration type 'VideoInfo::Rotation' and floating-point type 'double'
dom/events/EventStateManager.cpp:6656:35 [-Wenum-float-conversion] comparison of floating-point type 'double' with enumeration type 'mozilla::EventStateManager::(unnamed enum at dom/events/EventStateManager.h:342:3)'
dom/events/EventStateManager.cpp:6664:35 [-Wenum-float-conversion] comparison of floating-point type 'double' with enumeration type 'mozilla::EventStateManager::(unnamed enum at dom/events/EventStateManager.h:342:3)'
gfx/thebes/gfxTextRun.cpp:2992:24 [-Wenum-float-conversion] comparison of floating-point type 'gfxFloat' (aka 'double') with enumeration type 'gfxFontGroup::(unnamed enum at gfx/thebes/gfxTextRun.h:1035:3)'
layout/generic/nsVideoFrame.cpp:59:58 [-Wenum-float-conversion] arithmetic between enumeration type 'VideoInfo::Rotation' and floating-point type 'double'
layout/painting/nsCSSRenderingBorders.cpp:2752:27 [-Wenum-float-conversion] arithmetic between enumeration type 'mozilla::Corner' and floating-point type 'double'
Differential Revision: https://phabricator.services.mozilla.com/D158867
This patch doesn't change behavior. The changes were auto-generated by the
following command:
./mach clang-format -p layout/
Differential Revision: https://phabricator.services.mozilla.com/D160552
It was made a bitfield so that we could include style. But then style
containment was removed and the bitfield keeps causing us to do wrong
check (since INLINE_SIZE intersects SIZE).
So just make it an enum. This causes a progression and a test that
failed now times out (which is a pre-existing issue, just like the
pseudo-elements test that times out).
Differential Revision: https://phabricator.services.mozilla.com/D160371
Looks like this test used to catastrophically fail on this platform, per this
annotation; and that failure seems to have been fixed by bug 1792257.
DONTBUILD when this lands on autoland, because it won't make a difference
since we don't seem to schedule tasks for this platform on that branch.
Differential Revision: https://phabricator.services.mozilla.com/D160390
It was made a bitfield so that we could include style. But then style
containment was removed and the bitfield keeps causing us to do wrong
check (since INLINE_SIZE intersects SIZE).
So just make it an enum. This causes a progression and a test that
failed now times out (which is a pre-existing issue, just like the
pseudo-elements test that times out).
Differential Revision: https://phabricator.services.mozilla.com/D160371
`SharedSubResourceCacheLoadingValueBase` define the `mIsCancelled` field which
is overloaded by `SheetLoadData`. This patch moves all fields including
`mIsLoading` to `SheetLoadData` and add accessors to access these fields.
Differential Revision: https://phabricator.services.mozilla.com/D160226
This patch doesn't change behavior.
AbsoluteFrameList is a derived class of nsFrameList, so we change it a move-only
class in order to nsFrameList move-only in Part 3.
Some detail of this patch:
- Define move constructor and move assignment operator for AbsoluteFrameList.
This effectively disables the auto generated copy constructor and copy
assignement operator.
- Initialize nsFrameConstructorSaveState's member variables in class definition,
and remove its constructor.
- Remove `mSavedFixedList` since we can rewire the logic in
`~nsFrameConstructorSaveState` and `PushAbsoluteContainingBlock()` to make it
redundant.
- Make self-assignment correct in nsFrameList's move assignment operator.
Differential Revision: https://phabricator.services.mozilla.com/D160014
This patch doesn't change behavior, and eliminates copy construction of
nsFrameList via utilizing const-references to store the return value of
`GetChildList()`.
nsFrameList::Clone() is added in case the caller wants a copy of a list.
This is the first step toward making nsFrameList a move-only class.
Differential Revision: https://phabricator.services.mozilla.com/D160013
FontFaceSet and FontFaceSetImpl maintain independent but matching lists
of FontFace and FontFaceImpl objects respectively. When
FontFaceSet::Delete is called, we should remove from the FontFaceSet
first instead of the FontFaceSetImpl because FontFaceSetImpl::Delete
calls back into FontFaceSet to update its status if the removed FontFace
was the last object holding it back from a status change.
Differential Revision: https://phabricator.services.mozilla.com/D159857
Native behaviour on MacOS dictates one whitespace being removed after double-clicking a word and pressing delete.
This behaviour is achieved by saving the information that the selection is created by doubleclick to the `nsFrameSelection`
and using it in the `DeleteRangeTransaction`, where the range is extended by one whitespace character before or after the range.
Differential Revision: https://phabricator.services.mozilla.com/D159613
This patch doesn't affect behavior.
The removed const_casts are unnecessary; they're in a non-const function, so
'this' is already a non-const type.
Depends on D160101
Differential Revision: https://phabricator.services.mozilla.com/D160102
As noted in nsTArray.h, "nsTArray, CopyableTArray, AutoTArray [...] are
infallible by default" (unless you explicitly pass mozilla::fallible, and we
don't do that here.)
So, there's no need to check for failure.
Differential Revision: https://phabricator.services.mozilla.com/D160099
This patch doesn't change behavior.
AbsoluteFrameList is a derived class of nsFrameList, so we change it a move-only
class in order to nsFrameList move-only in Part 3.
Some detail of this patch:
- Define move constructor and move assignment operator for AbsoluteFrameList.
This effectively disables the auto generated copy constructor and copy
assignement operator.
- Initialize nsFrameConstructorSaveState's member variables in class definition,
and remove its constructor.
- Remove `mSavedFixedList` since we can rewire the logic in
`~nsFrameConstructorSaveState` and `PushAbsoluteContainingBlock()` to make it
redundant.
- Make self-assignment correct in nsFrameList's move assignment operator.
Differential Revision: https://phabricator.services.mozilla.com/D160014
This patch doesn't change behavior, and eliminates copy construction of
nsFrameList via utilizing const-references to store the return value of
`GetChildList()`. This is the first step toward making nsFrameList a move-only
class.
Differential Revision: https://phabricator.services.mozilla.com/D160013
This patch doesn't change behavior.
This no-arg constructor only had one inadvertent usage -- it was used to
default-initialize one of ClusterIterator's member-vars, just before we
reassign it to something else in the constructor body. (I'm fixing that here
by explicitly constructing that member-var up-front in the init list, rather
than in the constructor body.)
Depends on D159902
Differential Revision: https://phabricator.services.mozilla.com/D159903
This patch shouldn't change behavior.
This lets us remove the rarely-used no-arg constructor for gfxSkipCharsIterator
in the next patch. (That constructor was an alternate representation of an
invalid gfxSkipCharsIterator; but the Maybe<> representation added here makes
things a bit easier to reason about.)
Differential Revision: https://phabricator.services.mozilla.com/D159902
This was used to prevent reflows due to popuppositioned events during
view transitions.
The previous patch should've prevented the popuppositioned events to
begin with, plus we no longer use arrows that need positioning etc,
which means we shouldn't be triggering the reflows anyways.
Since this is the only consumer of autoPosition = true/false, we can
remove the code supporting it. It's a bit bogus as per the commit
message of the previous patch and, while fixable, it doesn't seem worth
fixing if we can just get rid of it.
Depends on D159936
Differential Revision: https://phabricator.services.mozilla.com/D159937
By using delegatesanchor="true", we delegate the anchor node to the
first in-flow box (that is the icon), simplifying a lot of the
hard-coded margins in the CSS.
Do that, plus make menupopup[type="arrow"] work consistently, to
simplify the styling of the bookmarks popup a bit.
Differential Revision: https://phabricator.services.mozilla.com/D158569
This extends the code to deal with sibling invalidation to handle the
case where the flat tree doesn't match the DOM tree. In the test-case
for example, dom is:
* details
* summary id=a
* summary
But flat tree is:
* details
* slot
* summary id=a
* slot
* summary
Differential Revision: https://phabricator.services.mozilla.com/D159150
Why the fuzziness is intermittent is beyond me, but the idea of the test is to stress preicsion issues with a scaling transform applied to an SVG rect so it is prone to result in small difference on the antialiased edges.
Differential Revision: https://phabricator.services.mozilla.com/D159501
imgDimension comes directly from the size of the frame, which has overflowed into the negatives. The code wants value to be positive but hasn't considered that imgDimension can be negative.
Differential Revision: https://phabricator.services.mozilla.com/D159138
This improves the setup so that whenever there are only idle/deferred tasks, we can run low priority tasks immediately.
Manual testing shows that this way we get couple of more ticks every now and then.
Without this patch we'd rely on normal priority tasks, but since there might be multiple of those pending, ShouldGiveNonVsyncTasksMoreTime() would
return true.
So, low priority tasks are effectively "run when the queue is otherwise empty (but idle-type of tasks are still special)".
Differential Revision: https://phabricator.services.mozilla.com/D159583
There are (at least) two different cases leading to lower fps.
Motionmark seems to hit FinishedWaitingForTransaction() case rather often, but the testcase in the bug
hits the other case more often.
Differential Revision: https://phabricator.services.mozilla.com/D159260
This commit moves crash tests from dom/mathml and layout/mathml into
testing/web-platform/tests/mathml/crashtests/mozilla, trying to do only
minimal changes (i.e. use 'test-wait' instead of 'reftest-wait' and
fix whitespace errors). lint errors are ignored for usage of
setTimeout as well as the invalid XML file testing bug 289180.
Regarding 400157.xhtml, it uses special powers to trigger a
zoom changes. It could probably be tweaked to convert to a mochitest or
rely on a different dynamic change. However, this was testing a crash for
the `<mfenced>` element in nsMathMLmfencedFrame whose code has been
completely removed, so it's now hard to reproduce the original crash.
Also that makes the test no longer very useful, so we just remove it.
Differential Revision: https://phabricator.services.mozilla.com/D159491
This commit moves crash tests from dom/mathml and layout/mathml into
testing/web-platform/tests/mathml/crashtests/mozilla, trying to do only
minimal changes (i.e. use 'test-wait' instead of 'reftest-wait').
The exception is 400157.xhtml which uses special powers to trigger a
zoom changes. It could probably be tweaked to convert to a mochitest or
rely on a different dynamic change. However, this was testing a crash for
the `<mfenced>` element in nsMathMLmfencedFrame whose code has been
completely removed, so it's now hard to reproduce the original crash.
Also that makes the test no longer very useful, so we just remove it.
Differential Revision: https://phabricator.services.mozilla.com/D159491
nsISupports.h includes nsISupportsBase.h, so it should be equivalent.
In the next patch, I'm changing things so that nsISupports is defined in
nsISupports.h instead of nsISupportsBase.h, and deleting the latter, so
this change will be needed anyways. I'm guessing people were using IWYU
or something like that.
Differential Revision: https://phabricator.services.mozilla.com/D159169
The CSS Contain specification says that descendants of elements with
`content-visibility: hidden` that are in the top layer should not
generate boxes. Implementing this would lead to many open questions that
are currently not answered by the specification. While these questions
are hashed out in the specification, ensure that these top layer
elements do not generate display list items.
Differential Revision: https://phabricator.services.mozilla.com/D159051
This is not easy to test precisely. What the width attribute / property
set is the preferred size, but the boxes can flex expanding that, which
may cause jumps when dragging. This is easy to see with the previous
patches on the urlbar / searchbar split.
While at it make the flex and xul code-paths more similar.
Differential Revision: https://phabricator.services.mozilla.com/D159081
This trivially enhances splitters so that resizing a single element,
which is a common thing to do in our front-end code, is easier.
Differential Revision: https://phabricator.services.mozilla.com/D159069