It seems that `nsIFrame::GetLastLeaf()` and `nsIFrame::GetFirstLeaf()`
were designed for helper methods of `nsIFrame::IsVisuallyAtLineEdge()`
and `nsIFrame::IsLogicallyAtLineEdge()`. Therefore, they require the
`nsTextFrame` which is generated by `::before` or `::after` to check
whether the frame is first or last of the line. However, only
`nsIFrame::GetLastLeaf()` is used by `GetNextPrevLineBlockFrame()` too
and I changed the behavior only for `GetNextPrevLineBlockFrame()` in
D216371. Then, that broke the `nsIFrame::IsVisuallyAtLineEdge()` and
`nsIFrame::IsLogicallyAtLineEdge()`. Therefore, this patch moves the
new check to the caller side, i.e., into `GetNextPrevLineBlockFrame()`.
Differential Revision: https://phabricator.services.mozilla.com/D256211
They create a block even tho they're not block-outside in the CSS sense.
This makes captions consistent with table cells too.
Differential Revision: https://phabricator.services.mozilla.com/D251997
Not sure how useful adding a test for this really is. The XML pretty
printer is pretty much the only UA widget that has some paragraph
content, and setting it up is non-trivial. If you insist I can look into
adding a test tho.
I haven't been able to reproduce this locally, but I see what's going
on, and I think we could do better.
This avoids the frame flush from nsCanvasFrame::CreateAnonymousContent,
and in general makes the anonymous content timing a lot more reasonable
(see the FlushPendingNotifications call that's getting removed).
The ServoStyleSet changes are needed now that there are multiple style
roots that can be unstyled like that.
It also simplifies the API as now it's not dependent on having a canvas
frame around (and thus doesn't need to flush layout).
Differential Revision: https://phabricator.services.mozilla.com/D250531
We should handle the root only in ScrollContainerFrame. We don't hit
this code-path more often because the root primary frame is usually not
a stacking context.
Differential Revision: https://phabricator.services.mozilla.com/D247590
From code-inspection / crash inspection, but it doesn't seem
far-fetched. With view transitions we're a bit more likely to hit this
code with the root frame or so, since the top transition layer doesn't
react to pointer events.
Differential Revision: https://phabricator.services.mozilla.com/D246728
The retained display list pref is live, so even if it is off we can still have a retained display list kicking around if the pref has been toggled.
Differential Revision: https://phabricator.services.mozilla.com/D246099
The grid item cache is an internal implementation detail that does not need to
be exposed in the header. This patch moves `CachedBAxisMeasurement` to the cpp
file, similar to where `nsFlexContainerFrame::CachedBAxisMeasurement` lives.
This change also reduces compile time when modifying the cache code.
Since `CachedBAxisMeasurement` is now hidden, we add a helper
`MarkCachedGridMeasurementsDirty` to remove `CachedBAxisMeasurement::Prop()` in
`nsIFrame::MarkIntrinsicISizesDirty()`.
Differential Revision: https://phabricator.services.mozilla.com/D246060
If we return the generated-content block, PeekOffsetForLine will descend
into it, and then determine it isn't a valid result, and move on from the
desired target line. Excluding the generated-content block allows us to
properly return the next (or previous) frame on the line instead.
Differential Revision: https://phabricator.services.mozilla.com/D245902
This also improves the rendering of new-content-ancestor-clipped.html,
but doesn't fully fix it. I think there's something going on with the
box shadow / ink overflow coordinates.
Differential Revision: https://phabricator.services.mozilla.com/D245770
This is the low risk fix, but I'm not sure I understand what this code
is doing / why are we not just returning the "inner" range for all
frames, including inlines.
Differential Revision: https://phabricator.services.mozilla.com/D245228
This reuses the newly introduced infrastructure to track painting, and
avoids painting if rendering is suppressed (such as for view transitions
and so on).
Rendering suppression of an in-process iframe needs more work because
right now we paint in-process iframes as part of the top document's
display list.
Remove some old paint invalidation printf-debugging, which I suspect
nobody has used in years. Profiler markers are strictly better :)
Differential Revision: https://phabricator.services.mozilla.com/D245063
This patch adds zero-parameter overloads for `DumpFrameTree()` and
`DumpFrameTreeInCSSPixels()`, making it easier to call these functions in the
debugger without having to pass `false` as an argument.
Additionally, this patch reverts bug 1959538 since that change [1] is no longer
needed with these new overloads.
[1]https://hg.mozilla.org/mozilla-central/rev/7371d5813735
Differential Revision: https://phabricator.services.mozilla.com/D245155
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 inner block of a scroller for example (::-moz-scrolled-content)
shouldn't be considered a line break.
Same for scrollbar nodes, we don't want to break on scrollbars (or
native anonymous content in general), since we can't position the caret
and such there anyways.
Differential Revision: https://phabricator.services.mozilla.com/D244519
The inner block of a scroller for example (::-moz-scrolled-content)
shouldn't be considered a line break.
Same for scrollbar nodes, we don't want to break on scrollbars (or
native anonymous content in general), since we can't position the caret
and such there anyways.
Differential Revision: https://phabricator.services.mozilla.com/D244519
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