Prevents backplates from being drawn for any text that has forced-color-adjust: none set by checking the value of StyleText()->mForcedColorAdjust.
Differential Revision: https://phabricator.services.mozilla.com/D173362
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
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
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
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
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 ToResolvedValue implementation purposes we wouldn't need to split
out the vertical / font / line-height arguments and we could just pass
around the ComputedStyle, but the lh unit would need that distinction,
(because computing lh on font properties should use the parent style).
Differential Revision: https://phabricator.services.mozilla.com/D168705
After moving FrameChildListID into mozilla namespace, `kPrincipalList` etc. are
also exposed in the mozilla namespace. In the next part, I'll convert
FrameChildListID enum into an enum class, so the naming pollution shouldn't be
an issue.
This patch has a nice side effect that it is now easier to remove all the
aliases of FrameChildListID (`kPrincipalList` etc.) defined in multiple places
since it is confusion to have the same thing written in different ways, e.g.
`nsIFrame::kPrincipalList`, `mozilla::layout::kPrincipalList`,
`FrameChildListID::kPrincipalList`, `kPrincipalList`.
This patch doesn't change behavior.
Differential Revision: https://phabricator.services.mozilla.com/D161863
After moving FrameChildListID into mozilla namespace, `kPrincipalList` etc. are
also exposed in the mozilla namespace. In the next part, I'll convert
FrameChildListID enum into an enum class, so the naming pollution shouldn't be
an issue.
This patch has a nice side effect that it is now easier to remove all the
aliases of FrameChildListID (`kPrincipalList` etc.) defined in multiple places
since it is confusion to have the same thing written in different ways, e.g.
`nsIFrame::kPrincipalList`, `mozilla::layout::kPrincipalList`,
`FrameChildListID::kPrincipalList`, `kPrincipalList`.
This patch doesn't change behavior.
Differential Revision: https://phabricator.services.mozilla.com/D161863
This works with margin and page-size, though we can't properly test mixed
page-size yet due to limitations in both print preview testing (which does not
handle multiple pages) and paged reftests (which ignore page-size).
It may be appropriate to remove the @page { margin } propagation from Servo
after this change.
Differential Revision: https://phabricator.services.mozilla.com/D158227
This works with margin and page-size, though we can't properly test mixed
page-size yet due to limitations in both print preview testing (which does not
handle multiple pages) and paged reftests (which ignore page-size).
It may be appropriate to remove the @page { margin } propagation from Servo
after this change.
Differential Revision: https://phabricator.services.mozilla.com/D158227
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
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
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
After this patch, we still need nsFrameList::Enumerator to iterate
nsFrameList::Slice. We might enhance nsFrameList::Iterator to support Slice, but
I'll leave this for another day.
Differential Revision: https://phabricator.services.mozilla.com/D158809
RemoveFramesAfter and ExtractTail have similar purpose, so we really should keep
one of them to avoid confusion.
They have the following minor differences:
1. RemoveFramesAfter() keeps aFrame in the list, while ExtractTail() returns it.
2. If aFrame is empty, RemoveFramesAfter() returns the entire list, while
ExtractTail returns an empty list.
It's more convenient for the existing callers to use the RemoveFramesAfter(), so
ExtractTail is unneeded.
After this patch, both RemoveFramesAfter() and RemoveFramesBefore() return the
entire list if aFrame is nullptr.
Rename RemoveFramesAfter() to TakeFramesAfter() for symmetry with
TakeFramesBefore().
This change shouldn't change the behavior.
Differential Revision: https://phabricator.services.mozilla.com/D158807
I feel it's hard to understand the purpose of ExtractHead(), especially where
aFrame is going after the call. Therefore, I rename it to TakeFramesBefore(),
and have it complement the existing RemoveFramesAfter(), which will be rename
later. No behavioral change intended.
Also, slightly reword the method's documentation to reflect the its new
name. (Remove the "sibling" wording from the comment since it's an
implementation details that frames are actually a doubly linked list.)
Differential Revision: https://phabricator.services.mozilla.com/D158806
This is a preparation to remove nsFrameList::FrameLinkEnumerator in the next
part.
FrameLinkEnumerator::Find() can be replaced with std::find/std::find_if.
Differential Revision: https://phabricator.services.mozilla.com/D158700
This applies both to the individual mStartPageValue and mEndPageValue fields
of the nsIFrame::PageValues struct, and for the nsIFrame::PageValuesProperty
being null to indicate both mStartPageValue and mEndPageValue are auto.
Fetching this is handled by nsIFrame::GetStartPageValue and
nsIFrame::GetEndPageValue, which also ensure the use of first-in-flow frames.
Differential Revision: https://phabricator.services.mozilla.com/D157873
* Rename `mBreakType` to `mFloatClearType` in nsLineBox and nsReflowStatus and
the methods around it.
* Rename `mBreakType` to `mClear` in nsStyleDisplay.
* Many other method parameters or local variables rename such as from
`aBreakType` to `aClearType`.
Differential Revision: https://phabricator.services.mozilla.com/D158276
Before this patch, StyleClear::Line indicates that the nsLineBox has break-after
but no float clearance (note we don't allow line break-before with clear:none);
StyleClear::None indicates the line has no break-before nor break-after.
In this patch, I added `mHasForcedLineBreak` bit in nsLineBox to indicate the
line has a break so that StyleClear can serve its original meaning -- the float
clearance. In Part 6, I'll rename more existing methods and variables related to
float clearance.
Now, instead of using StyleClear::None to clear the line break status, the
caller should use ClearForcedLineBreak(); Similar to set
SetInlineLineBreakBeforeAndReset() and SetInlineLineBreakAfter on
nsReflowStatus, SetBreakTypeBefore/SetBreakTypeAfter on nsLineBox always sets
break status with an optional float clearance parameter.
This patch shouldn't change the behavior.
Differential Revision: https://phabricator.services.mozilla.com/D158224
This patch shouldn't change the behavior.
* Rename BlockReflowState's `mFloatBreakType` to `mTrailingClearFromPIF` since
it's the cached result of `FindTrailingClear()` from the block's prev-in-flow.
Note that `mTrailingClearFromPIF` can have `StyleClear::Line`, which is
not a float clear value. We'll remove `StyleClear::Line` in a later part to
make this 100% correct.
* Rename `nsLayoutUtils::CombineBreakType` to `CombineClearType` as well as its
arguments.
* Simplify FindTrailingClear()'s implementation.
Differential Revision: https://phabricator.services.mozilla.com/D158221