This code will soon deal with both scroll anchoring and position anchoring.
Renaming the existing scroll anchoring variable to avoid confusion.
Differential Revision: https://phabricator.services.mozilla.com/D242004
It's currently always set to the native anonymous `<div>` for editable content
of text control element. So, it means that it's an independent selection root.
Depends on D241587
Differential Revision: https://phabricator.services.mozilla.com/D241775
This patch fixes multiple points which may cross independent selection
boundaries which is element boundary of the native anonymous `<div>` for
editable content in text controls. The reason why I don't split this patch is,
fixing one of them leads another assertion failure. So, I couldn't pass all
tests with separated patches.
1. `nsFrameTraversal` should take `Element` instead of `nsIFrame` for the
limiter because e.g., inline editing host like `<span contenteditable>` may
have multiple frames if it's wrapped. Therefore, we should make it take
an element as the ancestor limiter, and check it when getting parent frame
or after getting previous or next frame.
2. `nsIFrame::PeekBackwardAndForward` may cross the boundary because it does not
take the anonymous `<div>` element as ancestor limiter of the selection. It's
currently used only for extending selection. Therefore, I rename it to make
it clearer.
3. `SelectionMovementUtils::GetPrevNextBidiLevel` to take the ancestor limiter
for calling `nsIFrame::GetFrameFromDirection()`.
4. `nsINode` should have a method to return the `nsFrameSelection` instance
which manages the selection in the node. This makes the check simpler, and
this is not expensive. Then, for making it clearer, I rename
`TextControlElement::GetConstFrameSelection()` to
`GetIndependentFrameSelection()`.
5. `nsINode::GetSelectionRootContent()` should have an option to return
independent selection root when the node is its host for
`nsFrameSelection::ConstrainFrameAndPointToAnchorSubtree()`
6. `nsFrameSelection::ConstrainFrameAndPointToAnchorSubtree()` should not
retrieve independent selection root when the given frame is a text control
frame.
7. `RangeUtils` should get parent with checking the independent selection
boundaries.
8. `Selection::Extend` should assert if the destination is managed by its
frame selection to detect a bug.
Differential Revision: https://phabricator.services.mozilla.com/D241587
It is mostly working, but there are some tests that hit crashes and
asserts that we should sort out. For now, land it default-off.
This does implement other bits that are on by default tho, like creating
image frames for ::view-transition-new() pseudo-elements and so on. I
think that is fine (it's just that for now they are all transparent).
Differential Revision: https://phabricator.services.mozilla.com/D239382
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.
Differential Revision: https://phabricator.services.mozilla.com/D237097
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.
Differential Revision: https://phabricator.services.mozilla.com/D237097
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.
Differential Revision: https://phabricator.services.mozilla.com/D237097
Note that both keywords are disabled in the CSS parser for now, behind
these about:config prefs:
layout.css.stretch-size-keyword.enabled
layout.css.webkit-fill-available.enabled
Prior to this patch, we handled both keywords as pure aliases for
'-moz-available' (which has the correct 'stretch' behavior in the inline axis
but which just behaves like the initial value in the block axis).
This patch changes that so that 'stretch' and '-webkit-fill-available' will now
actually do the right thing in the block axis (if they're enabled at all, via
their aforementioned about:config prefs).
The relevant spec text here is:
https://drafts.csswg.org/css-sizing-4/#valdef-width-stretchhttps://drafts.csswg.org/css-sizing-4/#stretch-fit-sizing
Differential Revision: https://phabricator.services.mozilla.com/D217688
The frame destroy will tear down all the properties, no need to search for one specific property and maybe remove it before that.
This shows up in profiles.
Differential Revision: https://phabricator.services.mozilla.com/D231531
This is a chrome only css property (so it could still be used in a UA sheet that is applied to a content document) that was created solely to tabs/xul decks in a fashion that is more like the rest of css/html. And it still only has that single use in our tree. A UA sheet applying this property to content it doesn't control doesn't seem like it could be very useful.
Even those these checks are simple they are relatively costly because we check them on every frame and when we are traversing the frame tree (for display list building or setting a displayport) we are often memory bound, so pulling in another bit of otherwise cold memory for a rare style struct makes us wait for loading more memory and pushes more useful stuff out of caches. The parent process check remains very quick as verified by profiling.
Differential Revision: https://phabricator.services.mozilla.com/D231648
The only thing that useFixedPosition controls is whether we create a nsDisplayFixedPosition item. The only things that nsDisplayFixedPosition does different are things that only affect painting to the window (CreateWebRenderCommands, UpdateScrollData, ShouldGetFixedAnimationId).
I don't think this causes any behaviour difference, but we only need a nsDisplayFixedPosition item if we are painting to the window.
Differential Revision: https://phabricator.services.mozilla.com/D230243
This patch doesn't change behavior[1]; it's just a refactor.
[1] Minor caveat: the "availBased" variables in this patch are now floored-to-0
whereas previously they were not. In cases where these variables weren't
getting seprately-clamped, this is a bit of a behavior-change, but it's a step
towards correctness to floor this size-measurement to be nonnegative.
Differential Revision: https://phabricator.services.mozilla.com/D230228
This is just a variable rename to help avoid ambiguity when we add support for
the 'stretch' size keyword. This has no functional change.
Differential Revision: https://phabricator.services.mozilla.com/D230227
`nsFrameSelection::NormalSelection()` returns a `Selection&`, which eliminates the need for nullptr check at call sites.
This simplifies the code in some places and removes unnecessarily indented blocks.
Differential Revision: https://phabricator.services.mozilla.com/D230583
No change in behavior, just makes it clearer when we're working with used values
where the inline-* logical values have been resolved.
Differential Revision: https://phabricator.services.mozilla.com/D230029
And don't resolve them prematurely; the computed value should remain
logical, and only be mapped to physical sides at use time.
Differential Revision: https://phabricator.services.mozilla.com/D229998
No change in behavior, just makes it clearer when we're working with used values
where the inline-* logical values have been resolved.
Differential Revision: https://phabricator.services.mozilla.com/D230029
And don't resolve them prematurely; the computed value should remain
logical, and only be mapped to physical sides at use time.
Differential Revision: https://phabricator.services.mozilla.com/D229998