Manual changes to make all refcounted types be marked as `nullable` after the
changes in part 1a. This was done without any investigation into whether the
actual types want to be nullable, in order to avoid code changes.
Differential Revision: https://phabricator.services.mozilla.com/D168889
- Create wheel transactions for wheel events handled by APZ.
- Group wheel events with the current wheel transaction, so that all
wheel events in a wheel transaction are fired to the same element.
- Store the current event target for the first event in a wheel
transaction to be used for subsequent events.
- Add the dom.event.wheel-event-groups.enabled preference as a feature
flag for this behavior.
Differential Revision: https://phabricator.services.mozilla.com/D163484
The a11y module wants to traverse frames in native anonymous subtrees.
Therefore, this patch adds new option for allowing it, makes
`nsIFrame::GetFrameFromDirection` check it before comparing native anonymous
subtree root nodes, and makes `HyperTextAccessible::FindOffset` use the
option.
Differential Revision: https://phabricator.services.mozilla.com/D172759
The constructor of `nsPeekOffsetStruct` and `nsIFrame::GetFrameFromDirection`
take too many `bool` arguments. Therefore, adding new `bool` arguments does
not make sense. Now, we have a useful `mozilla:EnumSet` class to treat them
with an `enum class`. Therefore, let's change `nsPeekOffsetStruct` with it.
Differential Revision: https://phabricator.services.mozilla.com/D172758
It's called by `PeekOffsetFor*` and `GetPrevNextBidiLevels`, so it's used for
considering whether to put caret or move a selection range boundary.
Therefore, it should treat nodes which can be managed by `Selection` as
selectable. In theory, even if a native anonymous subtree does not have
an independent selection, its content nodes should not be the container of
the selection range boundaries of selection outside the subtree since
Selection API shouldn't expose nodes in native anonymous subtrees. Therefore,
it can simply treat content nodes in different anonymous subtrees are not
selectable.
Note that it's not standardized that how `Selection.modify` works with various
content nodes.
https://w3c.github.io/selection-api/#dom-selection-modify
And also Chrome cannot cross generated content like form controls with this API.
This could cause web-compat issues, but it does not make sense for caret
navigation, and anyway out of scope of this bug. Therefore, this patch just
adds the crash test.
Differential Revision: https://phabricator.services.mozilla.com/D172204
The a11y module wants to traverse frames in native anonymous subtrees.
Therefore, this patch adds new option for allowing it, makes
`nsIFrame::GetFrameFromDirection` check it before comparing native anonymous
subtree root nodes, and makes `HyperTextAccessible::FindOffset` use the
option.
Differential Revision: https://phabricator.services.mozilla.com/D172759
The constructor of `nsPeekOffsetStruct` and `nsIFrame::GetFrameFromDirection`
take too many `bool` arguments. Therefore, adding new `bool` arguments does
not make sense. Now, we have a useful `mozilla:EnumSet` class to treat them
with an `enum class`. Therefore, let's change `nsPeekOffsetStruct` with it.
Differential Revision: https://phabricator.services.mozilla.com/D172758
It's called by `PeekOffsetFor*` and `GetPrevNextBidiLevels`, so it's used for
considering whether to put caret or move a selection range boundary.
Therefore, it should treat nodes which can be managed by `Selection` as
selectable. In theory, even if a native anonymous subtree does not have
an independent selection, its content nodes should not be the container of
the selection range boundaries of selection outside the subtree since
Selection API shouldn't expose nodes in native anonymous subtrees. Therefore,
it can simply treat content nodes in different anonymous subtrees are not
selectable.
Note that it's not standardized that how `Selection.modify` works with various
content nodes.
https://w3c.github.io/selection-api/#dom-selection-modify
And also Chrome cannot cross generated content like form controls with this API.
This could cause web-compat issues, but it does not make sense for caret
navigation, and anyway out of scope of this bug. Therefore, this patch just
adds the crash test.
Differential Revision: https://phabricator.services.mozilla.com/D172204
The a11y module wants to traverse frames in native anonymous subtrees.
Therefore, this patch adds new option for allowing it, makes
`nsIFrame::GetFrameFromDirection` check it before comparing native anonymous
subtree root nodes, and makes `HyperTextAccessible::FindOffset` use the
option.
Depends on D172758
Differential Revision: https://phabricator.services.mozilla.com/D172759
The constructor of `nsPeekOffsetStruct` and `nsIFrame::GetFrameFromDirection`
take too many `bool` arguments. Therefore, adding new `bool` arguments does
not make sense. Now, we have a useful `mozilla:EnumSet` class to treat them
with an `enum class`. Therefore, let's change `nsPeekOffsetStruct` with it.
Differential Revision: https://phabricator.services.mozilla.com/D172758
It's called by `PeekOffsetFor*` and `GetPrevNextBidiLevels`, so it's used for
considering whether to put caret or move a selection range boundary.
Therefore, it should treat nodes which can be managed by `Selection` as
selectable. In theory, even if a native anonymous subtree does not have
an independent selection, its content nodes should not be the container of
the selection range boundaries of selection outside the subtree since
Selection API shouldn't expose nodes in native anonymous subtrees. Therefore,
it can simply treat content nodes in different anonymous subtrees are not
selectable.
Note that it's not standardized that how `Selection.modify` works with various
content nodes.
https://w3c.github.io/selection-api/#dom-selection-modify
And also Chrome cannot cross generated content like form controls with this API.
This could cause web-compat issues, but it does not make sense for caret
navigation, and anyway out of scope of this bug. Therefore, this patch just
adds the crash test.
Differential Revision: https://phabricator.services.mozilla.com/D172204
The expectations in page-name-propagated-003.html have turned out to be wrong
now that we have more correct abspos support.
We also need to check for placeholders in block reflow to actually support
named pages causing breakpoints where in-flow frames meet placeholders for out-
of-frame siblings.
Differential Revision: https://phabricator.services.mozilla.com/D170821
We are doing the following things here:
1. Rename ScrollTimelineSet to ProgressTimelineScheduler because this
class is used to schedule animations with progress timelines, including
scroll timelines and view timelines.
2. Drop the element property usage and let ElementAnimationData store
ProgressTimelineScheduler.
3. We avoid using the generated content in ScrollTimeline::Scroller.
Instead, we use a pair of Element and PseudoStyleType to represent
ScrollTimeline::Scroller.
We hit the assertion because the generatd content may change and so we
shouldn't use it as the ScrollTimeline::Scroller.
Differential Revision: https://phabricator.services.mozilla.com/D172610
The underlying issue here is an invalidation bug with XUL layout. When a
popup opens, we try to lay it out at full size, then post a reflow
callback to constrain it.
There's an intermediate step there where the popup might remain at full
size, and the constraining operates directly on mRect, which isn't quite
sound and doesn't update the scrollport of descendants.
Make nsMenuPopupFrame inherit from nsBlockFrame instead, doing
potentially two layout passes when constrained.
This fixes the issue at hand, and removes XUL layout from menu popups,
so it's a win-win.
To make reasoning about it a bit easier, factor out a bunch of the XUL
positioning code to be const. The mutation of mRect etc which was going
on otherwise was pretty hard to reason about.
Differential Revision: https://phabricator.services.mozilla.com/D170368
Make use of the new changes in the cssparser that allows 'none' keywords
in color components where allowed. We store the none values as 0.0 (as
per the spec) and mark the components with the flags. This way we don't
have to check anything on the components before doing calculations.
As this is the last part intended to be released for the new [color-4]
changes, I've also enabled the changes on nightly.
Differential Revision: https://phabricator.services.mozilla.com/D170208
nsBlockFrame clears its line cursor at the beginning of reflow.
This test-case triggers a mix of conditions where a line iterator /
cursor can be created in the middle of reflow because of
nsListControlFrame::DidReflow triggering scrolling:
nsLineList_const_iterator::operator=
nsLineIterator::nsLineIterator
nsBlockFrame::GetLineIterator
nsIFrame::GetFrameFromDirection
nsFrameSelection::GetPrevNextBidiLevels
nsFrameSelection::GetPrevNextBidiLevels
nsCaret::GetCaretFrameForNodeOffset
nsCaret::GetFrameAndOffset
mozilla::AccessibleCaretManager::IsCaretDisplayableInCursorMode
mozilla::AccessibleCaretManager::UpdateCaretsForCursorMode
mozilla::AccessibleCaretManager::UpdateCarets
mozilla::AccessibleCaretManager::OnScrollPositionChanged
mozilla::AccessibleCaretEventHub::NoActionState::OnScrollPositionChanged
mozilla::AccessibleCaretEventHub::ScrollPositionChanged
nsDocShell::NotifyScrollObservers
mozilla::ScrollFrameHelper::ScrollToImpl
mozilla::ScrollFrameHelper::CompleteAsyncScroll
mozilla::ScrollFrameHelper::ScrollToWithOrigin
mozilla::ScrollFrameHelper::ScrollTo
nsHTMLScrollFrame::ScrollTo
non-virtual thunk to nsHTMLScrollFrame::ScrollTo
ScrollToShowRect
mozilla::PresShell::ScrollFrameIntoView
nsListControlFrame::ScrollToFrame
nsListControlFrame::ScrollToIndex
nsListControlFrame::ResetList
nsListControlFrame::DidReflow
nsLineLayout::ReflowFrame
nsBlockFrame::ReflowInlineFrame
nsBlockFrame::DoReflowInlineFrames
nsBlockFrame::ReflowInlineFrames
nsBlockFrame::ReflowLine
nsBlockFrame::ReflowDirtyLines
nsBlockFrame::Reflow
nsBlockReflowContext::ReflowBlock
nsBlockFrame::ReflowBlockFrame
nsBlockFrame::ReflowLine
Move the scrolling to happen at a stable state instead.
Differential Revision: https://phabricator.services.mozilla.com/D171998
This flag is only using in one place. Here is accidentally gets put into a variable that is only to be used with imgIContainer flags. They are just untyped uint32_t which allows this to happen. Noticed this by inspection while doing something else.
Differential Revision: https://phabricator.services.mozilla.com/D171826
In a setup with:
<hbox>
<something flex="1"/>
<something-else/>
</hbox>
Before bug 1822131 <something flex="1"> ended up with flex-basis: auto,
but was the only thing able to shrink, so <something-else> stayed the
same size.
After that bug however <something-else> is able to shrink too, so both
elements shrink. This wouldn't happen if flex="1" actually worked like
flex: 1 does.
However flex: 1 causes stuff like explicit main sizes to be
(effectively) ignored, so we need to fix up a few cases where now we'd
start flexing too much. For that, add a debug assert to
nsFlexContainerFrame to catch the would-be behavior changes here.
For the most part they're actually no-op since they're setting tiny
sizes, but preferences and devtools needed a couple real fixes.
The profile selection spacer is useless (zero-size).
Hopefully the last xul.css change I need to do :')
Differential Revision: https://phabricator.services.mozilla.com/D172704
Make use of the new changes in the cssparser that allows 'none' keywords
in color components where allowed. We store the none values as 0.0 (as
per the spec) and mark the components with the flags. This way we don't
have to check anything on the components before doing calculations.
As this is the last part intended to be released for the new [color-4]
changes, I've also enabled the changes on nightly.
Differential Revision: https://phabricator.services.mozilla.com/D170208
There are separate filters for IDs, classes, attribute local names, and
element state.
Also, we invalidate siblings of elements matched against the selector
list of :nth-child(... of <selector list>) by marking matched elements
with NODE_HAS_SLOW_SELECTOR_NTH_OF.
The only remaining invalidation case invalidation case is
`:nth-child(An+B of :has())` (bug 1818155), which should not block
shipping `layout.css.nth-child-of.enabled`, because :has(...) is still
being implemented (bug 418039).
Depends on D172352
Differential Revision: https://phabricator.services.mozilla.com/D171936
Because restyle events cannot be posted for non-element nodes like the
shadow root, a child's siblings are restyled directly if its parent has
NODE_HAS_SLOW_SELECTOR or NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS but that
parent is the shadow root.
Drive-by, but braces were also added to some single-line "if" statements
in RestyleManager.
Differential Revision: https://phabricator.services.mozilla.com/D172352
Manual changes to make all refcounted types be marked as `nullable` after the
changes in part 1a. This was done without any investigation into whether the
actual types want to be nullable, in order to avoid code changes.
Differential Revision: https://phabricator.services.mozilla.com/D168889
Bug 1821920 and bug 1821871 are instances of an interesting behavior
change from bug 1820534.
The default flex-basis of old XUL was auto instead of max-content,
because of this code:
https://searchfox.org/mozilla-central/rev/af78418c4b5f2c8721d1a06486cf4cf0b33e1e8d/layout/generic/nsFlexContainerFrame.cpp#1327
So stuff that used to wrap now no longer does, in an horizontal flex
container, since xul.css prevents XUL elements from shrinking.
Per the comment, a few tests relied on this, but I believe it should
generally be safe to shrink the items. This only causes to shrink if
they have an explicit width but no min-width (including min-width:
auto).
Some tests like test_mousescroll.xhtml hit this, because they have
explicit sizes but min-width: auto ends up being 0 effectively, but I
believe we should tweak those tests instead.
Differential Revision: https://phabricator.services.mozilla.com/D172462
It's called by `PeekOffsetFor*` and `GetPrevNextBidiLevels`, so it's used for
considering whether to put caret or move a selection range boundary.
Therefore, it should treat nodes which can be managed by `Selection` as
selectable. In theory, even if a native anonymous subtree does not have
an independent selection, its content nodes should not be the container of
the selection range boundaries of selection outside the subtree since
Selection API shouldn't expose nodes in native anonymous subtrees. Therefore,
it can simply treat content nodes in different anonymous subtrees are not
selectable.
Note that it's not standardized that how `Selection.modify` works with various
content nodes.
https://w3c.github.io/selection-api/#dom-selection-modify
And also Chrome cannot cross generated content like form controls with this API.
This could cause web-compat issues, but it does not make sense for caret
navigation, and anyway out of scope of this bug. Therefore, this patch just
adds the crash test.
Differential Revision: https://phabricator.services.mozilla.com/D172204
Implemented the prefers-reduced-transparency media query for all
platforms.
Windows and Mac have specific settings which are used, others (Android
and Linux/GTK) have it enabled if prefers-reduced-motion is also enabled
as there is no dedicated setting to check.
Locked behind new pref `layout.css.prefers-reduced-transparency.enabled`,
off by default always for now.
Also added new WPT tests (none previously).
Demo video: https://goose.icu/firefox_prt.mp4
Test page: https://goose.icu/prefers-reduced-transparency
Differential Revision: https://phabricator.services.mozilla.com/D172424
Bug 1821920 and bug 1821871 are instances of an interesting behavior
change from bug 1820534.
The default flex-basis of old XUL was auto instead of max-content,
because of this code:
https://searchfox.org/mozilla-central/rev/af78418c4b5f2c8721d1a06486cf4cf0b33e1e8d/layout/generic/nsFlexContainerFrame.cpp#1327
So stuff that used to wrap now no longer does, in an horizontal flex
container, since xul.css prevents XUL elements from shrinking.
Per the comment, a few tests relied on this, but I believe it should
generally be safe to shrink the items. This only causes to shrink if
they have an explicit width but no min-width (including min-width:
auto).
Some tests like test_mousescroll.xhtml hit this, because they have
explicit sizes but min-width: auto ends up being 0 effectively, but I
believe we should tweak those tests instead.
Differential Revision: https://phabricator.services.mozilla.com/D172462
This patch doesn't change behavior.
Before this patch, we're calling GetVisualRun and storing its return value (a
BidiDirection), but really we only care about the function's outparam (captured
in 'start'), and we never use the return value.
So, let's just stop capturing the return value. This addresses a clang-tidy
automated review nit.
Differential Revision: https://phabricator.services.mozilla.com/D172325
The function requires this arg to be non-null; and at all of the callsites,
we're working with a reference or an actual instance, so there's no reason for
us to convert to a pointer at the API boundary.
Differential Revision: https://phabricator.services.mozilla.com/D172302
For pointer-type getters, we have a convention that a "Get" prefix implies
"warning, this might return null" , whereas lack-of-a-"Get" implies that the
return value is guaranteed to be non-null.
In the case of this `GetBidiEngine` API, this convention doesn't directly apply
since the return value isn't pointer-typed. But it's still backed by a
dynamically-allocated resource which we dereference at the return statement,
and some of the callers take the pointer-value of what's returned and pass that
along elsewhere. So it's helpful (and more concise) to drop "Get" to convey
that yes, we're sure the returned thing is indeed a real object.
Differential Revision: https://phabricator.services.mozilla.com/D172301
We were previously using foo.reset(new) which technically works, but MakeUnique
is preferred, for reasons documented in UniquePtr.h, under "There are various
benefits to using MakeUnique instead of |new| expressions."
Differential Revision: https://phabricator.services.mozilla.com/D172300
This used to be done within ProcessText itself, but that was semi-redundant when called from Canvas2d;
so we now consistently expect the caller to have removed unwanted separator/control characters.
Differential Revision: https://phabricator.services.mozilla.com/D172286
For now a static list of URIs is probably fine. I asked Nika / Gijs if
we can do something better in any case.
We already have tests for stuff not getting exposed to content.
Differential Revision: https://phabricator.services.mozilla.com/D171641
Seems per the logs we're hanging at the beginning of the test which is a
bit surprising. Try to see if we're failing to load any browser in
particular or we're getting an unexpected notification or what not.
Differential Revision: https://phabricator.services.mozilla.com/D172054
This is the significant change here: extend the single-character fast-path that skips
bidi processing to also handle strings that are confirmed to have no bidi content.
In such cases, we don't need to pass the text to a Bidi engine for analysis at all.
Depends on D171988
Differential Revision: https://phabricator.services.mozilla.com/D171989
This avoids an extra string copy/scan in ProcessText, by including the block/segment
separators it cares about in the preprocessing that's already being done to normalize
whitespace characters by the caller.
Depends on D171986
Differential Revision: https://phabricator.services.mozilla.com/D171987
This function doesn't need a Bidi engine, it just does property lookups
via the intl API. So drop the redundant parameter.
Depends on D171985
Differential Revision: https://phabricator.services.mozilla.com/D171986
I guess this used to be needed somewhere, but it's long dead now.
Removing the parameter makes it clear that the caller doesn't need
to compute and pass it.
Depends on D171984
Differential Revision: https://phabricator.services.mozilla.com/D171985
Done mostly automatically via find/replace following the conversions
specified here:
https://groups.google.com/a/mozilla.org/g/firefox-dev/c/9sGpF1TNbLk/m/QpU3oTUuAgAJ
For the most part I think the "flex: N N" usage could be simplified to
just "flex: N", but I wanted to preserve behavior (-moz-box-flex sets
both flex-grow and flex-shrink).
I changed legacy layout to also look at the order property rather than
-moz-box-ordinal-group because it made splitters and treecols easier (we
don't need to deal with both orders).
Differential Revision: https://phabricator.services.mozilla.com/D171715
Done mostly automatically via find/replace following the conversions
specified here:
https://groups.google.com/a/mozilla.org/g/firefox-dev/c/9sGpF1TNbLk/m/QpU3oTUuAgAJ
For the most part I think the "flex: N N" usage could be simplified to
just "flex: N", but I wanted to preserve behavior (-moz-box-flex sets
both flex-grow and flex-shrink).
I changed legacy layout to also look at the order property rather than
-moz-box-ordinal-group because it made splitters and treecols easier (we
don't need to deal with both orders).
Differential Revision: https://phabricator.services.mozilla.com/D171715
See comments in the bug, which still stand.
This cache is barely hit, and when it is hit it causes correctness
issues, see bug 1815022 for a recent example.
Differential Revision: https://phabricator.services.mozilla.com/D171391
The conversions between an element (including generated content) and the
pair of element and pseudo style type are used frequently, so perhaps it'd
better to factor them out. This patch only moves functions into
AnimationUtils.
FIXME: I suspect Gecko_UpdateAnimations() should early return for the pseudo
elements which we don't support for animations. However, this may cause
some test failures, so we keep the original implementation for now.
Differential Revision: https://phabricator.services.mozilla.com/D159111
Just like how we handle the CSSAnimation and CSSTransition. We use
TimelineCollection to store the named progress timeline objects created
by scroll-timeline-name and view-timeline-name, and reuse
ElementAnimationData to handle the life time of TimelineCollection.
Also, introduce TimelineManager to update timelines generated by CSS.
We add one test which mutates the scroll-timeline-axis to make sure we
restyle the animations associtated with the existing timelines. It will
be passed when we start to use the new framework, in the next patch.
Differential Revision: https://phabricator.services.mozilla.com/D169271
So we can reuse it for view timeline. Also, tweak the function name a
little bit so it'd be easier to use template functions.
Differential Revision: https://phabricator.services.mozilla.com/D169270
Computed color values will not be in the correct format, closer to the
one specified by the author. This also means that colors accross the
code are stored now as AbsoluteColor or StyleAbsoluteColor. This allows
color space/gamut information to be available for use.
Some animation related test failures had to be changed, because colors
now has greater precision. Animated a color now causes a lot more
animation updates, which was not initially expected. See the bug for
discussion.
Differential Revision: https://phabricator.services.mozilla.com/D171021
The SVGGeometryFrame::AttributeChanged does not perform any useful work for image frames and the base class nsIFrame::AttributeChanged just returns NS_OK
Differential Revision: https://phabricator.services.mozilla.com/D170994
Layout-wise it doesn't have any special code. Only weirdness is:
* Invalidation when size changes (we can do that with a
ResizeObserver).
* Weird paint retargetting to the splitter, which we can fix by using
negative margins instead and using a regular splitter.
Differential Revision: https://phabricator.services.mozilla.com/D171768
This will mean we always pass FLAG_SYNC_DECODE_IF_FAST (unless we are already passing the sync decode flag). The fact that we weren't doing this already is an oversight, we want to do this for all images we paint on the normal painting path. However what makes this more important is that we folded nsImageBoxFrame into nsImageFrame recently (bug 1815229), and nsImageBoxFrame eagerly decodes all its images and keeps them decoded, and also uses FLAG_SYNC_DECODE_IF_FAST (because with multiple sized decodes eager decodes don't cover everything). So this should help us avoid regressing visually with xul images.
Differential Revision: https://phabricator.services.mozilla.com/D171828
Per the spec update, the new syntax is:
`ray() = ray( <angle> && <ray-size>? && contain? )`
And for `<ray-size>`:
"If no <ray-size> is specified it defaults to closest-side."
So `<ray-size>` is optional and we omit it if it's default value, for
serialization.
By the way, offset=* properties are supported only in Gecko, so we don't
need a servo function to check the preference.
Differential Revision: https://phabricator.services.mozilla.com/D171625
Make display: -moz-box's visibility: collapse handling switchable by its
own CSS property.
Longer term maybe we should switch the front-end away from visibility:
collapse altogether (there are some alternatives), but for now this will
allow to move the front-end to switch to modern `display: flex` while
keeping `visibility: collapse` work as in -moz-box.
Differential Revision: https://phabricator.services.mozilla.com/D171472
It's hard to check Selection API calls from both JS and internals when we debug
web apps which has complicated `contenteditable` editor. Therefore, I'd like to
add an ability to log Selection API calls.
This patch needs to stop some methods inlined. Therefore, this could affect to
the performance in release builds, though. If so, I need to work on some
optimization later.
For minimizing the impact for performance, this patch also makes them to check
the logging level before calling logging methods. It's currently redundant
for `LogLevel::Info` case. However, this avoids any performance impact from
changes of `MOZ_LOG` implementation and in the blocks.
Differential Revision: https://phabricator.services.mozilla.com/D170585
This is currently used mostly for calculations related to scrollbars,
which are an example of content outside the scroll frame (and in
particular not subject to the zoom of a zoomable scroll frame).
As part of this change, FrameMetrics::
CalculateCompositionBoundsInCssPixelsOfSurroundingContent() is
renamed to CalculateCompositionBoundsInOuterCSSPixels() for brevity.
Differential Revision: https://phabricator.services.mozilla.com/D171142
Also, we make it animatable but don't apply it to the motion transform and
don't run it on the compositor for now (so it works for getComputedStyle but
doesn't have rendering result).
Per spec: https://w3c.github.io/csswg-drafts/css-values/#calc-serialize,
we tweak the WPT to let calc() serialize the percentage first, and maintain
zero-valued terms, i.e. 0%. (We are doing the same thing as
offset-anchor, so it should be fine with other browsers.)
Besides, I tweak the serialization of shorthand a little bit so we match
the implementation of WebKit.
Differential Revision: https://phabricator.services.mozilla.com/D170972
This change is necessary to support the [CSS Highlight API](https://drafts.csswg.org/css-highlight-api-1/),
which uses `Selection` internally.
To replace `nsRange` with `AbstractRange`, some sections needed to be
adapted since `nsRange`-specific features were used.
Therefore, some methods (such as `GetRangeAt()`) may only be called if
the `Selection` is *not* of type `SelectionType::eHighlight`,
as it (per spec) returns an `nsRange`.
These methods will now `MOZ_ASSERT` if called for a highlight selection.
Additional methods are implemented which return `AbstractRange`
instead and are safe to be called for every selection type.
This commit also improves support of highlight features:
- Invalidation of highlight ranges: adding/removing Ranges in-place instead of
removing and re-adding the Selection object associated with the highlight.
- Ranges are only associated with the Selection that shares the same Document
- Fixed minor IDL issue
Differential Revision: https://phabricator.services.mozilla.com/D170582
There were two problems:
* The line scroll amount was queried in LayoutDevice pixels
and used as CSS pixels without applying the device scale.
* The thumb length was rounded in CSS pixels. To match main
thread behaviour, it needs to be rounded in LayoutDevice
pixels.
Differential Revision: https://phabricator.services.mozilla.com/D171435
This kinda papers over the issue. There's a somewhat deeper problem here
where creating an <object> element inside a static document creates a
non-print presshell / pres context / etc.
But let's address the regression for now, since this is harmless and
trivial.
Differential Revision: https://phabricator.services.mozilla.com/D171370
While looking at the backout, I noticed table parts relied on reframing
on abspos-container-ness changes in a subtle way, see the test, which
fails with the first patch of this bug applied without these changes.
Make the NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN mean the same for table parts
as for everything else. Instead, keep the registration status on each
relevant frame class individually.
Depends on D169127
Differential Revision: https://phabricator.services.mozilla.com/D170969
* Remove some legacy appearance aliases that other engines don't
implement.
* Allow to pass with unimplemented <compat-auto> values, since per the
spec the idea of these is to get them removed, see
https://github.com/w3c/csswg-drafts/issues/8506 for the ones we don't
implement.
* Also allow the `-moz-` prefix to be implemented, because we can't
quite get rid of it (people use it to remove the <input type=number>
buttons with -moz-appearance: textfield and so on), and the
alternative is to implement a bunch of non-standard ::-webkit-
pseudo-elements.
Differential Revision: https://phabricator.services.mozilla.com/D171243
Although I haven't been able to reproduce the reporter's OOM crash here, I hope this will avoid
the issue; it certainly improves performance characteristics in my local build.
On the example here, my laptop happily scrolls the text field at 60fps when nothing is selected;
but if the text is selected it can only manage around 40fps, because we lose the clipping
optimization here.
With this change, it maintains 60fps regardless of whether the text is selected (or text-shadow
is present), and memory footprint is substantially reduced.
Differential Revision: https://phabricator.services.mozilla.com/D171318
While looking at the backout, I noticed table parts relied on reframing
on abspos-container-ness changes in a subtle way, see the test, which
fails with the first patch of this bug applied without these changes.
Make the NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN mean the same for table parts
as for everything else. Instead, keep the registration status on each
relevant frame class individually.
Depends on D169127
Differential Revision: https://phabricator.services.mozilla.com/D170969
The documentation for these functions might be missed when these functions was
moved from nsIFrame.h to Baseline.h in
https://hg.mozilla.org/mozilla-central/rev/fbf495c37e23.
I also revise the documentation because the old ones might be wrong. Here are
some corrections.
1. An alphabetical "first"/"last" baseline should always be at the end edge
of a margin/border/content-box.
2. SynthesizeBOffsetFromBorderBox() works when aFrame's writing-mode is
orthogonal to aWM, but the other two functions are not.
Differential Revision: https://phabricator.services.mozilla.com/D171189
I didn't revert some tweaks for tests (e.g. allowing small fractional scroll
position differences) since we will end up allowing the differences until
we fixed all rounding/snapping scroll related metrics issue, bug 1774315 for
example.
Differential Revision: https://phabricator.services.mozilla.com/D170465
These crashtests rely upon either a requestAnimationFrame callback or a
MozAfterPaint event. Those currently won't happen when the compositor is
paused, and on Windows these crashtests are occluded, which will now pause
the compositor. To deal with this, we disable the occlusion tracking pref
on Windows. Other platforms seem not to treat the crashtests as occluded,
so their compositors keep running.
Differential Revision: https://phabricator.services.mozilla.com/D171137
I didn't revert some tweaks for tests (e.g. allowing small fractional scroll
position differences) since we will end up allowing the differences until
we fixed all rounding/snapping scroll related metrics issue, bug 1774315 for
example.
Differential Revision: https://phabricator.services.mozilla.com/D170465
This test send some cross origin no-cors requests and expect
the color of the element will be changed via CSS by reading
the response of these requests.
With ORB's JS validator is enabled, some of the requests are
going to be blocked.
This patch allows the test to test the result for both ORB
enabled and ORB disabled.
Differential Revision: https://phabricator.services.mozilla.com/D169279
This test send some cross origin no-cors requests and expect
the color of the element will be changed via CSS by reading
the response of these requests.
With ORB's JS validator is enabled, some of the requests are
going to be blocked.
This patch allows the test to test the result for both ORB
enabled and ORB disabled.
Differential Revision: https://phabricator.services.mozilla.com/D169279
At least one page creates a lot of these, and it really slows down the CC.
If the style has a black wrapper, that case is already covered
by the existing HasKnownLiveWrapper.
Differential Revision: https://phabricator.services.mozilla.com/D170970
For programmatic scrolls, we should respect a users general.smoothScroll
preference. If smooth scrolls are disabled, programmatic scrolls with
behavior: "smooth" should be treated as instant programmatic scrolls.
Differential Revision: https://phabricator.services.mozilla.com/D170110
Setting an at-page size where the width or height is zero is valid CSS but is unprintable, so a size with zero in it will be ignored with this change.
Differential Revision: https://phabricator.services.mozilla.com/D167624
Adds a usePageRuleSizeAsPaperSize setting to allow overriding the default paper size when printing to a PDF file.
Print preview now checks for at-page size rules and when enabled will use that size for the previewed sheet of paper.
The preview will also return the page width and height (in inches) during its callback for the frontend to use to override the default paper settings.
Differential Revision: https://phabricator.services.mozilla.com/D160303
Currently, when an inset is large enough that auto margins would distribute a
negative value, we always clamp it to zero. This works for scenarios where
at least one of the insets in the relevant axis was auto, since the spec
resolves the auto margin to be zero in this case. However, the spec does not
disallow a negative auto margin value when both insets are non-auto.
Differential Revision: https://phabricator.services.mozilla.com/D170931
Now it's on by default everywhere, so all this is not needed. No behavior
change effectively since the xul.css bits being removed effectively achieve the
same.
Differential Revision: https://phabricator.services.mozilla.com/D170944
Explicitly set visibility on the thumb instead. This will help to remove
the thumb element altogether, potentially (and it's simpler anyhow).
Differential Revision: https://phabricator.services.mozilla.com/D171013
It only has an effect on macOS, and it's only used for
scrollbars/resizers/trees. We already hard-coded <browser>
to behave as never so do the same consistently, see bug 1519905.
This reduces noise when inspecting scrollbars (and it's simpler).
No behavior change.
Differential Revision: https://phabricator.services.mozilla.com/D171011
No behavior change, both these sheets get loaded in all pages
unconditionally, and the new order matches the order they get
loaded in.
Differential Revision: https://phabricator.services.mozilla.com/D171008
Explicitly set visibility on the thumb instead. This will help to remove
the thumb element altogether, potentially (and it's simpler anyhow).
Differential Revision: https://phabricator.services.mozilla.com/D171013
It only has an effect on macOS, and it's only used for
scrollbars/resizers/trees. We already hard-coded <browser>
to behave as never so do the same consistently, see bug 1519905.
This reduces noise when inspecting scrollbars (and it's simpler).
No behavior change.
Differential Revision: https://phabricator.services.mozilla.com/D171011
No behavior change, both these sheets get loaded in all pages
unconditionally, and the new order matches the order they get
loaded in.
Differential Revision: https://phabricator.services.mozilla.com/D171008
This unveils an issue with image-set() tests, which expect 0x to not
parse (inconsistently with media queries).
Fix the test, since the spec doesn't restrict the range of <resolution>
values (and more importantly, it shouldn't allow open ranges).
Differential Revision: https://phabricator.services.mozilla.com/D170762
This unveils an issue with image-set() tests, which expect 0x to not
parse (inconsistently with media queries).
Fix the test, since the spec doesn't restrict the range of <resolution>
values (and more importantly, it shouldn't allow open ranges).
Differential Revision: https://phabricator.services.mozilla.com/D170762
This unveils an issue with image-set() tests, which expect 0x to not
parse (inconsistently with media queries).
Fix the test, since the spec doesn't restrict the range of <resolution>
values (and more importantly, it shouldn't allow open ranges).
Differential Revision: https://phabricator.services.mozilla.com/D170762
Callers of `GetCaretBaseline` just use it to get offset and size of the caret, so
refactor the shared logic. In the call sites, delay conversion of logical to physical
rect to reduce variable shuffling.
Differential Revision: https://phabricator.services.mozilla.com/D169210
This is the only -moz-box special-case that isn't related to the
visibility: collapse behavior.
After this is done, we can put the collapse behavior in a chrome-only
property, and remove the -moz-box display values and migrate the
-moz-box properties to modern flexbox automatically.
Differential Revision: https://phabricator.services.mozilla.com/D170813
Before, there existed 3 virtual functions that calculated baselines:
- `GetLogicalBaseline`
- `GetVerticalAlignBaseline`
- `GetNaturalBaselineBOffset`
Each of them had slightly different behaviours:
- `GetLogicalBaseline` would synthesize a baseline if there is no baseline.
Others would simply return `false`.
- `GetNaturalBaselineBOffset` requires the caller to pick which of first/last
baseline to calculate. Others pick on on their own.
- `GetNaturalBaselineBOffset`'s result can be either offset from border box
start/end edge, depending on the caller-supplied baseline. Others always
return offset from border box start edge.
Now:
- `GetNaturalBaselineBOffset` is the sole virtual function.
- `GetLogicalBaseline` exists to support its use, with 2 virtual helper functions:
- `SynthesizeFallbackBaseline` to generate a baseline for elements that
doesn't have one.
- `GetBaselineSharingGroup` to preserve the default baseline picking behaviour.
Differential Revision: https://phabricator.services.mozilla.com/D167990
With this, the old SelectionIterator that expects a per-character array of
SelectionDetails pointers is no longer used anywhere.
Differential Revision: https://phabricator.services.mozilla.com/D170588
This significantly improves performance and reduces memory usage when painting a very long textframe
with some or all of the text selected.
Differential Revision: https://phabricator.services.mozilla.com/D170530
This ensures that repeated calls to Element::GetGridFragments will return
an array of idempotent Grid objects for each fragment. This is
accomplished by making the Grid object hold a WeakFrame back to its
originating frame, and updating a property on construction and
destruction.
Differential Revision: https://phabricator.services.mozilla.com/D169724
This currently only includes block frames, grid containers, and flex
containers, and the document and pagination frames. It is possible more frames
will need to be added or more advanced checks in the future.
This adds some related tests to ignoring some subtrees, but are expected fails
until bug 1816570 is fixed.
Differential Revision: https://phabricator.services.mozilla.com/D169018
For programmatic scrolls, we should respect a users general.smoothScroll
preference. If smooth scrolls are disabled, programmatic scrolls with
behavior: "smooth" should be treated as instant programmatic scrolls.
Differential Revision: https://phabricator.services.mozilla.com/D170110
This test send some cross origin no-cors requests and expect
the color of the element will be changed via CSS by reading
the response of these requests.
With ORB's JS validator is enabled, some of the requests are
going to be blocked.
This patch allows the test to test the result for both ORB
enabled and ORB disabled.
Differential Revision: https://phabricator.services.mozilla.com/D169279
The testcase was originated from D169662 written by Daniel Holbert, which was
discovered by fuzzer in bug 1756202.
Note that the crashtest that hangs the browser might not always be reproducible
locally. It is reproducible on "Linux 18.04 x64 WebRender tsan opt" build on
try.
Differential Revision: https://phabricator.services.mozilla.com/D170532
- Create wheel transactions for wheel events handled by APZ.
- Group wheel events with the current wheel transaction, so that all
wheel events in a wheel transaction are fired to the same element.
- Store the current event target for the first event in a wheel
transaction to be used for subsequent events.
- Add the dom.event.wheel-event-groups.enabled preference as a feature
flag for this behavior.
Differential Revision: https://phabricator.services.mozilla.com/D163484
This test send some cross origin no-cors requests and expect
the color of the element will be changed via CSS by reading
the response of these requests.
With ORB's JS validator is enabled, some of the requests are
going to be blocked.
This patch allows the test to test the result for both ORB
enabled and ORB disabled.
Differential Revision: https://phabricator.services.mozilla.com/D169279
This currently only includes block frames, grid containers, and flex
containers, and the document and pagination frames. It is possible more frames
will need to be added or more advanced checks in the future.
This adds some related tests to ignoring some subtrees, but are expected fails
until bug 1816570 is fixed.
Differential Revision: https://phabricator.services.mozilla.com/D169018
Testcase 001 and 002 test row-oriented and column-oriented flex container,
respectively. The "a" and "b" variant test `box-sizing:border-box` and
`box-sizing:content-box`, respectively.
Differential Revision: https://phabricator.services.mozilla.com/D170035
For programmatic scrolls, we should respect a users general.smoothScroll
preference. If smooth scrolls are disabled, programmatic scrolls with
behavior: "smooth" should be treated as instant programmatic scrolls.
Differential Revision: https://phabricator.services.mozilla.com/D170110
If we choose to accelerate a single line path, we need to take care not to use
the line cap when the path is closed. When the path is closed, we need to use
the line join instead.
Differential Revision: https://phabricator.services.mozilla.com/D170469
nsImageFrame has support for displaying style URIs / an owned image
request, so use it.
The main behavior difference is that we don't fire `load` / `error`
events for those images anymore, but I don't see any event listener for
those around, so I think they can go.
Differential Revision: https://phabricator.services.mozilla.com/D168958