Bug 1906561. Avoid a useless call to GetTransformMatrix in PresShell::ScrollFrameIntoView. r=layout-reviewers,emilio
Since container is transformed, container->GetTransformMatrix will always just put the cross doc parent frame into parent. I checked the history when this code was written, it looks like GetTransformMatrix (via GetResultingTransformMatrix) might have go up more than one parent frame in the case of preserve 3d (combines 3d) frames. That is no longer the case, and GetTransformMatrix is a relatively heavyweight function. Differential Revision: https://phabricator.services.mozilla.com/D215860
This commit is contained in:
@@ -3837,15 +3837,14 @@ bool PresShell::ScrollFrameIntoView(
|
||||
|
||||
MaybeSkipPaddingSides(container);
|
||||
|
||||
nsIFrame* parent;
|
||||
if (container->IsTransformed()) {
|
||||
container->GetTransformMatrix(ViewportType::Layout, RelativeTo{nullptr},
|
||||
&parent);
|
||||
nsIFrame* parent = container->GetParent();
|
||||
NS_ASSERTION(parent || !container->IsTransformed(),
|
||||
"viewport shouldnt be transformed");
|
||||
if (parent && container->IsTransformed()) {
|
||||
rect =
|
||||
nsLayoutUtils::TransformFrameRectToAncestor(container, rect, parent);
|
||||
} else {
|
||||
rect += container->GetPosition();
|
||||
parent = container->GetParent();
|
||||
}
|
||||
if (!parent && !(aScrollFlags & ScrollFlags::ScrollNoParentFrames)) {
|
||||
nsPoint extraOffset(0, 0);
|
||||
|
||||
Reference in New Issue
Block a user