Bug 1924698. Avoid a few blockframe queryframes. r=jwatt

Saw these in the long tail of a profile of an sp3 test.

Differential Revision: https://phabricator.services.mozilla.com/D225633
This commit is contained in:
Timothy Nikkel 2024-10-17 12:05:27 +00:00
parent 34338e0f76
commit 0198ff45b5
2 changed files with 7 additions and 3 deletions

View File

@ -8342,8 +8342,10 @@ bool nsBlockFrame::BlockNeedsFloatManager(nsIFrame* aBlock) {
/* static */
bool nsBlockFrame::BlockCanIntersectFloats(nsIFrame* aFrame) {
return aFrame->IsBlockFrameOrSubclass() && !aFrame->IsReplaced() &&
!aFrame->HasAnyStateBits(NS_BLOCK_BFC);
// NS_BLOCK_BFC is block specific bit, check first as an optimization, it's
// okay because we also check that it is a block frame.
return !aFrame->HasAnyStateBits(NS_BLOCK_BFC) && !aFrame->IsReplaced() &&
aFrame->IsBlockFrameOrSubclass();
}
// Note that this width can vary based on the vertical position.

View File

@ -2506,7 +2506,9 @@ bool nsIFrame::CanBeDynamicReflowRoot() const {
// If we participate in a container's block reflow context, or margins
// can collapse through us, we can't be a dynamic reflow root.
if (IsBlockFrameOrSubclass() && !HasAnyStateBits(NS_BLOCK_BFC)) {
// (NS_BLOCK_BFC is block specific bit, check first as an optimization, it's
// okay because we also check that it is a block frame.)
if (!HasAnyStateBits(NS_BLOCK_BFC) && IsBlockFrameOrSubclass()) {
return false;
}