This ensures that you can't observe an inconsistent state while we go
through the list.
It should also be marginally better as we don't build an array with all
the media queries unconditionally.
Differential Revision: https://phabricator.services.mozilla.com/D82260
We need to notify unconditionally because even if we didn't have
stylesheets, we could have responsive content which needs to change
source.
We need to notify the document even if the pres shell is not
initialized, as it might be our last chance to notify the responsive
content. This happens for printing, and makes my srcset test fail.
MANUAL PUSH: Somehow phabricator still thinks it needs review, even
though it was accepted.
Differential Revision: https://phabricator.services.mozilla.com/D81778
This is a straightforward conversion except that
`NS_SUBTREE_DIRTY(this)` can be written terser as `IsSubtreeDirty()`.
Differential Revision: https://phabricator.services.mozilla.com/D82811
If the root scrollframe has the zoomable flag set, it automatically returns
true from WantAsyncScroll which makes it the "primary" scrollframe, and
automatically gets a displayport. However, this can be undesirable in cases
where the root scrollframe is not actually scrollable (i.e. document content
doesn't overflow) because we don't actually need that displayport on the root
scrollframe and instead want it on a scrollframe that is actually scrollable.
This patch removes the behaviour of WantAsyncScroll returning true for such
scrollframes, but maintains the layerization changes needed to support zooming.
This reduces the set of differences between running with apz.allow_zooming on
and off, which in turn eliminates a bunch of test failures when that pref is
enabled.
Depends on D82777
Differential Revision: https://phabricator.services.mozilla.com/D82778
Per discussion on matrix, printing mState in hex format is
indecipherable. Remove it to reduce the rate of wrapping of a long line.
Differential Revision: https://phabricator.services.mozilla.com/D82606
This is equivalent to `aFrame->DumpFrameTreeLimited()` or `ftl` gdb /
lldb command. It appears only in nsIFrame.cpp, I doubt it's actually
used by developers.
Differential Revision: https://phabricator.services.mozilla.com/D82605
This affects the output of flex, grid, fieldset, etc.
Given a snippet like the following.
```
<fieldset style="position: relative; display: flex">
<div style="position: absolute">
```
Currently, the frame tree output looks as if the AbsoluteList is under
the FieldSet, but it's actually under the FlexContainer.
```
FieldSet(fieldset)(8)@7f4ae9e73508 ... <
FlexContainer(fieldset)(8)@7f4ae9e735c0 ... <
Placeholder(div)(1)@7f4ae9e73738
>
AbsoluteList 7f4ae9dcb8c0 <
Block(div)(1)@7f4ae9e73670 ... <
>
>
>
```
After this patch, the frame tree looks like:
```
FieldSet(fieldset)(8)@7f4ae9e73508 ... <
FlexContainer(fieldset)(8)@7f4ae9e735c0 ... <
Placeholder(div)(1)@7f4ae9e73738
AbsoluteList 7f4ae9dcb8c0 <
Block(div)(1)@7f4ae9e73670 ... <
>
>
>
>
```
Another minor difference is that for a empty container, the end angle
bracket is now on its own line, which is consistent with an empty block
frame's output.
This old output
```
FlexContainer(div)(4)@7f4ae9e73390<>
```
becomes
```
FlexContainer(div)(4)@7f4ae9e73390<
>
```
Differential Revision: https://phabricator.services.mozilla.com/D82604
Make the following tweak so that they are consistent with others.
* Add a space before the open angle bracket. This is at the end of
`Block(div)(1)@7f10e25de5d0 ... <`
* Tweak nsLineBox format.
`line 7f10e25de808: count=1` becomes `line@7f10e25de808 count=1`.
* Tweak child list format.
`AbsoluteList 0x7f10e3c7e560` becomes `AbsoluteList@7f10e3c7e560`
Differential Revision: https://phabricator.services.mozilla.com/D82603
`ListChildLists` lives in nsContainerFrame because I'm going to use it
to improve nsContainerFrame::List() in a later patch.
Differential Revision: https://phabricator.services.mozilla.com/D82602
Note: This optimization saves us from doing an extra unnecessary reflow in the
mochitest test_bug1505254.html, so I'm adjusting that test to remove its
magical "+1" fudge-factor in its expectations (and the corresponding
explanatory comment). Similarly, I'm dropping the assertion-count for
crashtest 1488762-1.html because we now do a little bit less reflow work (and
hence assert a little bit less) in that test.
Depends on D78821
Differential Revision: https://phabricator.services.mozilla.com/D78822
Note: this patch doesn't change behavior of current mozilla-central - it's just reordering some logic, basically.
Background/explanation: in current mozilla-central, we intentionally force a
"final reflow" for flex items (i.e. we return true from NeedsFinalReflow) if we
see that there's a constrained AvailableBSize (i.e. if we're fragmenting). However, the
logic to do that is buried within a basically-unrelated "if
(HadMeasuringReflow())" special case.
This patch pulls that check out of this unrelated special-case, so that we
detect the constrained AvailableBSize earlier and return earlier (indicating
more eagerly/up-front that we need a final reflow).
This patch is necessary because a later patch in this queue will add additional
special cases to FlexItem::NeedsFinalReflow, which will aim to make us *skip*
the final reflow in more cases. But for now, we want this
contrained-AvailableBSize check to "dominate" and eagerly force a reflow,
regardless of that soon-to-be-added logic.
Differential Revision: https://phabricator.services.mozilla.com/D78821
When a document has a fullscreen element, zooming is disabled, so we don't need
to build the async zoom container. But also, fullscreen is implemented via
hoisting the fullscreen element out of the normal layout flow, and making it
position:fixed. If the nsDisplayAsyncZoom display item is still in the display
list, it has a clip that doesn't account for fullscreen-ness, but still wraps
the nsDisplayPositionFixed items that are rendering the fullscreen elements.
This can result in hit-testing failing on those fullscreen items, because the
nsDisplayAsyncZoom item incorrectly clips away hit-test points. Instead, a
simple solution here is to just skip building the nsDisplayAsyncZoom item
entirely when in a fullscreen state.
Differential Revision: https://phabricator.services.mozilla.com/D82422
nsTArray::StableSort() requires the Comparator to be a class/struct with
Equals() and LessThan() members, or a tri-state function like strcmp.
This patch adapts the original comparators to tri-state functions to
fulfill this contract.
Using StableSort() can also avoid the array bound checking in the array
iterator as described in bug 1147091 comment 8.
Change the include to <limits> because std::stable_sort is removed but
we still use std::numeric_limits.
Differential Revision: https://phabricator.services.mozilla.com/D82118
Both methods are implementation details specific to this iterator, not
public interfaces that can be cooperated with C++ standard library, so
move them into private section.
Differential Revision: https://phabricator.services.mozilla.com/D82117
The machinery to report janked animations is;
1) Store the partial pre-rendered animation id and the Animation object in a
hashtable in LayerManager
2) Store the animation id in the Animation object as well
3) When we detect jank, we send the animation id to the main-thread via an IPC
call
4) Find the Animation object with the id in the hashtable and update the
Animaiton
5) Whenever the partial pre-rendered Animation stop running on the compositor
i.e. the Animation finished normally, the Animation's target element is
changed, etc. etc., remove the Animation from the hashtable
Depends on D75731
Differential Revision: https://phabricator.services.mozilla.com/D75732