Skip to content

Commit c27730d

Browse files
committedNov 26, 2023
Bug 1364813 - Remove IsFrameOfType, use non-virtual checks. r=jwatt
Extend the per-frame-class bit we have to devirtualize IsLeaf to also devirtualize IsFrameOfType. That is, move this data to FrameClasses.py. This was done by going through all the frame classes, trying to preserve behavior. The only quirky thing is that I had to add two more trivial frame classes, `nsAudioFrame` for audio elements, and `nsFloatingFirstLetterFrame`. That's because these frame classes were returning different answers at runtime, but they do this only on conditions that trigger frame reconstruction (floating, and being an audio element, respectively). Differential Revision: https://phabricator.services.mozilla.com/D194703
1 parent 19bccb6 commit c27730d

File tree

105 files changed

+543
-882
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+543
-882
lines changed
 

‎dom/animation/EffectSet.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ EffectSet* EffectSet::GetForFrame(const nsIFrame* aFrame,
4949
if (aProperties.IsSubsetOf(nsCSSPropertyIDSet::TransformLikeProperties())) {
5050
// Make sure to return nullptr if we're looking for transform animations on
5151
// the inner table frame.
52-
if (!aFrame->IsFrameOfType(nsIFrame::eSupportsCSSTransforms)) {
52+
if (!aFrame->SupportsCSSTransforms()) {
5353
return nullptr;
5454
}
5555
frameToQuery = nsLayoutUtils::GetStyleFrame(aFrame);

‎dom/animation/KeyframeEffect.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,7 @@ bool KeyframeEffect::ContainsAnimatedScale(const nsIFrame* aFrame) const {
18931893
// frame. If we are being passed a frame that doesn't support transforms
18941894
// (i.e. the inner table frame) we could just return false, but it possibly
18951895
// means we looked up the wrong EffectSet so for now we just assert instead.
1896-
MOZ_ASSERT(aFrame && aFrame->IsFrameOfType(nsIFrame::eSupportsCSSTransforms),
1896+
MOZ_ASSERT(aFrame && aFrame->SupportsCSSTransforms(),
18971897
"We should be passed a frame that supports transforms");
18981898

18991899
if (!IsCurrent()) {

0 commit comments

Comments
 (0)
Failed to load comments.