In a lot of cases we go from frame/content, look up the id, then GetVisualToLayoutTransform looks up the content from the id. This is a waste. We should just pass in a content, and the one case that starts with an ViewID can look up the content to pass in since we were going to look up the content anyways.
The hashtable lookup of the content/id is showing up as biggest chunk the work in the event handling display list build that we do to handle synth mouse move events during sp3. And synth mouse moves have been identified as something we do that stands out as extra work.
Differential Revision: https://phabricator.services.mozilla.com/D228653
There are two tests;
helper_fission_empty_clip.html is for this bug (bug 1923513), there's an
element covering over an OOP iframe but it has an empty clip-path, thus any
input event is not interefered by the element.
helper_fission_unresolved_clip.html is to make sure that this code change
doesn't regress unresolved clip cases, it's similar to above case but with an
unresolved clip-path, thus the OOP iframe isn't rendered, any input element
isn't reached to the iframe.
Differential Revision: https://phabricator.services.mozilla.com/D228116
Seems like we should be doing this as a frame that is clipped out fully but requires two scroll frames to fully clip it is just as visible as a frame where one scroll frame fully clips it.
Differential Revision: https://phabricator.services.mozilla.com/D225442
I don't think this can happen, but if we hit the top of the in process frame tree here then we should check if it's visible cross process. This is what we do at the actual place where we can hit the top of the frame tree (just above here).
Differential Revision: https://phabricator.services.mozilla.com/D225441
We walk up the frame tree looking for scroll frames, and then transform from the initial frame to the currently found scroll frame. The problem is that doing that transform walks between the initial frame and the current scroll frame again to get the transform, each time, and that operation is kind of slow even if we weren't doing all this extra work.
So instead we use the transformed rect and the current scroll frame so we don't have to compute the transform over those frames again as we walk up the frame tree.
Differential Revision: https://phabricator.services.mozilla.com/D225440
When `PeekOffsetForCharacter` find a non-editable content, it should never
return the frame because user must want to move caret only in editable content
when the previous position is editable. Additionally, when a non-selectable
frame is skipped, caret will be moved enough, so it should not skip any editable
content. Finally, the found frame may cause a line break. Therefore, this
patch overwrites the result of `SelectablePeekReport::PeekOffsetForCharacter`
from `FOUND` to `CONTINUE_UNSELECTABLE` when non-editable content is found.
The remaining failures of the new WPT should be handled in bug 449685 because
they are caused by no frame for invisible preceding/trailing white spaces around
the block element boundary.
Depends on D223909
Differential Revision: https://phabricator.services.mozilla.com/D224183
We compute the size of non-replaced elements in `nsIFrame::ComputeSize()` and
replaced elements in `nsContainerFrame::ComputeSizeWithIntrinsicDimensions()`.
When computing a flex item's main-size, we need to skip applying min-main-size
and max-main-size at both functions.
While we still need to duplicate the code in both places, unifying the logic
should make the code easier to read and pave the way for unifying these
functions in the future.
This patch doesn't change behavior.
Differential Revision: https://phabricator.services.mozilla.com/D222905
Rename getCSSStyleRules now that it can return something else, and
change getCSSStyleRules_starting_style.html to cover this again.
Unfortunately the asserts in ServoStyleRuleMap.cpp no longer hold,
because the style attribute and other declarations are expected not to
show up there.
Differential Revision: https://phabricator.services.mozilla.com/D222856
That is, a definite max block-size and an auto block-size should not compute a
definite percentage basis in the block axis.
Note that we accidentally pass
`testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-017.html`.
After applying this patch, the test starts to fail, but it will be fixed in the
next part.
Differential Revision: https://phabricator.services.mozilla.com/D222230
Currently, only the grid container needs the containing block size to resolve
the transferred min and max sizes for `repeat()` function in
`nsGridContainerFrame::ComputeIntrinsicISize()`.
This patch is a preparation for Bug 1865438. `mContainingBlockSize` will be used
there, so it does not change any behavior yet.
Differential Revision: https://phabricator.services.mozilla.com/D221333
Rename `mPercentageBasis` to `mPercentageBasisForChildren` to clarify that the
percentage basis is intended for resolving the percentage sizes for child
frames.
Differential Revision: https://phabricator.services.mozilla.com/D221332
A percentage basis is needed to resolve percentage block size when computing
children's intrinsic inline size contributions. This is necessary for a child or
descendants with a preferred aspect-ratio so that the block size can transfer
through the aspect-ratio to become an intrinsic inline size.
The change in `nsFlexContainerFrame::ComputeIntrinsicISize()` is necessary to
keep us passing
`testing/web-platform/tests/css/css-flexbox/image-nested-within-definite-column-flexbox.html`.
The change in `nsPlaceholderFrame::AddFloatToIntrinsicISizeData()` is necessary
to keep us passing
`testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-010.html`.
`GetISizeInfo()` in BasicTableLayoutStrategy.cpp is modified to pass table cell
frame's bsize as percentage basis. Otherwise,
`layout/reftests/bugs/522632-1.html` fails. This is our current behavior, but it
is bug 1461852.
Differential Revision: https://phabricator.services.mozilla.com/D219523
This patch changes the signature to `GetMinISize()`, `GetPrefISize()`,
`IntrinsicISize` by adding a helper struct as a preparation. Then we can just
add more data such as a percentage basis to the struct without altering the
signature in the future.
When passing `IntrinsicSizeInput` struct down to another helper method, we
generally just pass the original one if the method is computing the intrinsic
size of our own or our anonymous children. If the method is computing our
children's intrinsic contribution, we'll need to create a brand new
`IntrinsicSizeInput` for our children.
Differential Revision: https://phabricator.services.mozilla.com/D219521
A percentage basis is needed to resolve percentage block size when computing
children's intrinsic inline size contributions. This is necessary for a child or
descendants with a preferred aspect-ratio so that the block size can transfer
through the aspect-ratio to become an intrinsic inline size.
The change in `nsFlexContainerFrame::ComputeIntrinsicISize()` is necessary to
keep us passing
`testing/web-platform/tests/css/css-flexbox/image-nested-within-definite-column-flexbox.html`.
The change in `nsPlaceholderFrame::AddFloatToIntrinsicISizeData()` is necessary
to keep us passing
`testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-010.html`.
`GetISizeInfo()` in BasicTableLayoutStrategy.cpp is modified to pass table cell
frame's bsize as percentage basis. Otherwise,
`layout/reftests/bugs/522632-1.html` fails. This is our current behavior, but it
is bug 1461852.
Differential Revision: https://phabricator.services.mozilla.com/D219523
This patch changes the signature to `GetMinISize()`, `GetPrefISize()`,
`IntrinsicISize` by adding a helper struct as a preparation. Then we can just
add more data such as a percentage basis to the struct without altering the
signature in the future.
When passing `IntrinsicSizeInput` struct down to another helper method, we
generally just pass the original one if the method is computing the intrinsic
size of our own or our anonymous children. If the method is computing our
children's intrinsic contribution, we'll need to create a brand new
`IntrinsicSizeInput` for our children.
Differential Revision: https://phabricator.services.mozilla.com/D219521
We no longer need the concept of "local" transforms after bug 878346.
Local transforms that we'd need in the future could be represented via
attribute mapping.
We still need the viewbox transform shenanigans which applies to
children only, tho.
Differential Revision: https://phabricator.services.mozilla.com/D220290
`HTMLEditor::FinalizeSelection()` resets the caret and `nsCaret` schedules to
paint itself with the new state. If editing host is being removed, it's already
been removed from the child chain of its parent but it still knows the parent.
Additionally, `nsCaret` may still keep storing the removing editing host as the
content. In such case, we try to look for the line edge from the removing
editing host and fails to compute the index in its parent node for considering
the caret geometry. For avoiding to compute it in the unstable period,
`nsFocusManager::ContentRemoved()` should call `HTMLEditor::FinalizeSelection()`
after the removal ends.
Differential Revision: https://phabricator.services.mozilla.com/D219845
There were added in bug 1436505. Nowadays they show up large in profiles, eg bug 1466704.
I checked crash stats, we aren't hitting these.
Differential Revision: https://phabricator.services.mozilla.com/D220052
Generally we want to move to more flagged matrices because the transforms are usually simple, just offsets, or simple 2d transforms and the operations do show up in profiles if we do them in the "dumb" way of assuming a full 3d transform.
This specific code isn't necessarily performance critical, but it simplifies nsIFrame::GetTransformMatrix (which is performance critical) so that everything there is Matrix4x4Flagged except the one conversion for GetResultingTransformMatrix.
Matrix4x4TypedFlagged::ToUnknownMatrix gets its first user with this change and we need to make some fixes so that it actually works. We need to friend all template instantiations of this class so that it can access the private constructor of the class with different units. We also need to move the MatrixType enum outside of the class so it doesn't get the templated units imprinted on its type. Maybe there is a better way to do this.
Differential Revision: https://phabricator.services.mozilla.com/D218018
The background image is associate to the table frame, but the table wrapper frame is the primary frame, thus IsPrimaryFrameOfRootOrBodyElement returns false and we don't propagate to the root when we should. So I changed IsPrimaryFrameOfRootOrBodyElement to handle this case and renamed it. I checked the other root element frame types, only table frames had this issue.
Differential Revision: https://phabricator.services.mozilla.com/D217923