mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 10:33:33 +00:00
5730ee0ca5
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
23 lines
593 B
Python
23 lines
593 B
Python
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
|
class FrameClass:
|
|
def __init__(self, cls):
|
|
self.cls = cls
|
|
|
|
|
|
class Frame(FrameClass):
|
|
def __init__(self, cls, ty, flags):
|
|
FrameClass.__init__(self, cls)
|
|
self.ty = ty
|
|
self.flags = flags
|
|
self.is_concrete = True
|
|
|
|
|
|
class AbstractFrame(FrameClass):
|
|
def __init__(self, cls):
|
|
FrameClass.__init__(self, cls)
|
|
self.is_concrete = False
|