forked from mirrors/gecko-dev
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
This commit is contained in:
parent
c1b18f62e8
commit
5730ee0ca5
105 changed files with 543 additions and 882 deletions
|
|
@ -49,7 +49,7 @@ EffectSet* EffectSet::GetForFrame(const nsIFrame* aFrame,
|
||||||
if (aProperties.IsSubsetOf(nsCSSPropertyIDSet::TransformLikeProperties())) {
|
if (aProperties.IsSubsetOf(nsCSSPropertyIDSet::TransformLikeProperties())) {
|
||||||
// Make sure to return nullptr if we're looking for transform animations on
|
// Make sure to return nullptr if we're looking for transform animations on
|
||||||
// the inner table frame.
|
// the inner table frame.
|
||||||
if (!aFrame->IsFrameOfType(nsIFrame::eSupportsCSSTransforms)) {
|
if (!aFrame->SupportsCSSTransforms()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
frameToQuery = nsLayoutUtils::GetStyleFrame(aFrame);
|
frameToQuery = nsLayoutUtils::GetStyleFrame(aFrame);
|
||||||
|
|
|
||||||
|
|
@ -1893,7 +1893,7 @@ bool KeyframeEffect::ContainsAnimatedScale(const nsIFrame* aFrame) const {
|
||||||
// frame. If we are being passed a frame that doesn't support transforms
|
// frame. If we are being passed a frame that doesn't support transforms
|
||||||
// (i.e. the inner table frame) we could just return false, but it possibly
|
// (i.e. the inner table frame) we could just return false, but it possibly
|
||||||
// means we looked up the wrong EffectSet so for now we just assert instead.
|
// means we looked up the wrong EffectSet so for now we just assert instead.
|
||||||
MOZ_ASSERT(aFrame && aFrame->IsFrameOfType(nsIFrame::eSupportsCSSTransforms),
|
MOZ_ASSERT(aFrame && aFrame->SupportsCSSTransforms(),
|
||||||
"We should be passed a frame that supports transforms");
|
"We should be passed a frame that supports transforms");
|
||||||
|
|
||||||
if (!IsCurrent()) {
|
if (!IsCurrent()) {
|
||||||
|
|
|
||||||
|
|
@ -1036,8 +1036,7 @@ nsRect Element::GetClientAreaRect() {
|
||||||
// The display check is OK even though we're not looking at the style
|
// The display check is OK even though we're not looking at the style
|
||||||
// frame, because the style frame only differs from "frame" for tables,
|
// frame, because the style frame only differs from "frame" for tables,
|
||||||
// and table wrappers have the same display as the table itself.
|
// and table wrappers have the same display as the table itself.
|
||||||
(!frame->StyleDisplay()->IsInlineFlow() ||
|
(!frame->StyleDisplay()->IsInlineFlow() || frame->IsReplaced())) {
|
||||||
frame->IsFrameOfType(nsIFrame::eReplaced))) {
|
|
||||||
// Special case code to make client area work even when there isn't
|
// Special case code to make client area work even when there isn't
|
||||||
// a scroll view, see bug 180552, bug 227567.
|
// a scroll view, see bug 180552, bug 227567.
|
||||||
return frame->GetPaddingRect() - frame->GetPositionIgnoringScrolling();
|
return frame->GetPaddingRect() - frame->GetPositionIgnoringScrolling();
|
||||||
|
|
|
||||||
|
|
@ -113,8 +113,7 @@ static AutoTArray<LogicalPixelSize, 1> CalculateBoxSize(
|
||||||
// always return false. (So its observation won't be fired.)
|
// always return false. (So its observation won't be fired.)
|
||||||
// TODO: Should we use an empty array instead?
|
// TODO: Should we use an empty array instead?
|
||||||
// https://github.com/w3c/csswg-drafts/issues/7734
|
// https://github.com/w3c/csswg-drafts/issues/7734
|
||||||
if (!frame->IsFrameOfType(nsIFrame::eReplaced) &&
|
if (!frame->IsReplaced() && frame->IsLineParticipant()) {
|
||||||
frame->IsFrameOfType(nsIFrame::eLineParticipant)) {
|
|
||||||
return {LogicalPixelSize()};
|
return {LogicalPixelSize()};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -536,8 +535,7 @@ static void LastRememberedSizeCallback(
|
||||||
aObserver.Unobserve(*target);
|
aObserver.Unobserve(*target);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
MOZ_ASSERT(!frame->IsFrameOfType(nsIFrame::eLineParticipant) ||
|
MOZ_ASSERT(!frame->IsLineParticipant() || frame->IsReplaced(),
|
||||||
frame->IsFrameOfType(nsIFrame::eReplaced),
|
|
||||||
"Should have unobserved non-replaced inline.");
|
"Should have unobserved non-replaced inline.");
|
||||||
MOZ_ASSERT(!frame->HidesContent(),
|
MOZ_ASSERT(!frame->HidesContent(),
|
||||||
"Should have unobserved element skipping its contents.");
|
"Should have unobserved element skipping its contents.");
|
||||||
|
|
|
||||||
|
|
@ -3053,7 +3053,7 @@ static bool IsVisibleAndNotInReplacedElement(nsIFrame* aFrame) {
|
||||||
if (f->HidesContent()) {
|
if (f->HidesContent()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (f->IsFrameOfType(nsIFrame::eReplaced) &&
|
if (f->IsReplaced() &&
|
||||||
!f->GetContent()->IsAnyOfHTMLElements(nsGkAtoms::button,
|
!f->GetContent()->IsAnyOfHTMLElements(nsGkAtoms::button,
|
||||||
nsGkAtoms::select) &&
|
nsGkAtoms::select) &&
|
||||||
!f->GetContent()->IsSVGElement()) {
|
!f->GetContent()->IsSVGElement()) {
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ static bool ShouldZoomToElement(
|
||||||
// Replaced elements are suitable zoom targets because they act like
|
// Replaced elements are suitable zoom targets because they act like
|
||||||
// inline-blocks instead of inline. (textarea's are the specific reason
|
// inline-blocks instead of inline. (textarea's are the specific reason
|
||||||
// we do this)
|
// we do this)
|
||||||
!frame->IsFrameOfType(nsIFrame::eReplaced)) {
|
!frame->IsReplaced()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -190,7 +190,7 @@ static CSSRect AddVMargin(const CSSRect& aRect, const CSSCoord& aMargin,
|
||||||
|
|
||||||
static bool IsReplacedElement(const nsCOMPtr<dom::Element>& aElement) {
|
static bool IsReplacedElement(const nsCOMPtr<dom::Element>& aElement) {
|
||||||
if (nsIFrame* frame = aElement->GetPrimaryFrame()) {
|
if (nsIFrame* frame = aElement->GetPrimaryFrame()) {
|
||||||
if (frame->IsFrameOfType(nsIFrame::eReplaced)) {
|
if (frame->IsReplaced()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ CSSPoint MotionPathUtils::ComputeAnchorPointAdjustment(const nsIFrame& aFrame) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aFrame.IsFrameOfType(nsIFrame::eSVGContainer)) {
|
if (aFrame.IsSVGContainerFrame()) {
|
||||||
nsRect boxRect = nsLayoutUtils::ComputeSVGReferenceRect(
|
nsRect boxRect = nsLayoutUtils::ComputeSVGReferenceRect(
|
||||||
const_cast<nsIFrame*>(&aFrame), StyleGeometryBox::FillBox);
|
const_cast<nsIFrame*>(&aFrame), StyleGeometryBox::FillBox);
|
||||||
return CSSPoint::FromAppUnits(boxRect.TopLeft());
|
return CSSPoint::FromAppUnits(boxRect.TopLeft());
|
||||||
|
|
|
||||||
|
|
@ -3264,8 +3264,8 @@ static void AccumulateFrameBounds(nsIFrame* aContainerFrame, nsIFrame* aFrame,
|
||||||
nsIFrame* prevFrame = aFrame;
|
nsIFrame* prevFrame = aFrame;
|
||||||
nsIFrame* f = aFrame;
|
nsIFrame* f = aFrame;
|
||||||
|
|
||||||
while (f && f->IsFrameOfType(nsIFrame::eLineParticipant) &&
|
while (f && f->IsLineParticipant() && !f->IsTransformed() &&
|
||||||
!f->IsTransformed() && !f->IsAbsPosContainingBlock()) {
|
!f->IsAbsPosContainingBlock()) {
|
||||||
prevFrame = f;
|
prevFrame = f;
|
||||||
f = prevFrame->GetParent();
|
f = prevFrame->GetParent();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -770,7 +770,7 @@ static nsIFrame* GetFrameForChildrenOnlyTransformHint(nsIFrame* aFrame) {
|
||||||
MOZ_ASSERT(aFrame->IsSVGOuterSVGAnonChildFrame(),
|
MOZ_ASSERT(aFrame->IsSVGOuterSVGAnonChildFrame(),
|
||||||
"Where is the SVGOuterSVGFrame's anon child??");
|
"Where is the SVGOuterSVGFrame's anon child??");
|
||||||
}
|
}
|
||||||
MOZ_ASSERT(aFrame->IsFrameOfType(nsIFrame::eSVG | nsIFrame::eSVGContainer),
|
MOZ_ASSERT(aFrame->IsSVGContainerFrame(),
|
||||||
"Children-only transforms only expected on SVG frames");
|
"Children-only transforms only expected on SVG frames");
|
||||||
return aFrame;
|
return aFrame;
|
||||||
}
|
}
|
||||||
|
|
@ -1746,8 +1746,7 @@ void RestyleManager::ProcessRestyledFrames(nsStyleChangeList& aChangeList) {
|
||||||
hint |= nsChangeHint_RepaintFrame;
|
hint |= nsChangeHint_RepaintFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((hint & nsChangeHint_UpdateUsesOpacity) &&
|
if ((hint & nsChangeHint_UpdateUsesOpacity) && frame->IsTablePart()) {
|
||||||
frame->IsFrameOfType(nsIFrame::eTablePart)) {
|
|
||||||
NS_ASSERTION(hint & nsChangeHint_UpdateOpacityLayer,
|
NS_ASSERTION(hint & nsChangeHint_UpdateOpacityLayer,
|
||||||
"should only return UpdateUsesOpacity hint "
|
"should only return UpdateUsesOpacity hint "
|
||||||
"when also returning UpdateOpacityLayer hint");
|
"when also returning UpdateOpacityLayer hint");
|
||||||
|
|
@ -1773,8 +1772,7 @@ void RestyleManager::ProcessRestyledFrames(nsStyleChangeList& aChangeList) {
|
||||||
// For most frame types, DLBI can detect background position changes,
|
// For most frame types, DLBI can detect background position changes,
|
||||||
// so we only need to schedule a paint.
|
// so we only need to schedule a paint.
|
||||||
hint |= nsChangeHint_SchedulePaint;
|
hint |= nsChangeHint_SchedulePaint;
|
||||||
if (frame->IsFrameOfType(nsIFrame::eTablePart) ||
|
if (frame->IsTablePart() || frame->IsMathMLFrame()) {
|
||||||
frame->IsFrameOfType(nsIFrame::eMathML)) {
|
|
||||||
// Table parts and MathML frames don't build display items for their
|
// Table parts and MathML frames don't build display items for their
|
||||||
// backgrounds, so DLBI can't detect background-position changes for
|
// backgrounds, so DLBI can't detect background-position changes for
|
||||||
// these frames. Repaint the whole frame.
|
// these frames. Repaint the whole frame.
|
||||||
|
|
@ -1847,7 +1845,7 @@ void RestyleManager::ProcessRestyledFrames(nsStyleChangeList& aChangeList) {
|
||||||
// inner svg frame, so update the child overflows.
|
// inner svg frame, so update the child overflows.
|
||||||
nsIFrame* childFrame = hintFrame->PrincipalChildList().FirstChild();
|
nsIFrame* childFrame = hintFrame->PrincipalChildList().FirstChild();
|
||||||
for (; childFrame; childFrame = childFrame->GetNextSibling()) {
|
for (; childFrame; childFrame = childFrame->GetNextSibling()) {
|
||||||
MOZ_ASSERT(childFrame->IsFrameOfType(nsIFrame::eSVG),
|
MOZ_ASSERT(childFrame->IsSVGFrame(),
|
||||||
"Not expecting non-SVG children");
|
"Not expecting non-SVG children");
|
||||||
if (!CanSkipOverflowUpdates(childFrame)) {
|
if (!CanSkipOverflowUpdates(childFrame)) {
|
||||||
mOverflowChangedTracker.AddFrame(
|
mOverflowChangedTracker.AddFrame(
|
||||||
|
|
|
||||||
|
|
@ -598,7 +598,7 @@ static bool IsBidiSplittable(nsIFrame* aFrame) {
|
||||||
MOZ_ASSERT(aFrame);
|
MOZ_ASSERT(aFrame);
|
||||||
// Bidi inline containers should be split, unless they're line frames.
|
// Bidi inline containers should be split, unless they're line frames.
|
||||||
LayoutFrameType frameType = aFrame->Type();
|
LayoutFrameType frameType = aFrame->Type();
|
||||||
return (aFrame->IsFrameOfType(nsIFrame::eBidiInlineContainer) &&
|
return (aFrame->IsBidiInlineContainer() &&
|
||||||
frameType != LayoutFrameType::Line) ||
|
frameType != LayoutFrameType::Line) ||
|
||||||
frameType == LayoutFrameType::Text;
|
frameType == LayoutFrameType::Text;
|
||||||
}
|
}
|
||||||
|
|
@ -607,7 +607,7 @@ static bool IsBidiSplittable(nsIFrame* aFrame) {
|
||||||
static bool IsBidiLeaf(const nsIFrame* aFrame) {
|
static bool IsBidiLeaf(const nsIFrame* aFrame) {
|
||||||
nsIFrame* kid = aFrame->PrincipalChildList().FirstChild();
|
nsIFrame* kid = aFrame->PrincipalChildList().FirstChild();
|
||||||
if (kid) {
|
if (kid) {
|
||||||
if (aFrame->IsFrameOfType(nsIFrame::eBidiInlineContainer) ||
|
if (aFrame->IsBidiInlineContainer() ||
|
||||||
RubyUtils::IsRubyBox(aFrame->Type())) {
|
RubyUtils::IsRubyBox(aFrame->Type())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -1209,8 +1209,7 @@ void nsBidiPresUtils::TraverseFrames(nsIFrame* aCurrentFrame,
|
||||||
char16_t controlChar = 0;
|
char16_t controlChar = 0;
|
||||||
char16_t overrideChar = 0;
|
char16_t overrideChar = 0;
|
||||||
LayoutFrameType frameType = frame->Type();
|
LayoutFrameType frameType = frame->Type();
|
||||||
if (frame->IsFrameOfType(nsIFrame::eBidiInlineContainer) ||
|
if (frame->IsBidiInlineContainer() || RubyUtils::IsRubyBox(frameType)) {
|
||||||
RubyUtils::IsRubyBox(frameType)) {
|
|
||||||
if (!frame->HasAnyStateBits(NS_FRAME_FIRST_REFLOW)) {
|
if (!frame->HasAnyStateBits(NS_FRAME_FIRST_REFLOW)) {
|
||||||
nsContainerFrame* c = static_cast<nsContainerFrame*>(frame);
|
nsContainerFrame* c = static_cast<nsContainerFrame*>(frame);
|
||||||
MOZ_ASSERT(c == do_QueryFrame(frame),
|
MOZ_ASSERT(c == do_QueryFrame(frame),
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,7 @@ using namespace mozilla::dom;
|
||||||
nsIFrame* NS_NewHTMLCanvasFrame(PresShell* aPresShell, ComputedStyle* aStyle);
|
nsIFrame* NS_NewHTMLCanvasFrame(PresShell* aPresShell, ComputedStyle* aStyle);
|
||||||
|
|
||||||
nsIFrame* NS_NewHTMLVideoFrame(PresShell* aPresShell, ComputedStyle* aStyle);
|
nsIFrame* NS_NewHTMLVideoFrame(PresShell* aPresShell, ComputedStyle* aStyle);
|
||||||
|
nsIFrame* NS_NewHTMLAudioFrame(PresShell* aPresShell, ComputedStyle* aStyle);
|
||||||
|
|
||||||
nsContainerFrame* NS_NewSVGOuterSVGFrame(PresShell* aPresShell,
|
nsContainerFrame* NS_NewSVGOuterSVGFrame(PresShell* aPresShell,
|
||||||
ComputedStyle* aStyle);
|
ComputedStyle* aStyle);
|
||||||
|
|
@ -265,7 +266,7 @@ static void AssertAnonymousFlexOrGridItemParent(const nsIFrame* aChild,
|
||||||
* needs to terminate it).
|
* needs to terminate it).
|
||||||
*/
|
*/
|
||||||
static bool IsInlineFrame(const nsIFrame* aFrame) {
|
static bool IsInlineFrame(const nsIFrame* aFrame) {
|
||||||
return aFrame->IsFrameOfType(nsIFrame::eLineParticipant);
|
return aFrame->IsLineParticipant();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -284,7 +285,7 @@ static inline bool IsDisplayContents(const nsIContent* aContent) {
|
||||||
* frame being used for SVG text.
|
* frame being used for SVG text.
|
||||||
*/
|
*/
|
||||||
static bool IsFrameForSVG(const nsIFrame* aFrame) {
|
static bool IsFrameForSVG(const nsIFrame* aFrame) {
|
||||||
return aFrame->IsFrameOfType(nsIFrame::eSVG) || aFrame->IsInSVGTextSubtree();
|
return aFrame->IsSVGFrame() || aFrame->IsInSVGTextSubtree();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsLastContinuationForColumnContent(const nsIFrame* aFrame) {
|
static bool IsLastContinuationForColumnContent(const nsIFrame* aFrame) {
|
||||||
|
|
@ -300,8 +301,7 @@ static bool IsLastContinuationForColumnContent(const nsIFrame* aFrame) {
|
||||||
* lower-level descendents inside them, of course).
|
* lower-level descendents inside them, of course).
|
||||||
*/
|
*/
|
||||||
static bool ShouldSuppressFloatingOfDescendants(nsIFrame* aFrame) {
|
static bool ShouldSuppressFloatingOfDescendants(nsIFrame* aFrame) {
|
||||||
return aFrame->IsFlexOrGridContainer() ||
|
return aFrame->IsFlexOrGridContainer() || aFrame->IsMathMLFrame();
|
||||||
aFrame->IsFrameOfType(nsIFrame::eMathML);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return true if column-span descendants should be suppressed under aFrame's
|
// Return true if column-span descendants should be suppressed under aFrame's
|
||||||
|
|
@ -2329,7 +2329,7 @@ static inline bool NeedFrameFor(const nsFrameConstructorState& aState,
|
||||||
// white-space, where we know we'll be dropping them all anyway, and involve
|
// white-space, where we know we'll be dropping them all anyway, and involve
|
||||||
// an extra walk down the frame construction item list.
|
// an extra walk down the frame construction item list.
|
||||||
auto excludesIgnorableWhitespace = [](nsIFrame* aParentFrame) {
|
auto excludesIgnorableWhitespace = [](nsIFrame* aParentFrame) {
|
||||||
return aParentFrame->IsFrameOfType(nsIFrame::eMathML);
|
return aParentFrame->IsMathMLFrame();
|
||||||
};
|
};
|
||||||
if (!aParentFrame || !excludesIgnorableWhitespace(aParentFrame) ||
|
if (!aParentFrame || !excludesIgnorableWhitespace(aParentFrame) ||
|
||||||
aParentFrame->IsGeneratedContentFrame() || !aChildContent->IsText()) {
|
aParentFrame->IsGeneratedContentFrame() || !aChildContent->IsText()) {
|
||||||
|
|
@ -2585,9 +2585,9 @@ nsIFrame* nsCSSFrameConstructor::ConstructDocElementFrame(
|
||||||
// Still need to process the child content
|
// Still need to process the child content
|
||||||
nsFrameList childList;
|
nsFrameList childList;
|
||||||
|
|
||||||
NS_ASSERTION(!contentFrame->IsBlockFrameOrSubclass() &&
|
NS_ASSERTION(
|
||||||
!contentFrame->IsFrameOfType(nsIFrame::eSVG),
|
!contentFrame->IsBlockFrameOrSubclass() && !contentFrame->IsSVGFrame(),
|
||||||
"Only XUL frames should reach here");
|
"Only XUL frames should reach here");
|
||||||
|
|
||||||
nsFrameConstructorSaveState floatSaveState;
|
nsFrameConstructorSaveState floatSaveState;
|
||||||
state.MaybePushFloatContainingBlock(contentFrame, floatSaveState);
|
state.MaybePushFloatContainingBlock(contentFrame, floatSaveState);
|
||||||
|
|
@ -3515,7 +3515,7 @@ nsCSSFrameConstructor::FindHTMLData(const Element& aElement,
|
||||||
PseudoStyleType::buttonContent}},
|
PseudoStyleType::buttonContent}},
|
||||||
SIMPLE_TAG_CHAIN(canvas, nsCSSFrameConstructor::FindCanvasData),
|
SIMPLE_TAG_CHAIN(canvas, nsCSSFrameConstructor::FindCanvasData),
|
||||||
SIMPLE_TAG_CREATE(video, NS_NewHTMLVideoFrame),
|
SIMPLE_TAG_CREATE(video, NS_NewHTMLVideoFrame),
|
||||||
SIMPLE_TAG_CREATE(audio, NS_NewHTMLVideoFrame),
|
SIMPLE_TAG_CREATE(audio, NS_NewHTMLAudioFrame),
|
||||||
SIMPLE_TAG_CREATE(progress, NS_NewProgressFrame),
|
SIMPLE_TAG_CREATE(progress, NS_NewProgressFrame),
|
||||||
SIMPLE_TAG_CREATE(meter, NS_NewMeterFrame),
|
SIMPLE_TAG_CREATE(meter, NS_NewMeterFrame),
|
||||||
SIMPLE_TAG_CHAIN(details, nsCSSFrameConstructor::FindDetailsData),
|
SIMPLE_TAG_CHAIN(details, nsCSSFrameConstructor::FindDetailsData),
|
||||||
|
|
@ -3972,7 +3972,7 @@ void nsCSSFrameConstructor::ConstructFrameFromItemInternal(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_ASSERTION(newFrame->IsFrameOfType(nsIFrame::eLineParticipant) ==
|
NS_ASSERTION(newFrame->IsLineParticipant() ==
|
||||||
((bits & FCDATA_IS_LINE_PARTICIPANT) != 0),
|
((bits & FCDATA_IS_LINE_PARTICIPANT) != 0),
|
||||||
"Incorrectly set FCDATA_IS_LINE_PARTICIPANT bits");
|
"Incorrectly set FCDATA_IS_LINE_PARTICIPANT bits");
|
||||||
|
|
||||||
|
|
@ -5578,7 +5578,7 @@ nsContainerFrame* nsCSSFrameConstructor::GetAbsoluteContainingBlock(
|
||||||
// Starting with aFrame, look for a frame that is absolutely positioned or
|
// Starting with aFrame, look for a frame that is absolutely positioned or
|
||||||
// relatively positioned (and transformed, if aType is FIXED)
|
// relatively positioned (and transformed, if aType is FIXED)
|
||||||
for (nsIFrame* frame = aFrame; frame; frame = frame->GetParent()) {
|
for (nsIFrame* frame = aFrame; frame; frame = frame->GetParent()) {
|
||||||
if (frame->IsFrameOfType(nsIFrame::eMathML)) {
|
if (frame->IsMathMLFrame()) {
|
||||||
// If it's mathml, bail out -- no absolute positioning out from inside
|
// If it's mathml, bail out -- no absolute positioning out from inside
|
||||||
// mathml frames. Note that we don't make this part of the loop
|
// mathml frames. Note that we don't make this part of the loop
|
||||||
// condition because of the stuff at the end of this method...
|
// condition because of the stuff at the end of this method...
|
||||||
|
|
@ -7472,7 +7472,7 @@ bool nsCSSFrameConstructor::ContentRemoved(nsIContent* aChild,
|
||||||
nsIFrame* possibleMathMLAncestor = parentType == LayoutFrameType::Block
|
nsIFrame* possibleMathMLAncestor = parentType == LayoutFrameType::Block
|
||||||
? parentFrame->GetParent()
|
? parentFrame->GetParent()
|
||||||
: parentFrame;
|
: parentFrame;
|
||||||
if (possibleMathMLAncestor->IsFrameOfType(nsIFrame::eMathML)) {
|
if (possibleMathMLAncestor->IsMathMLFrame()) {
|
||||||
LAYOUT_PHASE_TEMP_EXIT();
|
LAYOUT_PHASE_TEMP_EXIT();
|
||||||
RecreateFramesForContent(parentFrame->GetContent(), InsertionKind::Async);
|
RecreateFramesForContent(parentFrame->GetContent(), InsertionKind::Async);
|
||||||
LAYOUT_PHASE_TEMP_REENTER();
|
LAYOUT_PHASE_TEMP_REENTER();
|
||||||
|
|
@ -8435,14 +8435,13 @@ void nsCSSFrameConstructor::UpdateTableCellSpans(nsIContent* aContent) {
|
||||||
static nsIContent* GetTopmostMathMLElement(nsIContent* aMathMLContent) {
|
static nsIContent* GetTopmostMathMLElement(nsIContent* aMathMLContent) {
|
||||||
MOZ_ASSERT(aMathMLContent->IsMathMLElement());
|
MOZ_ASSERT(aMathMLContent->IsMathMLElement());
|
||||||
MOZ_ASSERT(aMathMLContent->GetPrimaryFrame());
|
MOZ_ASSERT(aMathMLContent->GetPrimaryFrame());
|
||||||
MOZ_ASSERT(
|
MOZ_ASSERT(aMathMLContent->GetPrimaryFrame()->IsMathMLFrame());
|
||||||
aMathMLContent->GetPrimaryFrame()->IsFrameOfType(nsIFrame::eMathML));
|
|
||||||
nsIContent* root = aMathMLContent;
|
nsIContent* root = aMathMLContent;
|
||||||
|
|
||||||
for (nsIContent* parent = aMathMLContent->GetFlattenedTreeParent(); parent;
|
for (nsIContent* parent = aMathMLContent->GetFlattenedTreeParent(); parent;
|
||||||
parent = parent->GetFlattenedTreeParent()) {
|
parent = parent->GetFlattenedTreeParent()) {
|
||||||
nsIFrame* frame = parent->GetPrimaryFrame();
|
nsIFrame* frame = parent->GetPrimaryFrame();
|
||||||
if (!frame || !frame->IsFrameOfType(nsIFrame::eMathML)) {
|
if (!frame || !frame->IsMathMLFrame()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
root = parent;
|
root = parent;
|
||||||
|
|
@ -8512,7 +8511,7 @@ void nsCSSFrameConstructor::RecreateFramesForContent(
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame* frame = aContent->GetPrimaryFrame();
|
nsIFrame* frame = aContent->GetPrimaryFrame();
|
||||||
if (frame && frame->IsFrameOfType(nsIFrame::eMathML)) {
|
if (frame && frame->IsMathMLFrame()) {
|
||||||
// Reframe the topmost MathML element to prevent exponential blowup
|
// Reframe the topmost MathML element to prevent exponential blowup
|
||||||
// (see bug 397518).
|
// (see bug 397518).
|
||||||
aContent = GetTopmostMathMLElement(aContent);
|
aContent = GetTopmostMathMLElement(aContent);
|
||||||
|
|
@ -9334,7 +9333,7 @@ static bool FrameWantsToBeInAnonymousItem(const nsIFrame* aContainerFrame,
|
||||||
|
|
||||||
// Any line-participant frames (e.g. text) definitely want to be wrapped in
|
// Any line-participant frames (e.g. text) definitely want to be wrapped in
|
||||||
// an anonymous flex/grid item.
|
// an anonymous flex/grid item.
|
||||||
if (aFrame->IsFrameOfType(nsIFrame::eLineParticipant)) {
|
if (aFrame->IsLineParticipant()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -10033,7 +10032,7 @@ nsFirstLetterFrame* nsCSSFrameConstructor::CreateFloatingLetterFrame(
|
||||||
MOZ_ASSERT(aParentStyle);
|
MOZ_ASSERT(aParentStyle);
|
||||||
|
|
||||||
nsFirstLetterFrame* letterFrame =
|
nsFirstLetterFrame* letterFrame =
|
||||||
NS_NewFirstLetterFrame(mPresShell, aComputedStyle);
|
NS_NewFloatingFirstLetterFrame(mPresShell, aComputedStyle);
|
||||||
// We don't want to use a text content for a non-text frame (because we want
|
// We don't want to use a text content for a non-text frame (because we want
|
||||||
// its primary frame to be a text frame).
|
// its primary frame to be a text frame).
|
||||||
nsIContent* letterContent = aParentFrame->GetContent();
|
nsIContent* letterContent = aParentFrame->GetContent();
|
||||||
|
|
@ -11280,7 +11279,7 @@ bool nsCSSFrameConstructor::WipeInsertionParent(nsContainerFrame* aFrame) {
|
||||||
|
|
||||||
// FIXME(emilio): This looks terribly inefficient if you insert elements deep
|
// FIXME(emilio): This looks terribly inefficient if you insert elements deep
|
||||||
// in a MathML subtree.
|
// in a MathML subtree.
|
||||||
if (aFrame->IsFrameOfType(nsIFrame::eMathML)) {
|
if (aFrame->IsMathMLFrame()) {
|
||||||
TRACE("MathML");
|
TRACE("MathML");
|
||||||
RecreateFramesForContent(aFrame->GetContent(), InsertionKind::Async);
|
RecreateFramesForContent(aFrame->GetContent(), InsertionKind::Async);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -682,7 +682,7 @@ class nsCSSFrameConstructor final : public nsFrameManager {
|
||||||
inline box. */
|
inline box. */
|
||||||
#define FCDATA_IS_INLINE 0x1000
|
#define FCDATA_IS_INLINE 0x1000
|
||||||
/* If FCDATA_IS_LINE_PARTICIPANT is set, the frame is something that will
|
/* If FCDATA_IS_LINE_PARTICIPANT is set, the frame is something that will
|
||||||
return true for IsFrameOfType(nsIFrame::eLineParticipant) */
|
return true for IsLineParticipant() */
|
||||||
#define FCDATA_IS_LINE_PARTICIPANT 0x2000
|
#define FCDATA_IS_LINE_PARTICIPANT 0x2000
|
||||||
/* If FCDATA_IS_LINE_BREAK is set, the frame is something that will
|
/* If FCDATA_IS_LINE_BREAK is set, the frame is something that will
|
||||||
induce a line break boundary before and after itself. */
|
induce a line break boundary before and after itself. */
|
||||||
|
|
|
||||||
|
|
@ -58,9 +58,12 @@ static nsIFrame* CheckForTrailingTextFrameRecursive(nsIFrame* aFrame,
|
||||||
nsIFrame* aStopAtFrame) {
|
nsIFrame* aStopAtFrame) {
|
||||||
if (aFrame == aStopAtFrame ||
|
if (aFrame == aStopAtFrame ||
|
||||||
((aFrame->IsTextFrame() &&
|
((aFrame->IsTextFrame() &&
|
||||||
(static_cast<nsTextFrame*>(aFrame))->IsAtEndOfLine())))
|
(static_cast<nsTextFrame*>(aFrame))->IsAtEndOfLine()))) {
|
||||||
return aFrame;
|
return aFrame;
|
||||||
if (!aFrame->IsFrameOfType(nsIFrame::eLineParticipant)) return nullptr;
|
}
|
||||||
|
if (!aFrame->IsLineParticipant()) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
for (nsIFrame* f : aFrame->PrincipalChildList()) {
|
for (nsIFrame* f : aFrame->PrincipalChildList()) {
|
||||||
nsIFrame* r = CheckForTrailingTextFrameRecursive(f, aStopAtFrame);
|
nsIFrame* r = CheckForTrailingTextFrameRecursive(f, aStopAtFrame);
|
||||||
|
|
@ -70,7 +73,7 @@ static nsIFrame* CheckForTrailingTextFrameRecursive(nsIFrame* aFrame,
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsLineBox* FindContainingLine(nsIFrame* aFrame) {
|
static nsLineBox* FindContainingLine(nsIFrame* aFrame) {
|
||||||
while (aFrame && aFrame->IsFrameOfType(nsIFrame::eLineParticipant)) {
|
while (aFrame && aFrame->IsLineParticipant()) {
|
||||||
nsIFrame* parent = aFrame->GetParent();
|
nsIFrame* parent = aFrame->GetParent();
|
||||||
nsBlockFrame* blockParent = do_QueryFrame(parent);
|
nsBlockFrame* blockParent = do_QueryFrame(parent);
|
||||||
if (blockParent) {
|
if (blockParent) {
|
||||||
|
|
|
||||||
|
|
@ -5047,10 +5047,10 @@ nscoord nsLayoutUtils::IntrinsicForAxis(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MOZ_UNLIKELY(aFlags & nsLayoutUtils::MIN_INTRINSIC_ISIZE) &&
|
if (MOZ_UNLIKELY(aFlags & nsLayoutUtils::MIN_INTRINSIC_ISIZE) &&
|
||||||
// FIXME: Bug 1715681. Should we use eReplacedSizing instead
|
// FIXME: Bug 1715681. Should we use HasReplacedSizing instead
|
||||||
// because eReplaced is set on some other frames which are
|
// because IsReplaced is set on some other frames which are
|
||||||
// non-replaced elements, e.g. <select>?
|
// non-replaced elements, e.g. <select>?
|
||||||
aFrame->IsFrameOfType(nsIFrame::eReplaced)) {
|
aFrame->IsReplaced()) {
|
||||||
// This is the 'min-width/height:auto' "transferred size" piece of:
|
// This is the 'min-width/height:auto' "transferred size" piece of:
|
||||||
// https://drafts.csswg.org/css-flexbox-1/#min-size-auto
|
// https://drafts.csswg.org/css-flexbox-1/#min-size-auto
|
||||||
// https://drafts.csswg.org/css-grid/#min-size-auto
|
// https://drafts.csswg.org/css-grid/#min-size-auto
|
||||||
|
|
@ -5079,8 +5079,7 @@ nscoord nsLayoutUtils::IntrinsicForAxis(
|
||||||
// then we can drop the check of eSupportsAspectRatio).
|
// then we can drop the check of eSupportsAspectRatio).
|
||||||
const AspectRatio ar = stylePos->mAspectRatio.ToLayoutRatio();
|
const AspectRatio ar = stylePos->mAspectRatio.ToLayoutRatio();
|
||||||
if (isInlineAxis && ar && nsIFrame::ToExtremumLength(styleISize) &&
|
if (isInlineAxis && ar && nsIFrame::ToExtremumLength(styleISize) &&
|
||||||
aFrame->IsFrameOfType(nsIFrame::eSupportsAspectRatio) &&
|
aFrame->SupportsAspectRatio() && !inlineSizeFromAspectRatio) {
|
||||||
!inlineSizeFromAspectRatio) {
|
|
||||||
// This 'B' in |styleBSize| means the block size of |aFrame|. We go into
|
// This 'B' in |styleBSize| means the block size of |aFrame|. We go into
|
||||||
// this branch only if |aAxis| is the inline axis of |aFrame|.
|
// this branch only if |aAxis| is the inline axis of |aFrame|.
|
||||||
const StyleSize& styleBSize =
|
const StyleSize& styleBSize =
|
||||||
|
|
@ -8211,8 +8210,7 @@ static bool ShouldInflateFontsForContainer(const nsIFrame* aFrame) {
|
||||||
// We also want to disable font inflation for containers that have
|
// We also want to disable font inflation for containers that have
|
||||||
// preformatted text.
|
// preformatted text.
|
||||||
// MathML cells need special treatment. See bug 1002526 comment 56.
|
// MathML cells need special treatment. See bug 1002526 comment 56.
|
||||||
(styleText->WhiteSpaceCanWrap(aFrame) ||
|
(styleText->WhiteSpaceCanWrap(aFrame) || aFrame->IsMathMLFrame());
|
||||||
aFrame->IsFrameOfType(nsIFrame::eMathML));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nscoord nsLayoutUtils::InflationMinFontSizeFor(const nsIFrame* aFrame) {
|
nscoord nsLayoutUtils::InflationMinFontSizeFor(const nsIFrame* aFrame) {
|
||||||
|
|
@ -8668,8 +8666,7 @@ AutoMaybeDisableFontInflation::AutoMaybeDisableFontInflation(nsIFrame* aFrame) {
|
||||||
// descendants) width, we could probably disable inflation in
|
// descendants) width, we could probably disable inflation in
|
||||||
// fewer cases than we currently do.
|
// fewer cases than we currently do.
|
||||||
// MathML cells need special treatment. See bug 1002526 comment 56.
|
// MathML cells need special treatment. See bug 1002526 comment 56.
|
||||||
if (aFrame->IsContainerForFontSizeInflation() &&
|
if (aFrame->IsContainerForFontSizeInflation() && !aFrame->IsMathMLFrame()) {
|
||||||
!aFrame->IsFrameOfType(nsIFrame::eMathML)) {
|
|
||||||
mPresContext = aFrame->PresContext();
|
mPresContext = aFrame->PresContext();
|
||||||
mOldValue = mPresContext->mInflationDisabledForShrinkWrap;
|
mOldValue = mPresContext->mInflationDisabledForShrinkWrap;
|
||||||
mPresContext->mInflationDisabledForShrinkWrap = true;
|
mPresContext->mInflationDisabledForShrinkWrap = true;
|
||||||
|
|
@ -9538,7 +9535,7 @@ bool nsLayoutUtils::IsInvisibleBreak(nsINode* aNode,
|
||||||
}
|
}
|
||||||
|
|
||||||
nsContainerFrame* f = frame->GetParent();
|
nsContainerFrame* f = frame->GetParent();
|
||||||
while (f && f->IsFrameOfType(nsIFrame::eLineParticipant)) {
|
while (f && f->IsLineParticipant()) {
|
||||||
f = f->GetParent();
|
f = f->GetParent();
|
||||||
}
|
}
|
||||||
nsBlockFrame* blockAncestor = do_QueryFrame(f);
|
nsBlockFrame* blockAncestor = do_QueryFrame(f);
|
||||||
|
|
@ -9763,7 +9760,7 @@ nsPoint nsLayoutUtils::ComputeOffsetToUserSpace(nsDisplayListBuilder* aBuilder,
|
||||||
nsPoint offsetToBoundingBox =
|
nsPoint offsetToBoundingBox =
|
||||||
aBuilder->ToReferenceFrame(aFrame) -
|
aBuilder->ToReferenceFrame(aFrame) -
|
||||||
SVGIntegrationUtils::GetOffsetToBoundingBox(aFrame);
|
SVGIntegrationUtils::GetOffsetToBoundingBox(aFrame);
|
||||||
if (!aFrame->IsFrameOfType(nsIFrame::eSVG)) {
|
if (!aFrame->IsSVGFrame()) {
|
||||||
// Snap the offset if the reference frame is not a SVG frame, since other
|
// Snap the offset if the reference frame is not a SVG frame, since other
|
||||||
// frames will be snapped to pixel when rendering.
|
// frames will be snapped to pixel when rendering.
|
||||||
offsetToBoundingBox =
|
offsetToBoundingBox =
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,6 @@ class nsCheckboxRadioFrame final : public nsAtomicContainerFrame,
|
||||||
nsPresContext* aPresContext);
|
nsPresContext* aPresContext);
|
||||||
|
|
||||||
// nsIFrame replacements
|
// nsIFrame replacements
|
||||||
virtual bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsAtomicContainerFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists) override;
|
const nsDisplayListSet& aLists) override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -744,11 +744,6 @@ class nsComboboxDisplayFrame final : public nsBlockFrame {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const final {
|
|
||||||
return nsBlockFrame::IsFrameOfType(aFlags &
|
|
||||||
~(nsIFrame::eReplacedContainsBlock));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
|
void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowInput, nsReflowStatus& aStatus) final;
|
const ReflowInput& aReflowInput, nsReflowStatus& aStatus) final;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,11 +94,6 @@ class nsComboboxControlFrame final : public nsBlockFrame,
|
||||||
|
|
||||||
void PaintFocus(DrawTarget& aDrawTarget, nsPoint aPt);
|
void PaintFocus(DrawTarget& aDrawTarget, nsPoint aPt);
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const final {
|
|
||||||
return nsBlockFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) final;
|
nsIFrame* aPrevInFlow) final;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,11 +47,6 @@ class nsDateTimeControlFrame final : public nsContainerFrame {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsContainerFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reflow
|
// Reflow
|
||||||
nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,10 +62,6 @@ class nsFieldSetFrame final : public nsContainerFrame {
|
||||||
nsIFrame* aOldFrame) override;
|
nsIFrame* aOldFrame) override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsContainerFrame::IsFrameOfType(
|
|
||||||
aFlags & ~nsIFrame::eCanContainOverflowContainers);
|
|
||||||
}
|
|
||||||
nsIScrollableFrame* GetScrollTargetFrame() const override;
|
nsIScrollableFrame* GetScrollTargetFrame() const override;
|
||||||
|
|
||||||
// Return the block wrapper around our kids.
|
// Return the block wrapper around our kids.
|
||||||
|
|
|
||||||
|
|
@ -110,11 +110,6 @@ class nsFileControlFrame final : public nsBlockFrame,
|
||||||
bool aSupportsMultiple);
|
bool aSupportsMultiple);
|
||||||
};
|
};
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsBlockFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The text box input.
|
* The text box input.
|
||||||
* @see nsFileControlFrame::CreateAnonymousContent
|
* @see nsFileControlFrame::CreateAnonymousContent
|
||||||
|
|
|
||||||
|
|
@ -80,11 +80,6 @@ class nsHTMLButtonControlFrame : public nsContainerFrame,
|
||||||
return PrincipalChildList().FirstChild()->GetContentInsertionFrame();
|
return PrincipalChildList().FirstChild()->GetContentInsertionFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsContainerFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return the ::-moz-button-content anonymous box.
|
// Return the ::-moz-button-content anonymous box.
|
||||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,11 +88,6 @@ class nsListControlFrame final : public nsHTMLScrollFrame,
|
||||||
|
|
||||||
mozilla::dom::HTMLOptionElement* GetCurrentOption() const;
|
mozilla::dom::HTMLOptionElement* GetCurrentOption() const;
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const final {
|
|
||||||
return nsHTMLScrollFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
nsresult GetFrameName(nsAString& aResult) const final;
|
nsresult GetFrameName(nsAString& aResult) const final;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -58,11 +58,6 @@ class nsMeterFrame final : public nsContainerFrame,
|
||||||
virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
||||||
virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
||||||
|
|
||||||
virtual bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsContainerFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the frame and its child should use the native style.
|
* Returns whether the frame and its child should use the native style.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -63,11 +63,6 @@ class nsProgressFrame final : public nsContainerFrame,
|
||||||
virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
||||||
virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
||||||
|
|
||||||
virtual bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsContainerFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the frame and its child should use the native style.
|
* Returns whether the frame and its child should use the native style.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -87,11 +87,6 @@ class nsRangeFrame final : public nsContainerFrame,
|
||||||
virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
||||||
virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
||||||
|
|
||||||
virtual bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsContainerFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the slider's thumb moves horizontally, or else false if it
|
* Returns true if the slider's thumb moves horizontally, or else false if it
|
||||||
* moves vertically.
|
* moves vertically.
|
||||||
|
|
|
||||||
|
|
@ -107,11 +107,6 @@ class nsTextControlFrame : public nsContainerFrame,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsContainerFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
|
||||||
}
|
|
||||||
|
|
||||||
// nsIAnonymousContentCreator
|
// nsIAnonymousContentCreator
|
||||||
nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
|
nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
|
||||||
void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
|
void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
|
||||||
|
|
|
||||||
|
|
@ -63,11 +63,6 @@ class BRFrame final : public nsIFrame {
|
||||||
WritingMode aWM, BaselineSharingGroup aBaselineGroup,
|
WritingMode aWM, BaselineSharingGroup aBaselineGroup,
|
||||||
BaselineExportContext) const override;
|
BaselineExportContext) const override;
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsIFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eReplaced | nsIFrame::eLineParticipant));
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef ACCESSIBILITY
|
#ifdef ACCESSIBILITY
|
||||||
mozilla::a11y::AccType AccessibleType() override;
|
mozilla::a11y::AccType AccessibleType() override;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -3,22 +3,16 @@
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
|
||||||
# Leaf constants to pass to Frame's leafness argument.
|
|
||||||
LEAF = "Leaf"
|
|
||||||
NOT_LEAF = "NotLeaf"
|
|
||||||
DYNAMIC_LEAF = "DynamicLeaf"
|
|
||||||
|
|
||||||
|
|
||||||
class FrameClass:
|
class FrameClass:
|
||||||
def __init__(self, cls):
|
def __init__(self, cls):
|
||||||
self.cls = cls
|
self.cls = cls
|
||||||
|
|
||||||
|
|
||||||
class Frame(FrameClass):
|
class Frame(FrameClass):
|
||||||
def __init__(self, cls, ty, leafness):
|
def __init__(self, cls, ty, flags):
|
||||||
FrameClass.__init__(self, cls)
|
FrameClass.__init__(self, cls)
|
||||||
self.ty = ty
|
self.ty = ty
|
||||||
self.leafness = leafness
|
self.flags = flags
|
||||||
self.is_concrete = True
|
self.is_concrete = True
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,37 @@
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
# Frame class definitions, used to generate FrameIdList.h and FrameTypeList.h
|
# Frame class definitions, used to generate FrameIdList.h and FrameTypeList.h
|
||||||
|
|
||||||
from FrameClass import DYNAMIC_LEAF, LEAF, NOT_LEAF, AbstractFrame, Frame
|
from FrameClass import AbstractFrame, Frame
|
||||||
|
|
||||||
|
# Most frames support these.
|
||||||
|
COMMON = {"SupportsCSSTransforms", "SupportsContainLayoutAndPaint", "SupportsAspectRatio"}
|
||||||
|
LEAF = {"Leaf"}
|
||||||
|
MATHML = {"MathML"}
|
||||||
|
SVG = {"SVG"}
|
||||||
|
|
||||||
|
BLOCK = COMMON | {"CanContainOverflowContainers"}
|
||||||
|
|
||||||
|
REPLACED = COMMON | {"Replaced"}
|
||||||
|
REPLACED_SIZING = REPLACED | {"ReplacedSizing"}
|
||||||
|
REPLACED_WITH_BLOCK = REPLACED | {"ReplacedContainsBlock"}
|
||||||
|
REPLACED_SIZING_WITH_BLOCK = REPLACED_SIZING | REPLACED_WITH_BLOCK
|
||||||
|
|
||||||
|
TABLE = COMMON - {"SupportsCSSTransforms"}
|
||||||
|
TABLE_PART = {"SupportsCSSTransforms", "TablePart"}
|
||||||
|
TABLE_CELL = TABLE_PART | {"SupportsContainLayoutAndPaint"}
|
||||||
|
MATHML_CONTAINER = (COMMON - {"SupportsContainLayoutAndPaint"}) | MATHML
|
||||||
|
SVG_CONTENT = (COMMON - {"SupportsContainLayoutAndPaint"}) | SVG
|
||||||
|
SVG_CONTAINER = SVG_CONTENT | {"SVGContainer"}
|
||||||
|
|
||||||
|
# NOTE: Intentionally not including "COMMON" here.
|
||||||
|
INLINE = {"BidiInlineContainer", "LineParticipant"}
|
||||||
|
RUBY_CONTENT = {"LineParticipant"}
|
||||||
|
# FIXME(bug 713387): Shouldn't be Replaced, probably.
|
||||||
|
TEXT = COMMON | {"Replaced", "LineParticipant"} | LEAF
|
||||||
|
|
||||||
# See FrameClass.py and GenerateFrameLists.py for implementation details.
|
# See FrameClass.py and GenerateFrameLists.py for implementation details.
|
||||||
# The following is a list of all the frame classes, followed by the frame type,
|
# The following is a list of all the frame classes, followed by the frame type,
|
||||||
# and whether they are a leaf.
|
# and a set of flags.
|
||||||
#
|
#
|
||||||
# The frame type is somewhat arbitrary (could literally be anything) but for
|
# The frame type is somewhat arbitrary (could literally be anything) but for
|
||||||
# new frame class implementations it's probably a good idea to make it a unique
|
# new frame class implementations it's probably a good idea to make it a unique
|
||||||
|
|
@ -15,131 +41,134 @@ from FrameClass import DYNAMIC_LEAF, LEAF, NOT_LEAF, AbstractFrame, Frame
|
||||||
#
|
#
|
||||||
# See bug 1555477 for some related discussion about the whole Type() set-up.
|
# See bug 1555477 for some related discussion about the whole Type() set-up.
|
||||||
FRAME_CLASSES = [
|
FRAME_CLASSES = [
|
||||||
Frame("BRFrame", "Br", LEAF),
|
Frame("BRFrame", "Br", REPLACED | LEAF | {"LineParticipant"}),
|
||||||
Frame("nsBCTableCellFrame", "TableCell", NOT_LEAF),
|
Frame("nsBCTableCellFrame", "TableCell", TABLE_CELL),
|
||||||
Frame("nsBackdropFrame", "Backdrop", LEAF),
|
Frame("nsBackdropFrame", "Backdrop", COMMON | LEAF),
|
||||||
Frame("nsBlockFrame", "Block", NOT_LEAF),
|
Frame("nsBlockFrame", "Block", BLOCK),
|
||||||
Frame("nsCanvasFrame", "Canvas", NOT_LEAF),
|
Frame("nsCanvasFrame", "Canvas", BLOCK),
|
||||||
Frame("nsCheckboxRadioFrame", "CheckboxRadio", LEAF),
|
# FIXME(emilio, bug 1866692): These don't have a block, wtf? Can we remove the "ReplacedContainsBlock" flag
|
||||||
Frame("nsColorControlFrame", "ColorControl", LEAF),
|
Frame("nsCheckboxRadioFrame", "CheckboxRadio", REPLACED_WITH_BLOCK | LEAF),
|
||||||
Frame("nsColumnSetFrame", "ColumnSet", NOT_LEAF),
|
Frame("nsColorControlFrame", "ColorControl", REPLACED_WITH_BLOCK | LEAF),
|
||||||
Frame("ColumnSetWrapperFrame", "ColumnSetWrapper", NOT_LEAF),
|
Frame("nsColumnSetFrame", "ColumnSet", COMMON),
|
||||||
Frame("nsComboboxControlFrame", "ComboboxControl", NOT_LEAF),
|
Frame("ColumnSetWrapperFrame", "ColumnSetWrapper", BLOCK),
|
||||||
Frame("nsComboboxDisplayFrame", "ComboboxDisplay", NOT_LEAF),
|
Frame("nsComboboxControlFrame", "ComboboxControl", BLOCK | REPLACED_WITH_BLOCK),
|
||||||
Frame("nsContinuingTextFrame", "Text", LEAF),
|
# FIXME(emilio, bug 1362907): Revisit these after that bug, this is the
|
||||||
Frame("nsDateTimeControlFrame", "DateTimeControl", NOT_LEAF),
|
# only frame that has ReplacedContainsBlock but not Replaced, which is
|
||||||
Frame("nsFieldSetFrame", "FieldSet", NOT_LEAF),
|
# sketchy.
|
||||||
Frame("nsFileControlFrame", "Block", LEAF),
|
Frame("nsComboboxDisplayFrame", "ComboboxDisplay", REPLACED_WITH_BLOCK - {"Replaced"}),
|
||||||
Frame("FileControlLabelFrame", "Block", NOT_LEAF),
|
Frame("nsContinuingTextFrame", "Text", TEXT),
|
||||||
Frame("nsFirstLetterFrame", "Letter", NOT_LEAF),
|
Frame("nsDateTimeControlFrame", "DateTimeControl", REPLACED_WITH_BLOCK),
|
||||||
Frame("nsFirstLineFrame", "Line", NOT_LEAF),
|
Frame("nsFieldSetFrame", "FieldSet", BLOCK),
|
||||||
Frame("nsFlexContainerFrame", "FlexContainer", NOT_LEAF),
|
Frame("nsFileControlFrame", "Block", REPLACED_WITH_BLOCK | LEAF),
|
||||||
Frame("nsIFrame", "None", NOT_LEAF),
|
Frame("FileControlLabelFrame", "Block", BLOCK | LEAF),
|
||||||
Frame("nsGfxButtonControlFrame", "GfxButtonControl", LEAF),
|
Frame("nsFirstLetterFrame", "Letter", INLINE),
|
||||||
Frame("nsGridContainerFrame", "GridContainer", NOT_LEAF),
|
Frame("nsFloatingFirstLetterFrame", "Letter", INLINE - {"LineParticipant"}),
|
||||||
Frame("nsHTMLButtonControlFrame", "HTMLButtonControl", NOT_LEAF),
|
Frame("nsFirstLineFrame", "Line", INLINE),
|
||||||
Frame("nsHTMLCanvasFrame", "HTMLCanvas", NOT_LEAF),
|
Frame("nsFlexContainerFrame", "FlexContainer", BLOCK),
|
||||||
Frame("nsHTMLFramesetBlankFrame", "None", LEAF),
|
Frame("nsIFrame", "None", COMMON),
|
||||||
Frame("nsHTMLFramesetBorderFrame", "None", LEAF),
|
Frame("nsGfxButtonControlFrame", "GfxButtonControl", REPLACED_WITH_BLOCK | LEAF),
|
||||||
Frame("nsHTMLFramesetFrame", "FrameSet", LEAF),
|
Frame("nsGridContainerFrame", "GridContainer", BLOCK),
|
||||||
Frame("nsHTMLScrollFrame", "Scroll", NOT_LEAF),
|
Frame("nsHTMLButtonControlFrame", "HTMLButtonControl", REPLACED_WITH_BLOCK),
|
||||||
Frame("nsImageControlFrame", "ImageControl", LEAF),
|
Frame("nsHTMLCanvasFrame", "HTMLCanvas", REPLACED_SIZING),
|
||||||
Frame("nsImageFrame", "Image", DYNAMIC_LEAF),
|
Frame("nsHTMLFramesetBlankFrame", "None", COMMON | LEAF),
|
||||||
Frame("nsInlineFrame", "Inline", NOT_LEAF),
|
Frame("nsHTMLFramesetBorderFrame", "None", COMMON | LEAF),
|
||||||
Frame("nsListControlFrame", "ListControl", NOT_LEAF),
|
Frame("nsHTMLFramesetFrame", "FrameSet", COMMON | LEAF),
|
||||||
Frame("nsMathMLFrame", "None", NOT_LEAF),
|
Frame("nsHTMLScrollFrame", "Scroll", COMMON),
|
||||||
Frame("nsMathMLmactionFrame", "None", NOT_LEAF),
|
Frame("nsImageControlFrame", "ImageControl", REPLACED_SIZING | LEAF),
|
||||||
Frame("nsMathMLmathBlockFrame", "Block", NOT_LEAF),
|
Frame("nsImageFrame", "Image", REPLACED_SIZING | {"LeafDynamic"}),
|
||||||
Frame("nsMathMLmathInlineFrame", "Inline", NOT_LEAF),
|
Frame("nsInlineFrame", "Inline", INLINE),
|
||||||
Frame("nsMathMLmencloseFrame", "None", NOT_LEAF),
|
Frame("nsListControlFrame", "ListControl", REPLACED_WITH_BLOCK),
|
||||||
Frame("nsMathMLmfracFrame", "None", NOT_LEAF),
|
Frame("nsMathMLmathBlockFrame", "Block", BLOCK | MATHML),
|
||||||
Frame("nsMathMLmmultiscriptsFrame", "None", NOT_LEAF),
|
Frame("nsMathMLmathInlineFrame", "Inline", INLINE | MATHML),
|
||||||
Frame("nsMathMLmoFrame", "None", NOT_LEAF),
|
Frame("nsMathMLmencloseFrame", "None", MATHML_CONTAINER),
|
||||||
Frame("nsMathMLmpaddedFrame", "None", NOT_LEAF),
|
Frame("nsMathMLmfracFrame", "None", MATHML_CONTAINER),
|
||||||
Frame("nsMathMLmrootFrame", "None", NOT_LEAF),
|
Frame("nsMathMLmmultiscriptsFrame", "None", MATHML_CONTAINER),
|
||||||
Frame("nsMathMLmrowFrame", "None", NOT_LEAF),
|
Frame("nsMathMLmoFrame", "None", MATHML_CONTAINER),
|
||||||
Frame("nsMathMLmspaceFrame", "None", LEAF),
|
Frame("nsMathMLmpaddedFrame", "None", MATHML_CONTAINER),
|
||||||
Frame("nsMathMLmsqrtFrame", "None", NOT_LEAF),
|
Frame("nsMathMLmrootFrame", "None", MATHML_CONTAINER),
|
||||||
Frame("nsMathMLmtableFrame", "Table", NOT_LEAF),
|
Frame("nsMathMLmrowFrame", "None", MATHML_CONTAINER),
|
||||||
Frame("nsMathMLmtableWrapperFrame", "TableWrapper", NOT_LEAF),
|
Frame("nsMathMLmspaceFrame", "None", MATHML_CONTAINER | LEAF),
|
||||||
Frame("nsMathMLmtdFrame", "TableCell", NOT_LEAF),
|
Frame("nsMathMLmsqrtFrame", "None", MATHML_CONTAINER),
|
||||||
Frame("nsMathMLmtdInnerFrame", "Block", NOT_LEAF),
|
Frame("nsMathMLmtableFrame", "Table", TABLE | MATHML),
|
||||||
Frame("nsMathMLmtrFrame", "TableRow", NOT_LEAF),
|
Frame("nsMathMLmtableWrapperFrame", "TableWrapper", BLOCK | MATHML),
|
||||||
Frame("nsMathMLmunderoverFrame", "None", NOT_LEAF),
|
Frame("nsMathMLmtdFrame", "TableCell", TABLE_CELL | MATHML),
|
||||||
Frame("nsMathMLsemanticsFrame", "None", NOT_LEAF),
|
Frame("nsMathMLmtdInnerFrame", "Block", BLOCK | MATHML),
|
||||||
Frame("nsMathMLTokenFrame", "None", NOT_LEAF),
|
Frame("nsMathMLmtrFrame", "TableRow", TABLE_PART | MATHML),
|
||||||
Frame("nsMenuPopupFrame", "MenuPopup", NOT_LEAF),
|
Frame("nsMathMLmunderoverFrame", "None", MATHML_CONTAINER),
|
||||||
Frame("nsMeterFrame", "Meter", LEAF),
|
Frame("nsMathMLTokenFrame", "None", MATHML_CONTAINER),
|
||||||
Frame("nsNumberControlFrame", "TextInput", LEAF),
|
Frame("nsMenuPopupFrame", "MenuPopup", BLOCK),
|
||||||
Frame("nsPageBreakFrame", "PageBreak", LEAF),
|
Frame("nsMeterFrame", "Meter", REPLACED_WITH_BLOCK | LEAF),
|
||||||
Frame("nsPageContentFrame", "PageContent", NOT_LEAF),
|
Frame("nsNumberControlFrame", "TextInput", REPLACED_WITH_BLOCK | LEAF),
|
||||||
Frame("nsPageFrame", "Page", NOT_LEAF),
|
Frame("nsPageBreakFrame", "PageBreak", COMMON | LEAF),
|
||||||
Frame("nsPlaceholderFrame", "Placeholder", LEAF),
|
Frame("nsPageContentFrame", "PageContent", BLOCK),
|
||||||
Frame("nsProgressFrame", "Progress", LEAF),
|
Frame("nsPageFrame", "Page", COMMON),
|
||||||
Frame("nsRangeFrame", "Range", LEAF),
|
Frame("nsPlaceholderFrame", "Placeholder", COMMON | LEAF),
|
||||||
Frame("nsRubyBaseContainerFrame", "RubyBaseContainer", NOT_LEAF),
|
Frame("nsProgressFrame", "Progress", REPLACED_WITH_BLOCK | LEAF),
|
||||||
Frame("nsRubyBaseFrame", "RubyBase", NOT_LEAF),
|
Frame("nsRangeFrame", "Range", REPLACED_WITH_BLOCK | LEAF),
|
||||||
Frame("nsRubyFrame", "Ruby", NOT_LEAF),
|
Frame("nsRubyBaseContainerFrame", "RubyBaseContainer", RUBY_CONTENT),
|
||||||
Frame("nsRubyTextContainerFrame", "RubyTextContainer", NOT_LEAF),
|
Frame("nsRubyBaseFrame", "RubyBase", RUBY_CONTENT),
|
||||||
Frame("nsRubyTextFrame", "RubyText", NOT_LEAF),
|
Frame("nsRubyFrame", "Ruby", RUBY_CONTENT),
|
||||||
Frame("SimpleXULLeafFrame", "SimpleXULLeaf", LEAF),
|
Frame("nsRubyTextContainerFrame", "RubyTextContainer", {"None"}),
|
||||||
Frame("nsScrollbarButtonFrame", "SimpleXULLeaf", LEAF),
|
Frame("nsRubyTextFrame", "RubyText", RUBY_CONTENT),
|
||||||
Frame("nsScrollbarFrame", "Scrollbar", NOT_LEAF),
|
Frame("SimpleXULLeafFrame", "SimpleXULLeaf", COMMON | LEAF),
|
||||||
|
Frame("nsScrollbarButtonFrame", "SimpleXULLeaf", COMMON | LEAF),
|
||||||
|
Frame("nsScrollbarFrame", "Scrollbar", COMMON),
|
||||||
Frame("nsSearchControlFrame", "SearchControl", LEAF),
|
Frame("nsSearchControlFrame", "SearchControl", LEAF),
|
||||||
Frame("nsSelectsAreaFrame", "Block", NOT_LEAF),
|
Frame("nsSelectsAreaFrame", "Block", BLOCK),
|
||||||
Frame("nsPageSequenceFrame", "PageSequence", NOT_LEAF),
|
Frame("nsPageSequenceFrame", "PageSequence", COMMON),
|
||||||
Frame("nsSliderFrame", "Slider", NOT_LEAF),
|
Frame("nsSliderFrame", "Slider", COMMON),
|
||||||
Frame("nsSplitterFrame", "SimpleXULLeaf", NOT_LEAF),
|
Frame("nsSplitterFrame", "SimpleXULLeaf", COMMON | LEAF),
|
||||||
Frame("nsSubDocumentFrame", "SubDocument", LEAF),
|
Frame("nsSubDocumentFrame", "SubDocument", REPLACED_SIZING_WITH_BLOCK | LEAF),
|
||||||
Frame("PrintedSheetFrame", "PrintedSheet", NOT_LEAF),
|
Frame("PrintedSheetFrame", "PrintedSheet", COMMON),
|
||||||
Frame("SVGAFrame", "SVGA", NOT_LEAF),
|
Frame("SVGAFrame", "SVGA", SVG_CONTAINER),
|
||||||
Frame("SVGClipPathFrame", "SVGClipPath", NOT_LEAF),
|
Frame("SVGClipPathFrame", "SVGClipPath", SVG_CONTAINER),
|
||||||
Frame("SVGContainerFrame", "None", NOT_LEAF),
|
Frame("SVGContainerFrame", "None", SVG_CONTAINER),
|
||||||
Frame("SVGFEContainerFrame", "SVGFEContainer", NOT_LEAF),
|
Frame("SVGFEContainerFrame", "SVGFEContainer", SVG_CONTENT),
|
||||||
Frame("SVGFEImageFrame", "SVGFEImage", LEAF),
|
Frame("SVGFEImageFrame", "SVGFEImage", SVG_CONTENT | LEAF),
|
||||||
Frame("SVGFELeafFrame", "SVGFELeaf", LEAF),
|
Frame("SVGFELeafFrame", "SVGFELeaf", SVG_CONTENT | LEAF),
|
||||||
Frame("SVGFEUnstyledLeafFrame", "SVGFEUnstyledLeaf", LEAF),
|
Frame("SVGFEUnstyledLeafFrame", "SVGFEUnstyledLeaf", SVG_CONTENT | LEAF),
|
||||||
Frame("SVGFilterFrame", "SVGFilter", NOT_LEAF),
|
Frame("SVGFilterFrame", "SVGFilter", SVG_CONTAINER),
|
||||||
Frame("SVGForeignObjectFrame", "SVGForeignObject", NOT_LEAF),
|
Frame("SVGForeignObjectFrame", "SVGForeignObject", SVG_CONTENT),
|
||||||
Frame("SVGGenericContainerFrame", "SVGGenericContainer", NOT_LEAF),
|
Frame("SVGGeometryFrame", "SVGGeometry", SVG_CONTENT | LEAF),
|
||||||
Frame("SVGGeometryFrame", "SVGGeometry", LEAF),
|
Frame("SVGGFrame", "SVGG", SVG_CONTAINER),
|
||||||
Frame("SVGGFrame", "SVGG", NOT_LEAF),
|
Frame("SVGImageFrame", "SVGImage", SVG_CONTENT | LEAF),
|
||||||
Frame("SVGImageFrame", "SVGImage", LEAF),
|
Frame("SVGInnerSVGFrame", "SVGInnerSVG", SVG_CONTAINER),
|
||||||
Frame("SVGInnerSVGFrame", "SVGInnerSVG", NOT_LEAF),
|
Frame("SVGLinearGradientFrame", "SVGLinearGradient", SVG_CONTAINER),
|
||||||
Frame("SVGLinearGradientFrame", "SVGLinearGradient", NOT_LEAF),
|
Frame("SVGMarkerFrame", "SVGMarker", SVG_CONTAINER),
|
||||||
Frame("SVGMarkerFrame", "SVGMarker", NOT_LEAF),
|
Frame("SVGMarkerAnonChildFrame", "SVGMarkerAnonChild", SVG_CONTAINER),
|
||||||
Frame("SVGMarkerAnonChildFrame", "SVGMarkerAnonChild", NOT_LEAF),
|
Frame("SVGMaskFrame", "SVGMask", SVG_CONTAINER),
|
||||||
Frame("SVGMaskFrame", "SVGMask", NOT_LEAF),
|
Frame("SVGOuterSVGFrame", "SVGOuterSVG", SVG_CONTAINER | {"Replaced", "ReplacedSizing", "SupportsContainLayoutAndPaint"}),
|
||||||
Frame("SVGOuterSVGFrame", "SVGOuterSVG", NOT_LEAF),
|
Frame("SVGOuterSVGAnonChildFrame", "SVGOuterSVGAnonChild", SVG_CONTAINER),
|
||||||
Frame("SVGOuterSVGAnonChildFrame", "SVGOuterSVGAnonChild", NOT_LEAF),
|
Frame("SVGPatternFrame", "SVGPattern", SVG_CONTAINER),
|
||||||
Frame("SVGPatternFrame", "SVGPattern", NOT_LEAF),
|
Frame("SVGRadialGradientFrame", "SVGRadialGradient", SVG_CONTAINER),
|
||||||
Frame("SVGRadialGradientFrame", "SVGRadialGradient", NOT_LEAF),
|
Frame("SVGStopFrame", "SVGStop", SVG_CONTENT | LEAF),
|
||||||
Frame("SVGStopFrame", "SVGStop", LEAF),
|
Frame("SVGSwitchFrame", "SVGSwitch", SVG_CONTAINER),
|
||||||
Frame("SVGSwitchFrame", "SVGSwitch", NOT_LEAF),
|
Frame("SVGSymbolFrame", "SVGSymbol", SVG_CONTAINER),
|
||||||
Frame("SVGSymbolFrame", "SVGSymbol", NOT_LEAF),
|
Frame("SVGTextFrame", "SVGText", SVG_CONTAINER),
|
||||||
Frame("SVGTextFrame", "SVGText", NOT_LEAF),
|
|
||||||
# Not a leaf, though it always has a ShadowRoot, so in practice light DOM
|
# Not a leaf, though it always has a ShadowRoot, so in practice light DOM
|
||||||
# children never render.
|
# children never render.
|
||||||
Frame("SVGUseFrame", "SVGUse", NOT_LEAF),
|
Frame("SVGUseFrame", "SVGUse", SVG_CONTAINER),
|
||||||
Frame("MiddleCroppingLabelFrame", "MiddleCroppingLabel", LEAF),
|
Frame("MiddleCroppingLabelFrame", "MiddleCroppingLabel", BLOCK | LEAF),
|
||||||
Frame("SVGViewFrame", "SVGView", LEAF),
|
Frame("SVGViewFrame", "SVGView", SVG_CONTENT | LEAF),
|
||||||
Frame("nsTableCellFrame", "TableCell", NOT_LEAF),
|
Frame("nsTableCellFrame", "TableCell", TABLE_CELL),
|
||||||
Frame("nsTableColFrame", "TableCol", LEAF),
|
Frame("nsTableColFrame", "TableCol", TABLE_PART),
|
||||||
Frame("nsTableColGroupFrame", "TableColGroup", NOT_LEAF),
|
Frame("nsTableColGroupFrame", "TableColGroup", TABLE_PART),
|
||||||
Frame("nsTableFrame", "Table", NOT_LEAF),
|
Frame("nsTableFrame", "Table", TABLE),
|
||||||
Frame("nsTableWrapperFrame", "TableWrapper", NOT_LEAF),
|
Frame("nsTableWrapperFrame", "TableWrapper", BLOCK),
|
||||||
Frame("nsTableRowFrame", "TableRow", NOT_LEAF),
|
Frame("nsTableRowFrame", "TableRow", TABLE_PART),
|
||||||
Frame("nsTableRowGroupFrame", "TableRowGroup", NOT_LEAF),
|
Frame("nsTableRowGroupFrame", "TableRowGroup", TABLE_PART),
|
||||||
Frame("nsTextControlFrame", "TextInput", LEAF),
|
Frame("nsTextControlFrame", "TextInput", REPLACED_WITH_BLOCK | LEAF),
|
||||||
Frame("nsTextFrame", "Text", LEAF),
|
Frame("nsTextFrame", "Text", TEXT),
|
||||||
Frame("nsTreeBodyFrame", "SimpleXULLeaf", LEAF),
|
Frame("nsTreeBodyFrame", "SimpleXULLeaf", COMMON | LEAF),
|
||||||
Frame("nsVideoFrame", "HTMLVideo", NOT_LEAF),
|
Frame("nsVideoFrame", "HTMLVideo", REPLACED_SIZING),
|
||||||
Frame("ViewportFrame", "Viewport", NOT_LEAF),
|
Frame("nsAudioFrame", "HTMLVideo", REPLACED_SIZING - {"SupportsAspectRatio"}),
|
||||||
Frame("WBRFrame", "Wbr", LEAF),
|
Frame("ViewportFrame", "Viewport", COMMON),
|
||||||
|
Frame("WBRFrame", "Wbr", COMMON | LEAF),
|
||||||
# Non-concrete classes (for FrameIID use)
|
# Non-concrete classes (for FrameIID use)
|
||||||
AbstractFrame("MiddleCroppingBlockFrame"),
|
AbstractFrame("MiddleCroppingBlockFrame"),
|
||||||
AbstractFrame("nsContainerFrame"),
|
AbstractFrame("nsContainerFrame"),
|
||||||
AbstractFrame("nsLeafFrame"),
|
AbstractFrame("nsLeafFrame"),
|
||||||
|
AbstractFrame("nsMathMLFrame"),
|
||||||
AbstractFrame("nsMathMLContainerFrame"),
|
AbstractFrame("nsMathMLContainerFrame"),
|
||||||
AbstractFrame("nsRubyContentFrame"),
|
AbstractFrame("nsRubyContentFrame"),
|
||||||
AbstractFrame("nsSplittableFrame"),
|
AbstractFrame("nsSplittableFrame"),
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ def generate_frame_id_list_h(output, *ignore):
|
||||||
for group in groups:
|
for group in groups:
|
||||||
for frame in group:
|
for frame in group:
|
||||||
output.write(
|
output.write(
|
||||||
"FRAME_ID(%s, %s, %s)\n" % (frame.cls, frame.ty, frame.leafness)
|
"FRAME_ID(%s, %s, %s)\n" % (frame.cls, frame.ty, "|".join("ClassFlags::%s" % flag for flag in sorted(frame.flags)))
|
||||||
)
|
)
|
||||||
for frame in FRAME_CLASSES:
|
for frame in FRAME_CLASSES:
|
||||||
if not frame.is_concrete:
|
if not frame.is_concrete:
|
||||||
|
|
|
||||||
|
|
@ -157,9 +157,8 @@ ReflowInput::ReflowInput(nsPresContext* aPresContext,
|
||||||
: SizeComputationInput(aFrame, aParentReflowInput.mRenderingContext),
|
: SizeComputationInput(aFrame, aParentReflowInput.mRenderingContext),
|
||||||
mParentReflowInput(&aParentReflowInput),
|
mParentReflowInput(&aParentReflowInput),
|
||||||
mFloatManager(aParentReflowInput.mFloatManager),
|
mFloatManager(aParentReflowInput.mFloatManager),
|
||||||
mLineLayout(mFrame->IsFrameOfType(nsIFrame::eLineParticipant)
|
mLineLayout(mFrame->IsLineParticipant() ? aParentReflowInput.mLineLayout
|
||||||
? aParentReflowInput.mLineLayout
|
: nullptr),
|
||||||
: nullptr),
|
|
||||||
mBreakType(aParentReflowInput.mBreakType),
|
mBreakType(aParentReflowInput.mBreakType),
|
||||||
mPercentBSizeObserver(
|
mPercentBSizeObserver(
|
||||||
(aParentReflowInput.mPercentBSizeObserver &&
|
(aParentReflowInput.mPercentBSizeObserver &&
|
||||||
|
|
@ -371,8 +370,7 @@ void ReflowInput::Init(nsPresContext* aPresContext,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mFlags.mIsReplaced = mFrame->IsFrameOfType(nsIFrame::eReplaced) ||
|
mFlags.mIsReplaced = mFrame->IsReplaced() || mFrame->IsReplacedWithBlock();
|
||||||
mFrame->IsFrameOfType(nsIFrame::eReplacedContainsBlock);
|
|
||||||
|
|
||||||
InitConstraints(aPresContext, aContainingBlockSize, aBorder, aPadding, type);
|
InitConstraints(aPresContext, aContainingBlockSize, aBorder, aPadding, type);
|
||||||
|
|
||||||
|
|
@ -449,13 +447,13 @@ void ReflowInput::Init(nsPresContext* aPresContext,
|
||||||
SetAvailableBSize(NS_UNCONSTRAINEDSIZE);
|
SetAvailableBSize(NS_UNCONSTRAINEDSIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
LAYOUT_WARN_IF_FALSE((mStyleDisplay->IsInlineOutsideStyle() &&
|
LAYOUT_WARN_IF_FALSE(
|
||||||
!mFrame->IsFrameOfType(nsIFrame::eReplaced)) ||
|
(mStyleDisplay->IsInlineOutsideStyle() && !mFrame->IsReplaced()) ||
|
||||||
type == LayoutFrameType::Text ||
|
type == LayoutFrameType::Text ||
|
||||||
ComputedISize() != NS_UNCONSTRAINEDSIZE,
|
ComputedISize() != NS_UNCONSTRAINEDSIZE,
|
||||||
"have unconstrained inline-size; this should only "
|
"have unconstrained inline-size; this should only "
|
||||||
"result from very large sizes, not attempts at "
|
"result from very large sizes, not attempts at "
|
||||||
"intrinsic inline-size calculation");
|
"intrinsic inline-size calculation");
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool MightBeContainingBlockFor(nsIFrame* aMaybeContainingBlock,
|
static bool MightBeContainingBlockFor(nsIFrame* aMaybeContainingBlock,
|
||||||
|
|
@ -796,7 +794,7 @@ void ReflowInput::InitDynamicReflowRoot() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ReflowInput::ShouldApplyAutomaticMinimumOnBlockAxis() const {
|
bool ReflowInput::ShouldApplyAutomaticMinimumOnBlockAxis() const {
|
||||||
MOZ_ASSERT(!mFrame->IsFrameOfType(nsIFrame::eReplacedSizing));
|
MOZ_ASSERT(!mFrame->HasReplacedSizing());
|
||||||
return mFlags.mIsBSizeSetByAspectRatio &&
|
return mFlags.mIsBSizeSetByAspectRatio &&
|
||||||
!mStyleDisplay->IsScrollableOverflow() &&
|
!mStyleDisplay->IsScrollableOverflow() &&
|
||||||
mStylePosition->MinBSize(GetWritingMode()).IsAuto();
|
mStylePosition->MinBSize(GetWritingMode()).IsAuto();
|
||||||
|
|
@ -1542,7 +1540,7 @@ bool ReflowInput::IsInlineSizeComputableByBlockSizeAndAspectRatio(
|
||||||
|
|
||||||
// We don't have to compute the inline size by aspect-ratio and the resolved
|
// We don't have to compute the inline size by aspect-ratio and the resolved
|
||||||
// block size (from insets) for replaced elements.
|
// block size (from insets) for replaced elements.
|
||||||
if (mFrame->IsFrameOfType(nsIFrame::eReplaced)) {
|
if (mFrame->IsReplaced()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -448,8 +448,7 @@ struct ReflowInput : public SizeComputationInput {
|
||||||
struct Flags {
|
struct Flags {
|
||||||
Flags() { memset(this, 0, sizeof(*this)); }
|
Flags() { memset(this, 0, sizeof(*this)); }
|
||||||
|
|
||||||
// cached mFrame->IsFrameOfType(nsIFrame::eReplaced) ||
|
// cached mFrame->IsReplaced() || mFrame->IsReplacedWithBlock()
|
||||||
// mFrame->IsFrameOfType(nsIFrame::eReplacedContainsBlock)
|
|
||||||
bool mIsReplaced : 1;
|
bool mIsReplaced : 1;
|
||||||
|
|
||||||
// used by tables to communicate special reflow (in process) to handle
|
// used by tables to communicate special reflow (in process) to handle
|
||||||
|
|
|
||||||
|
|
@ -606,8 +606,7 @@ ScrollAnchorContainer::ExamineAnchorCandidate(nsIFrame* aFrame) const {
|
||||||
return ExamineResult::Exclude;
|
return ExamineResult::Exclude;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool isReplaced = aFrame->IsFrameOfType(nsIFrame::eReplaced);
|
const bool isReplaced = aFrame->IsReplaced();
|
||||||
|
|
||||||
const bool isNonReplacedInline =
|
const bool isNonReplacedInline =
|
||||||
aFrame->StyleDisplay()->IsInlineInsideStyle() && !isReplaced;
|
aFrame->StyleDisplay()->IsInlineInsideStyle() && !isReplaced;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ static bool IsAtomicElement(nsIFrame* aFrame, LayoutFrameType aFrameType) {
|
||||||
"unexpected block frame");
|
"unexpected block frame");
|
||||||
MOZ_ASSERT(aFrameType != LayoutFrameType::Placeholder,
|
MOZ_ASSERT(aFrameType != LayoutFrameType::Placeholder,
|
||||||
"unexpected placeholder frame");
|
"unexpected placeholder frame");
|
||||||
return !aFrame->IsFrameOfType(nsIFrame::eLineParticipant);
|
return !aFrame->IsLineParticipant();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsFullyClipped(nsTextFrame* aFrame, nscoord aLeft, nscoord aRight,
|
static bool IsFullyClipped(nsTextFrame* aFrame, nscoord aLeft, nscoord aRight,
|
||||||
|
|
|
||||||
|
|
@ -222,8 +222,7 @@ void nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
|
||||||
"ShouldAvoidBreakInside should prevent this from happening");
|
"ShouldAvoidBreakInside should prevent this from happening");
|
||||||
nsIFrame* nextFrame = kidFrame->GetNextInFlow();
|
nsIFrame* nextFrame = kidFrame->GetNextInFlow();
|
||||||
if (!kidStatus.IsFullyComplete() &&
|
if (!kidStatus.IsFullyComplete() &&
|
||||||
aDelegatingFrame->IsFrameOfType(
|
aDelegatingFrame->CanContainOverflowContainers()) {
|
||||||
nsIFrame::eCanContainOverflowContainers)) {
|
|
||||||
// Need a continuation
|
// Need a continuation
|
||||||
if (!nextFrame) {
|
if (!nextFrame) {
|
||||||
nextFrame = aPresContext->PresShell()
|
nextFrame = aPresContext->PresShell()
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ static bool FrameHasVisibleInlineContent(nsIFrame* aFrame) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aFrame->IsFrameOfType(nsIFrame::eLineParticipant)) {
|
if (aFrame->IsLineParticipant()) {
|
||||||
for (nsIFrame* kid : aFrame->PrincipalChildList()) {
|
for (nsIFrame* kid : aFrame->PrincipalChildList()) {
|
||||||
if (kid->StyleVisibility()->IsVisible() ||
|
if (kid->StyleVisibility()->IsVisible() ||
|
||||||
FrameHasVisibleInlineContent(kid)) {
|
FrameHasVisibleInlineContent(kid)) {
|
||||||
|
|
@ -188,7 +188,7 @@ static nsRect GetFrameTextArea(nsIFrame* aFrame,
|
||||||
if (!textFrame->IsEntirelyWhitespace()) {
|
if (!textFrame->IsEntirelyWhitespace()) {
|
||||||
textArea = aFrame->InkOverflowRect();
|
textArea = aFrame->InkOverflowRect();
|
||||||
}
|
}
|
||||||
} else if (aFrame->IsFrameOfType(nsIFrame::eLineParticipant)) {
|
} else if (aFrame->IsLineParticipant()) {
|
||||||
for (nsIFrame* kid : aFrame->PrincipalChildList()) {
|
for (nsIFrame* kid : aFrame->PrincipalChildList()) {
|
||||||
nsRect kidTextArea = GetFrameTextArea(kid, aBuilder);
|
nsRect kidTextArea = GetFrameTextArea(kid, aBuilder);
|
||||||
textArea.OrWith(kidTextArea);
|
textArea.OrWith(kidTextArea);
|
||||||
|
|
@ -7791,7 +7791,7 @@ void nsBlockFrame::SetInitialChildList(ChildListID aListID,
|
||||||
(pseudo == PseudoStyleType::scrolledContent &&
|
(pseudo == PseudoStyleType::scrolledContent &&
|
||||||
!GetParent()->IsListControlFrame()) ||
|
!GetParent()->IsListControlFrame()) ||
|
||||||
pseudo == PseudoStyleType::mozSVGText) &&
|
pseudo == PseudoStyleType::mozSVGText) &&
|
||||||
!IsComboboxControlFrame() && !IsFrameOfType(eMathML) &&
|
!IsComboboxControlFrame() && !IsMathMLFrame() &&
|
||||||
!IsColumnSetWrapperFrame() &&
|
!IsColumnSetWrapperFrame() &&
|
||||||
RefPtr<ComputedStyle>(GetFirstLetterStyle(PresContext())) != nullptr;
|
RefPtr<ComputedStyle>(GetFirstLetterStyle(PresContext())) != nullptr;
|
||||||
NS_ASSERTION(haveFirstLetterStyle ==
|
NS_ASSERTION(haveFirstLetterStyle ==
|
||||||
|
|
@ -8053,8 +8053,7 @@ bool nsBlockFrame::BlockNeedsFloatManager(nsIFrame* aBlock) {
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
bool nsBlockFrame::BlockCanIntersectFloats(nsIFrame* aFrame) {
|
bool nsBlockFrame::BlockCanIntersectFloats(nsIFrame* aFrame) {
|
||||||
return aFrame->IsBlockFrameOrSubclass() &&
|
return aFrame->IsBlockFrameOrSubclass() && !aFrame->IsReplaced() &&
|
||||||
!aFrame->IsFrameOfType(nsIFrame::eReplaced) &&
|
|
||||||
!aFrame->HasAnyStateBits(NS_BLOCK_FLOAT_MGR);
|
!aFrame->HasAnyStateBits(NS_BLOCK_FLOAT_MGR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -141,10 +141,6 @@ class nsBlockFrame : public nsContainerFrame {
|
||||||
bool IsFloatContainingBlock() const override;
|
bool IsFloatContainingBlock() const override;
|
||||||
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists) override;
|
const nsDisplayListSet& aLists) override;
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsContainerFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eCanContainOverflowContainers));
|
|
||||||
}
|
|
||||||
|
|
||||||
void InvalidateFrame(uint32_t aDisplayItemKey = 0,
|
void InvalidateFrame(uint32_t aDisplayItemKey = 0,
|
||||||
bool aRebuildDisplayItems = true) override;
|
bool aRebuildDisplayItems = true) override;
|
||||||
|
|
|
||||||
|
|
@ -63,10 +63,6 @@ class nsCanvasFrame final : public nsContainerFrame,
|
||||||
void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
|
void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowInput,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsContainerFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eCanContainOverflowContainers));
|
|
||||||
}
|
|
||||||
|
|
||||||
// nsIAnonymousContentCreator
|
// nsIAnonymousContentCreator
|
||||||
nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
|
nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
|
||||||
|
|
|
||||||
|
|
@ -276,9 +276,8 @@ void nsContainerFrame::Destroy(DestroyContext& aContext) {
|
||||||
SafelyDestroyFrameListProp(aContext, presShell, OverflowProperty());
|
SafelyDestroyFrameListProp(aContext, presShell, OverflowProperty());
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(
|
MOZ_ASSERT(CanContainOverflowContainers() || !(hasOC || hasEOC),
|
||||||
IsFrameOfType(eCanContainOverflowContainers) || !(hasOC || hasEOC),
|
"this type of frame shouldn't have overflow containers");
|
||||||
"this type of frame shouldn't have overflow containers");
|
|
||||||
if (hasOC) {
|
if (hasOC) {
|
||||||
SafelyDestroyFrameListProp(aContext, presShell,
|
SafelyDestroyFrameListProp(aContext, presShell,
|
||||||
OverflowContainersProperty());
|
OverflowContainersProperty());
|
||||||
|
|
@ -339,13 +338,13 @@ void nsContainerFrame::GetChildLists(nsTArray<ChildList>* aLists) const {
|
||||||
reinterpret_cast<L>(aValue)->AppendIfNonempty(aLists,
|
reinterpret_cast<L>(aValue)->AppendIfNonempty(aLists,
|
||||||
FrameChildListID::Overflow);
|
FrameChildListID::Overflow);
|
||||||
} else if (aProp == OverflowContainersProperty()) {
|
} else if (aProp == OverflowContainersProperty()) {
|
||||||
MOZ_ASSERT(IsFrameOfType(nsIFrame::eCanContainOverflowContainers),
|
MOZ_ASSERT(CanContainOverflowContainers(),
|
||||||
"found unexpected OverflowContainersProperty");
|
"found unexpected OverflowContainersProperty");
|
||||||
Unused << this; // silence clang -Wunused-lambda-capture in opt builds
|
Unused << this; // silence clang -Wunused-lambda-capture in opt builds
|
||||||
reinterpret_cast<L>(aValue)->AppendIfNonempty(
|
reinterpret_cast<L>(aValue)->AppendIfNonempty(
|
||||||
aLists, FrameChildListID::OverflowContainers);
|
aLists, FrameChildListID::OverflowContainers);
|
||||||
} else if (aProp == ExcessOverflowContainersProperty()) {
|
} else if (aProp == ExcessOverflowContainersProperty()) {
|
||||||
MOZ_ASSERT(IsFrameOfType(nsIFrame::eCanContainOverflowContainers),
|
MOZ_ASSERT(CanContainOverflowContainers(),
|
||||||
"found unexpected ExcessOverflowContainersProperty");
|
"found unexpected ExcessOverflowContainersProperty");
|
||||||
Unused << this; // silence clang -Wunused-lambda-capture in opt builds
|
Unused << this; // silence clang -Wunused-lambda-capture in opt builds
|
||||||
reinterpret_cast<L>(aValue)->AppendIfNonempty(
|
reinterpret_cast<L>(aValue)->AppendIfNonempty(
|
||||||
|
|
@ -817,8 +816,7 @@ LogicalSize nsContainerFrame::ComputeAutoSize(
|
||||||
nscoord availBased =
|
nscoord availBased =
|
||||||
aAvailableISize - aMargin.ISize(aWM) - aBorderPadding.ISize(aWM);
|
aAvailableISize - aMargin.ISize(aWM) - aBorderPadding.ISize(aWM);
|
||||||
// replaced elements always shrink-wrap
|
// replaced elements always shrink-wrap
|
||||||
if (aFlags.contains(ComputeSizeFlag::ShrinkWrap) ||
|
if (aFlags.contains(ComputeSizeFlag::ShrinkWrap) || IsReplaced()) {
|
||||||
IsFrameOfType(eReplaced)) {
|
|
||||||
// Only bother computing our 'auto' ISize if the result will be used.
|
// Only bother computing our 'auto' ISize if the result will be used.
|
||||||
const auto& styleISize = aSizeOverrides.mStyleISize
|
const auto& styleISize = aSizeOverrides.mStyleISize
|
||||||
? *aSizeOverrides.mStyleISize
|
? *aSizeOverrides.mStyleISize
|
||||||
|
|
@ -988,7 +986,7 @@ void nsContainerFrame::FinishReflowChild(
|
||||||
const WritingMode& aWM, const LogicalPoint& aPos,
|
const WritingMode& aWM, const LogicalPoint& aPos,
|
||||||
const nsSize& aContainerSize, nsIFrame::ReflowChildFlags aFlags) {
|
const nsSize& aContainerSize, nsIFrame::ReflowChildFlags aFlags) {
|
||||||
MOZ_ASSERT(!aReflowInput || aReflowInput->mFrame == aKidFrame);
|
MOZ_ASSERT(!aReflowInput || aReflowInput->mFrame == aKidFrame);
|
||||||
MOZ_ASSERT(aReflowInput || aKidFrame->IsFrameOfType(eMathML) ||
|
MOZ_ASSERT(aReflowInput || aKidFrame->IsMathMLFrame() ||
|
||||||
aKidFrame->IsTableCellFrame(),
|
aKidFrame->IsTableCellFrame(),
|
||||||
"aReflowInput should be passed in almost all cases");
|
"aReflowInput should be passed in almost all cases");
|
||||||
|
|
||||||
|
|
@ -2624,8 +2622,7 @@ bool nsContainerFrame::ShouldAvoidBreakInside(
|
||||||
|
|
||||||
void nsContainerFrame::ConsiderChildOverflow(OverflowAreas& aOverflowAreas,
|
void nsContainerFrame::ConsiderChildOverflow(OverflowAreas& aOverflowAreas,
|
||||||
nsIFrame* aChildFrame) {
|
nsIFrame* aChildFrame) {
|
||||||
if (StyleDisplay()->IsContainLayout() &&
|
if (StyleDisplay()->IsContainLayout() && SupportsContainLayoutAndPaint()) {
|
||||||
IsFrameOfType(eSupportsContainLayoutAndPaint)) {
|
|
||||||
// If we have layout containment and are not a non-atomic, inline-level
|
// If we have layout containment and are not a non-atomic, inline-level
|
||||||
// principal box, we should only consider our child's ink overflow,
|
// principal box, we should only consider our child's ink overflow,
|
||||||
// leaving the scrollable regions of the parent unaffected.
|
// leaving the scrollable regions of the parent unaffected.
|
||||||
|
|
|
||||||
|
|
@ -628,7 +628,7 @@ class nsContainerFrame : public nsSplittableFrame {
|
||||||
MOZ_ASSERT(aOverflowContainers.NotEmpty(), "Shouldn't set an empty list!");
|
MOZ_ASSERT(aOverflowContainers.NotEmpty(), "Shouldn't set an empty list!");
|
||||||
MOZ_ASSERT(!GetProperty(OverflowContainersProperty()),
|
MOZ_ASSERT(!GetProperty(OverflowContainersProperty()),
|
||||||
"Shouldn't override existing list!");
|
"Shouldn't override existing list!");
|
||||||
MOZ_ASSERT(IsFrameOfType(nsIFrame::eCanContainOverflowContainers),
|
MOZ_ASSERT(CanContainOverflowContainers(),
|
||||||
"This type of frame can't have overflow containers!");
|
"This type of frame can't have overflow containers!");
|
||||||
auto* list = new (PresShell()) nsFrameList(std::move(aOverflowContainers));
|
auto* list = new (PresShell()) nsFrameList(std::move(aOverflowContainers));
|
||||||
SetProperty(OverflowContainersProperty(), list);
|
SetProperty(OverflowContainersProperty(), list);
|
||||||
|
|
@ -640,7 +640,7 @@ class nsContainerFrame : public nsSplittableFrame {
|
||||||
"Shouldn't set an empty list!");
|
"Shouldn't set an empty list!");
|
||||||
MOZ_ASSERT(!GetProperty(ExcessOverflowContainersProperty()),
|
MOZ_ASSERT(!GetProperty(ExcessOverflowContainersProperty()),
|
||||||
"Shouldn't override existing list!");
|
"Shouldn't override existing list!");
|
||||||
MOZ_ASSERT(IsFrameOfType(nsIFrame::eCanContainOverflowContainers),
|
MOZ_ASSERT(CanContainOverflowContainers(),
|
||||||
"This type of frame can't have overflow containers!");
|
"This type of frame can't have overflow containers!");
|
||||||
auto* list =
|
auto* list =
|
||||||
new (PresShell()) nsFrameList(std::move(aExcessOverflowContainers));
|
new (PresShell()) nsFrameList(std::move(aExcessOverflowContainers));
|
||||||
|
|
|
||||||
|
|
@ -33,12 +33,23 @@ nsFirstLetterFrame* NS_NewFirstLetterFrame(PresShell* aPresShell,
|
||||||
nsFirstLetterFrame(aStyle, aPresShell->GetPresContext());
|
nsFirstLetterFrame(aStyle, aPresShell->GetPresContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsFirstLetterFrame* NS_NewFloatingFirstLetterFrame(PresShell* aPresShell,
|
||||||
|
ComputedStyle* aStyle) {
|
||||||
|
return new (aPresShell)
|
||||||
|
nsFloatingFirstLetterFrame(aStyle, aPresShell->GetPresContext());
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMPL_FRAMEARENA_HELPERS(nsFirstLetterFrame)
|
NS_IMPL_FRAMEARENA_HELPERS(nsFirstLetterFrame)
|
||||||
|
|
||||||
NS_QUERYFRAME_HEAD(nsFirstLetterFrame)
|
NS_QUERYFRAME_HEAD(nsFirstLetterFrame)
|
||||||
NS_QUERYFRAME_ENTRY(nsFirstLetterFrame)
|
NS_QUERYFRAME_ENTRY(nsFirstLetterFrame)
|
||||||
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
|
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
|
||||||
|
|
||||||
|
NS_IMPL_FRAMEARENA_HELPERS(nsFloatingFirstLetterFrame)
|
||||||
|
NS_QUERYFRAME_HEAD(nsFloatingFirstLetterFrame)
|
||||||
|
NS_QUERYFRAME_ENTRY(nsFloatingFirstLetterFrame)
|
||||||
|
NS_QUERYFRAME_TAIL_INHERITING(nsFirstLetterFrame)
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
nsresult nsFirstLetterFrame::GetFrameName(nsAString& aResult) const {
|
nsresult nsFirstLetterFrame::GetFrameName(nsAString& aResult) const {
|
||||||
return MakeFrameName(u"Letter"_ns, aResult);
|
return MakeFrameName(u"Letter"_ns, aResult);
|
||||||
|
|
|
||||||
|
|
@ -9,43 +9,38 @@
|
||||||
|
|
||||||
/* rendering object for CSS :first-letter pseudo-element */
|
/* rendering object for CSS :first-letter pseudo-element */
|
||||||
|
|
||||||
#include "mozilla/Attributes.h"
|
|
||||||
#include "nsContainerFrame.h"
|
#include "nsContainerFrame.h"
|
||||||
|
|
||||||
class nsFirstLetterFrame final : public nsContainerFrame {
|
class nsFirstLetterFrame : public nsContainerFrame {
|
||||||
public:
|
public:
|
||||||
NS_DECL_QUERYFRAME
|
NS_DECL_QUERYFRAME
|
||||||
NS_DECL_FRAMEARENA_HELPERS(nsFirstLetterFrame)
|
NS_DECL_FRAMEARENA_HELPERS(nsFirstLetterFrame)
|
||||||
|
|
||||||
explicit nsFirstLetterFrame(ComputedStyle* aStyle,
|
nsFirstLetterFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
|
||||||
nsPresContext* aPresContext)
|
ClassID aClassID)
|
||||||
|
: nsContainerFrame(aStyle, aPresContext, aClassID) {}
|
||||||
|
|
||||||
|
nsFirstLetterFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
|
||||||
: nsContainerFrame(aStyle, aPresContext, kClassID) {}
|
: nsContainerFrame(aStyle, aPresContext, kClassID) {}
|
||||||
|
|
||||||
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists) override;
|
const nsDisplayListSet& aLists) final;
|
||||||
|
|
||||||
virtual void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) final;
|
||||||
void SetInitialChildList(ChildListID aListID,
|
void SetInitialChildList(ChildListID aListID, nsFrameList&& aChildList) final;
|
||||||
nsFrameList&& aChildList) override;
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
virtual nsresult GetFrameName(nsAString& aResult) const override;
|
nsresult GetFrameName(nsAString& aResult) const final;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool IsFloating() const { return HasAnyStateBits(NS_FRAME_OUT_OF_FLOW); }
|
bool IsFloating() const { return HasAnyStateBits(NS_FRAME_OUT_OF_FLOW); }
|
||||||
|
|
||||||
virtual bool IsFrameOfType(uint32_t aFlags) const override {
|
nscoord GetMinISize(gfxContext* aRenderingContext) final;
|
||||||
if (!IsFloating()) aFlags = aFlags & ~(nsIFrame::eLineParticipant);
|
nscoord GetPrefISize(gfxContext* aRenderingContext) final;
|
||||||
return nsContainerFrame::IsFrameOfType(aFlags &
|
void AddInlineMinISize(gfxContext* aRenderingContext,
|
||||||
~(nsIFrame::eBidiInlineContainer));
|
InlineMinISizeData* aData) final;
|
||||||
}
|
void AddInlinePrefISize(gfxContext* aRenderingContext,
|
||||||
|
InlinePrefISizeData* aData) final;
|
||||||
virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
|
||||||
virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
|
||||||
virtual void AddInlineMinISize(gfxContext* aRenderingContext,
|
|
||||||
InlineMinISizeData* aData) override;
|
|
||||||
virtual void AddInlinePrefISize(gfxContext* aRenderingContext,
|
|
||||||
InlinePrefISizeData* aData) override;
|
|
||||||
|
|
||||||
SizeComputationResult ComputeSize(
|
SizeComputationResult ComputeSize(
|
||||||
gfxContext* aRenderingContext, mozilla::WritingMode aWM,
|
gfxContext* aRenderingContext, mozilla::WritingMode aWM,
|
||||||
|
|
@ -53,22 +48,21 @@ class nsFirstLetterFrame final : public nsContainerFrame {
|
||||||
const mozilla::LogicalSize& aMargin,
|
const mozilla::LogicalSize& aMargin,
|
||||||
const mozilla::LogicalSize& aBorderPadding,
|
const mozilla::LogicalSize& aBorderPadding,
|
||||||
const mozilla::StyleSizeOverrides& aSizeOverrides,
|
const mozilla::StyleSizeOverrides& aSizeOverrides,
|
||||||
mozilla::ComputeSizeFlags aFlags) override;
|
mozilla::ComputeSizeFlags aFlags) final;
|
||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
|
void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowInput,
|
const ReflowInput& aReflowInput, nsReflowStatus& aStatus) final;
|
||||||
nsReflowStatus& aStatus) override;
|
|
||||||
|
|
||||||
virtual bool CanContinueTextRun() const override;
|
bool CanContinueTextRun() const final;
|
||||||
Maybe<nscoord> GetNaturalBaselineBOffset(
|
Maybe<nscoord> GetNaturalBaselineBOffset(mozilla::WritingMode aWM,
|
||||||
mozilla::WritingMode aWM, BaselineSharingGroup aBaselineGroup,
|
BaselineSharingGroup aBaselineGroup,
|
||||||
BaselineExportContext) const override;
|
BaselineExportContext) const final;
|
||||||
virtual LogicalSides GetLogicalSkipSides() const override;
|
LogicalSides GetLogicalSkipSides() const final;
|
||||||
|
|
||||||
// override of nsFrame method
|
// final of nsFrame method
|
||||||
virtual nsresult GetChildFrameContainingOffset(
|
nsresult GetChildFrameContainingOffset(int32_t inContentOffset, bool inHint,
|
||||||
int32_t inContentOffset, bool inHint, int32_t* outFrameContentOffset,
|
int32_t* outFrameContentOffset,
|
||||||
nsIFrame** outChildFrame) override;
|
nsIFrame** outChildFrame) final;
|
||||||
|
|
||||||
nscoord GetFirstLetterBaseline() const { return mBaseline; }
|
nscoord GetFirstLetterBaseline() const { return mBaseline; }
|
||||||
|
|
||||||
|
|
@ -90,4 +84,13 @@ class nsFirstLetterFrame final : public nsContainerFrame {
|
||||||
void DrainOverflowFrames(nsPresContext* aPresContext);
|
void DrainOverflowFrames(nsPresContext* aPresContext);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class nsFloatingFirstLetterFrame : public nsFirstLetterFrame {
|
||||||
|
public:
|
||||||
|
NS_DECL_QUERYFRAME
|
||||||
|
NS_DECL_FRAMEARENA_HELPERS(nsFloatingFirstLetterFrame)
|
||||||
|
|
||||||
|
nsFloatingFirstLetterFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
|
||||||
|
: nsFirstLetterFrame(aStyle, aPresContext, kClassID) {}
|
||||||
|
};
|
||||||
|
|
||||||
#endif /* nsFirstLetterFrame_h__ */
|
#endif /* nsFirstLetterFrame_h__ */
|
||||||
|
|
|
||||||
|
|
@ -1306,9 +1306,8 @@ StyleAlignFlags nsFlexContainerFrame::CSSAlignmentForAbsPosChild(
|
||||||
// absolutely-positioned boxes, and behaves as 'stretch' on all other
|
// absolutely-positioned boxes, and behaves as 'stretch' on all other
|
||||||
// absolutely-positioned boxes."
|
// absolutely-positioned boxes."
|
||||||
// https://drafts.csswg.org/css-align/#align-abspos
|
// https://drafts.csswg.org/css-align/#align-abspos
|
||||||
alignment = aChildRI.mFrame->IsFrameOfType(nsIFrame::eReplaced)
|
alignment = aChildRI.mFrame->IsReplaced() ? StyleAlignFlags::START
|
||||||
? StyleAlignFlags::START
|
: StyleAlignFlags::STRETCH;
|
||||||
: StyleAlignFlags::STRETCH;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1573,7 +1572,7 @@ static nscoord PartiallyResolveAutoMinSize(
|
||||||
// through the aspect ratio (if the item is replaced, and it has an aspect
|
// through the aspect ratio (if the item is replaced, and it has an aspect
|
||||||
// ratio and a definite cross size).
|
// ratio and a definite cross size).
|
||||||
if (const auto& aspectRatio = aFlexItem.GetAspectRatio();
|
if (const auto& aspectRatio = aFlexItem.GetAspectRatio();
|
||||||
aFlexItem.Frame()->IsFrameOfType(nsIFrame::eReplaced) && aspectRatio &&
|
aFlexItem.Frame()->IsReplaced() && aspectRatio &&
|
||||||
aFlexItem.IsCrossSizeDefinite(aItemReflowInput)) {
|
aFlexItem.IsCrossSizeDefinite(aItemReflowInput)) {
|
||||||
// We have a usable aspect ratio. (not going to divide by 0)
|
// We have a usable aspect ratio. (not going to divide by 0)
|
||||||
nscoord transferredSizeSuggestion = aspectRatio.ComputeRatioDependentSize(
|
nscoord transferredSizeSuggestion = aspectRatio.ComputeRatioDependentSize(
|
||||||
|
|
|
||||||
|
|
@ -144,11 +144,6 @@ class nsFlexContainerFrame final : public nsContainerFrame,
|
||||||
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsContainerFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eCanContainOverflowContainers));
|
|
||||||
}
|
|
||||||
|
|
||||||
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists) override;
|
const nsDisplayListSet& aLists) override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9575,9 +9575,8 @@ StyleAlignFlags nsGridContainerFrame::CSSAlignmentForAbsPosChild(
|
||||||
// absolutely-positioned boxes."
|
// absolutely-positioned boxes."
|
||||||
// https://drafts.csswg.org/css-align/#align-abspos
|
// https://drafts.csswg.org/css-align/#align-abspos
|
||||||
// https://drafts.csswg.org/css-align/#justify-abspos
|
// https://drafts.csswg.org/css-align/#justify-abspos
|
||||||
alignment = aChildRI.mFrame->IsFrameOfType(nsIFrame::eReplaced)
|
alignment = aChildRI.mFrame->IsReplaced() ? StyleAlignFlags::START
|
||||||
? StyleAlignFlags::START
|
: StyleAlignFlags::STRETCH;
|
||||||
: StyleAlignFlags::STRETCH;
|
|
||||||
} else if (alignment == StyleAlignFlags::FLEX_START) {
|
} else if (alignment == StyleAlignFlags::FLEX_START) {
|
||||||
alignment = StyleAlignFlags::START;
|
alignment = StyleAlignFlags::START;
|
||||||
} else if (alignment == StyleAlignFlags::FLEX_END) {
|
} else if (alignment == StyleAlignFlags::FLEX_END) {
|
||||||
|
|
|
||||||
|
|
@ -123,10 +123,6 @@ class nsGridContainerFrame final : public nsContainerFrame,
|
||||||
nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
||||||
nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
||||||
void MarkIntrinsicISizesDirty() override;
|
void MarkIntrinsicISizesDirty() override;
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsContainerFrame::IsFrameOfType(
|
|
||||||
aFlags & ~nsIFrame::eCanContainOverflowContainers);
|
|
||||||
}
|
|
||||||
|
|
||||||
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists) override;
|
const nsDisplayListSet& aLists) override;
|
||||||
|
|
|
||||||
|
|
@ -74,11 +74,6 @@ class nsHTMLCanvasFrame final : public nsContainerFrame {
|
||||||
virtual mozilla::a11y::AccType AccessibleType() override;
|
virtual mozilla::a11y::AccType AccessibleType() override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
virtual bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsSplittableFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedSizing));
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
virtual nsresult GetFrameName(nsAString& aResult) const override;
|
virtual nsresult GetFrameName(nsAString& aResult) const override;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -118,8 +118,11 @@ nsPageContentFrame* NS_NewPageContentFrame(
|
||||||
nsIFrame* NS_NewPageBreakFrame(mozilla::PresShell* aPresShell,
|
nsIFrame* NS_NewPageBreakFrame(mozilla::PresShell* aPresShell,
|
||||||
mozilla::ComputedStyle* aStyle);
|
mozilla::ComputedStyle* aStyle);
|
||||||
class nsFirstLetterFrame;
|
class nsFirstLetterFrame;
|
||||||
nsFirstLetterFrame* NS_NewFirstLetterFrame(mozilla::PresShell* aPresShell,
|
nsFirstLetterFrame* NS_NewFirstLetterFrame(mozilla::PresShell*,
|
||||||
mozilla::ComputedStyle* aStyle);
|
mozilla::ComputedStyle*);
|
||||||
|
class nsFirstLetterFrame;
|
||||||
|
nsFirstLetterFrame* NS_NewFloatingFirstLetterFrame(mozilla::PresShell*,
|
||||||
|
mozilla::ComputedStyle*);
|
||||||
class nsFirstLineFrame;
|
class nsFirstLineFrame;
|
||||||
nsFirstLineFrame* NS_NewFirstLineFrame(mozilla::PresShell* aPresShell,
|
nsFirstLineFrame* NS_NewFirstLineFrame(mozilla::PresShell* aPresShell,
|
||||||
mozilla::ComputedStyle* aStyle);
|
mozilla::ComputedStyle* aStyle);
|
||||||
|
|
|
||||||
|
|
@ -170,13 +170,7 @@ nsIFrame* nsILineIterator::LineInfo::GetLastFrameOnLine() const {
|
||||||
return maybeLastFrame;
|
return maybeLastFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
const mozilla::LayoutFrameType nsIFrame::sLayoutFrameTypes[
|
const mozilla::LayoutFrameType nsIFrame::sLayoutFrameTypes[kFrameClassCount] = {
|
||||||
#define FRAME_ID(...) 1 +
|
|
||||||
#define ABSTRACT_FRAME_ID(...)
|
|
||||||
#include "mozilla/FrameIdList.h"
|
|
||||||
#undef FRAME_ID
|
|
||||||
#undef ABSTRACT_FRAME_ID
|
|
||||||
0] = {
|
|
||||||
#define FRAME_ID(class_, type_, ...) mozilla::LayoutFrameType::type_,
|
#define FRAME_ID(class_, type_, ...) mozilla::LayoutFrameType::type_,
|
||||||
#define ABSTRACT_FRAME_ID(...)
|
#define ABSTRACT_FRAME_ID(...)
|
||||||
#include "mozilla/FrameIdList.h"
|
#include "mozilla/FrameIdList.h"
|
||||||
|
|
@ -184,23 +178,12 @@ const mozilla::LayoutFrameType nsIFrame::sLayoutFrameTypes[
|
||||||
#undef ABSTRACT_FRAME_ID
|
#undef ABSTRACT_FRAME_ID
|
||||||
};
|
};
|
||||||
|
|
||||||
const nsIFrame::FrameClassBits nsIFrame::sFrameClassBits[
|
const nsIFrame::ClassFlags nsIFrame::sLayoutFrameClassFlags[kFrameClassCount] =
|
||||||
#define FRAME_ID(...) 1 +
|
{
|
||||||
|
#define FRAME_ID(class_, type_, flags_, ...) flags_,
|
||||||
#define ABSTRACT_FRAME_ID(...)
|
#define ABSTRACT_FRAME_ID(...)
|
||||||
#include "mozilla/FrameIdList.h"
|
#include "mozilla/FrameIdList.h"
|
||||||
#undef FRAME_ID
|
#undef FRAME_ID
|
||||||
#undef ABSTRACT_FRAME_ID
|
|
||||||
0] = {
|
|
||||||
#define Leaf eFrameClassBitsLeaf
|
|
||||||
#define NotLeaf eFrameClassBitsNone
|
|
||||||
#define DynamicLeaf eFrameClassBitsDynamicLeaf
|
|
||||||
#define FRAME_ID(class_, type_, leaf_, ...) leaf_,
|
|
||||||
#define ABSTRACT_FRAME_ID(...)
|
|
||||||
#include "mozilla/FrameIdList.h"
|
|
||||||
#undef Leaf
|
|
||||||
#undef NotLeaf
|
|
||||||
#undef DynamicLeaf
|
|
||||||
#undef FRAME_ID
|
|
||||||
#undef ABSTRACT_FRAME_ID
|
#undef ABSTRACT_FRAME_ID
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -496,10 +479,9 @@ static bool IsFontSizeInflationContainer(nsIFrame* aFrame,
|
||||||
* container.
|
* container.
|
||||||
*
|
*
|
||||||
* From a code perspective, the only hard requirement is that frames
|
* From a code perspective, the only hard requirement is that frames
|
||||||
* that are line participants
|
* that are line participants (nsIFrame::IsLineParticipant) are never
|
||||||
* (nsIFrame::IsFrameOfType(nsIFrame::eLineParticipant)) are never
|
* containers, since line layout assumes that the inflation is consistent
|
||||||
* containers, since line layout assumes that the inflation is
|
* within a line.
|
||||||
* consistent within a line.
|
|
||||||
*
|
*
|
||||||
* This is not an imposition, since we obviously want a bunch of text
|
* This is not an imposition, since we obviously want a bunch of text
|
||||||
* (possibly with inline elements) flowing within a block to count the
|
* (possibly with inline elements) flowing within a block to count the
|
||||||
|
|
@ -548,12 +530,11 @@ static bool IsFontSizeInflationContainer(nsIFrame* aFrame,
|
||||||
(content->IsAnyOfHTMLElements(nsGkAtoms::option, nsGkAtoms::optgroup,
|
(content->IsAnyOfHTMLElements(nsGkAtoms::option, nsGkAtoms::optgroup,
|
||||||
nsGkAtoms::select, nsGkAtoms::input,
|
nsGkAtoms::select, nsGkAtoms::input,
|
||||||
nsGkAtoms::button, nsGkAtoms::textarea)));
|
nsGkAtoms::button, nsGkAtoms::textarea)));
|
||||||
NS_ASSERTION(!aFrame->IsFrameOfType(nsIFrame::eLineParticipant) || isInline ||
|
NS_ASSERTION(!aFrame->IsLineParticipant() || isInline ||
|
||||||
// br frames and mathml frames report being line
|
// br frames and mathml frames report being line
|
||||||
// participants even when their position or display is
|
// participants even when their position or display is
|
||||||
// set
|
// set
|
||||||
aFrame->IsBrFrame() ||
|
aFrame->IsBrFrame() || aFrame->IsMathMLFrame(),
|
||||||
aFrame->IsFrameOfType(nsIFrame::eMathML),
|
|
||||||
"line participants must not be containers");
|
"line participants must not be containers");
|
||||||
return !isInline;
|
return !isInline;
|
||||||
}
|
}
|
||||||
|
|
@ -611,8 +592,6 @@ void nsIFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) {
|
nsIFrame* aPrevInFlow) {
|
||||||
MOZ_ASSERT(nsQueryFrame::FrameIID(mClass) == GetFrameId());
|
MOZ_ASSERT(nsQueryFrame::FrameIID(mClass) == GetFrameId());
|
||||||
MOZ_ASSERT(!mContent, "Double-initing a frame?");
|
MOZ_ASSERT(!mContent, "Double-initing a frame?");
|
||||||
NS_ASSERTION(IsFrameOfType(eDEBUGAllFrames) && !IsFrameOfType(eDEBUGNoFrames),
|
|
||||||
"IsFrameOfType implementation that doesn't call base class");
|
|
||||||
|
|
||||||
mContent = aContent;
|
mContent = aContent;
|
||||||
mParent = aParent;
|
mParent = aParent;
|
||||||
|
|
@ -690,12 +669,12 @@ void nsIFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
// because when initializng the table wrapper frame, we don't yet have
|
// because when initializng the table wrapper frame, we don't yet have
|
||||||
// access to its children so we can't tell if we have transform
|
// access to its children so we can't tell if we have transform
|
||||||
// animations or not.
|
// animations or not.
|
||||||
if (IsFrameOfType(eSupportsCSSTransforms)) {
|
if (SupportsCSSTransforms()) {
|
||||||
mMayHaveTransformAnimation = true;
|
mMayHaveTransformAnimation = true;
|
||||||
AddStateBits(NS_FRAME_MAY_BE_TRANSFORMED);
|
AddStateBits(NS_FRAME_MAY_BE_TRANSFORMED);
|
||||||
} else if (aParent && nsLayoutUtils::GetStyleFrame(aParent) == this) {
|
} else if (aParent && nsLayoutUtils::GetStyleFrame(aParent) == this) {
|
||||||
MOZ_ASSERT(
|
MOZ_ASSERT(
|
||||||
aParent->IsFrameOfType(eSupportsCSSTransforms),
|
aParent->SupportsCSSTransforms(),
|
||||||
"Style frames that don't support transforms should have parents"
|
"Style frames that don't support transforms should have parents"
|
||||||
" that do");
|
" that do");
|
||||||
aParent->mMayHaveTransformAnimation = true;
|
aParent->mMayHaveTransformAnimation = true;
|
||||||
|
|
@ -1420,8 +1399,7 @@ void nsIFrame::HandleLastRememberedSize() {
|
||||||
element->RemoveLastRememberedISize();
|
element->RemoveLastRememberedISize();
|
||||||
}
|
}
|
||||||
if ((canRememberBSize || canRememberISize) && !HidesContent()) {
|
if ((canRememberBSize || canRememberISize) && !HidesContent()) {
|
||||||
bool isNonReplacedInline = IsFrameOfType(nsIFrame::eLineParticipant) &&
|
bool isNonReplacedInline = IsLineParticipant() && !IsReplaced();
|
||||||
!IsFrameOfType(nsIFrame::eReplaced);
|
|
||||||
if (!isNonReplacedInline) {
|
if (!isNonReplacedInline) {
|
||||||
PresContext()->Document()->ObserveForLastRememberedSize(*element);
|
PresContext()->Document()->ObserveForLastRememberedSize(*element);
|
||||||
return;
|
return;
|
||||||
|
|
@ -1709,7 +1687,7 @@ bool nsIFrame::IsCSSTransformed() const {
|
||||||
bool nsIFrame::HasAnimationOfTransform() const {
|
bool nsIFrame::HasAnimationOfTransform() const {
|
||||||
return IsPrimaryFrame() &&
|
return IsPrimaryFrame() &&
|
||||||
nsLayoutUtils::HasAnimationOfTransformAndMotionPath(this) &&
|
nsLayoutUtils::HasAnimationOfTransformAndMotionPath(this) &&
|
||||||
IsFrameOfType(eSupportsCSSTransforms);
|
SupportsCSSTransforms();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool nsIFrame::ChildrenHavePerspective(
|
bool nsIFrame::ChildrenHavePerspective(
|
||||||
|
|
@ -1756,7 +1734,7 @@ bool nsIFrame::Extend3DContext(const nsStyleDisplay* aStyleDisplay,
|
||||||
}
|
}
|
||||||
const nsStyleDisplay* disp = StyleDisplayWithOptionalParam(aStyleDisplay);
|
const nsStyleDisplay* disp = StyleDisplayWithOptionalParam(aStyleDisplay);
|
||||||
if (disp->mTransformStyle != StyleTransformStyle::Preserve3d ||
|
if (disp->mTransformStyle != StyleTransformStyle::Preserve3d ||
|
||||||
!IsFrameOfType(nsIFrame::eSupportsCSSTransforms)) {
|
!SupportsCSSTransforms()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2409,7 +2387,7 @@ static inline bool IsIntrinsicKeyword(const SizeOrMaxSize& aSize) {
|
||||||
|
|
||||||
bool nsIFrame::CanBeDynamicReflowRoot() const {
|
bool nsIFrame::CanBeDynamicReflowRoot() const {
|
||||||
const auto& display = *StyleDisplay();
|
const auto& display = *StyleDisplay();
|
||||||
if (IsFrameOfType(nsIFrame::eLineParticipant) || display.mDisplay.IsRuby() ||
|
if (IsLineParticipant() || display.mDisplay.IsRuby() ||
|
||||||
display.IsInnerTableStyle() ||
|
display.IsInnerTableStyle() ||
|
||||||
display.DisplayInside() == StyleDisplayInside::Table) {
|
display.DisplayInside() == StyleDisplayInside::Table) {
|
||||||
// We have a display type where 'width' and 'height' don't actually set the
|
// We have a display type where 'width' and 'height' don't actually set the
|
||||||
|
|
@ -3930,7 +3908,7 @@ static bool DescendIntoChild(nsDisplayListBuilder* aBuilder,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aChild->IsFrameOfType(nsIFrame::eTablePart)) {
|
if (aChild->IsTablePart()) {
|
||||||
// Relative positioning and transforms can cause table parts to move, but we
|
// Relative positioning and transforms can cause table parts to move, but we
|
||||||
// will still paint the backgrounds for their ancestor parts under them at
|
// will still paint the backgrounds for their ancestor parts under them at
|
||||||
// their 'normal' position. That means that we must consider the overflow
|
// their 'normal' position. That means that we must consider the overflow
|
||||||
|
|
@ -3943,7 +3921,7 @@ static bool DescendIntoChild(nsDisplayListBuilder* aBuilder,
|
||||||
const nsIFrame* f = aChild;
|
const nsIFrame* f = aChild;
|
||||||
nsRect normalPositionOverflowRelativeToTable = overflow;
|
nsRect normalPositionOverflowRelativeToTable = overflow;
|
||||||
|
|
||||||
while (f->IsFrameOfType(nsIFrame::eTablePart)) {
|
while (f->IsTablePart()) {
|
||||||
normalPositionOverflowRelativeToTable += f->GetNormalPosition();
|
normalPositionOverflowRelativeToTable += f->GetNormalPosition();
|
||||||
f = f->GetParent();
|
f = f->GetParent();
|
||||||
}
|
}
|
||||||
|
|
@ -4166,7 +4144,7 @@ void nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
|
||||||
|
|
||||||
if (!pseudoStackingContext && !isSVG &&
|
if (!pseudoStackingContext && !isSVG &&
|
||||||
aFlags.contains(DisplayChildFlag::Inline) &&
|
aFlags.contains(DisplayChildFlag::Inline) &&
|
||||||
!child->IsFrameOfType(eLineParticipant)) {
|
!child->IsLineParticipant()) {
|
||||||
// child is a non-inline frame in an inline context, i.e.,
|
// child is a non-inline frame in an inline context, i.e.,
|
||||||
// it acts like inline-block or inline-table. Therefore it is a
|
// it acts like inline-block or inline-table. Therefore it is a
|
||||||
// pseudo-stacking-context.
|
// pseudo-stacking-context.
|
||||||
|
|
@ -4289,10 +4267,9 @@ void nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
|
||||||
child->MarkAbsoluteFramesForDisplayList(aBuilder);
|
child->MarkAbsoluteFramesForDisplayList(aBuilder);
|
||||||
child->SetBuiltDisplayList(true);
|
child->SetBuiltDisplayList(true);
|
||||||
|
|
||||||
if (!awayFromCommonPath &&
|
// Some SVG frames might change opacity without invalidating the frame, so
|
||||||
// Some SVG frames might change opacity without invalidating the frame,
|
// exclude them from the fast-path.
|
||||||
// so exclude them from the fast-path.
|
if (!awayFromCommonPath && !child->IsSVGFrame()) {
|
||||||
!child->IsFrameOfType(nsIFrame::eSVG)) {
|
|
||||||
// The shortcut is available for the child for next time.
|
// The shortcut is available for the child for next time.
|
||||||
child->AddStateBits(NS_FRAME_SIMPLE_DISPLAYLIST);
|
child->AddStateBits(NS_FRAME_SIMPLE_DISPLAYLIST);
|
||||||
}
|
}
|
||||||
|
|
@ -5853,7 +5830,7 @@ StyleImageRendering nsIFrame::UsedImageRendering() const {
|
||||||
// The touch-action CSS property applies to: all elements except: non-replaced
|
// The touch-action CSS property applies to: all elements except: non-replaced
|
||||||
// inline elements, table rows, row groups, table columns, and column groups.
|
// inline elements, table rows, row groups, table columns, and column groups.
|
||||||
StyleTouchAction nsIFrame::UsedTouchAction() const {
|
StyleTouchAction nsIFrame::UsedTouchAction() const {
|
||||||
if (IsFrameOfType(eLineParticipant)) {
|
if (IsLineParticipant()) {
|
||||||
return StyleTouchAction::AUTO;
|
return StyleTouchAction::AUTO;
|
||||||
}
|
}
|
||||||
auto& disp = *StyleDisplay();
|
auto& disp = *StyleDisplay();
|
||||||
|
|
@ -6189,7 +6166,7 @@ AspectRatio nsIFrame::GetAspectRatio() const {
|
||||||
// https://drafts.csswg.org/css-sizing-4/#aspect-ratio
|
// https://drafts.csswg.org/css-sizing-4/#aspect-ratio
|
||||||
// For those frame types that don't support aspect-ratio, they must not have
|
// For those frame types that don't support aspect-ratio, they must not have
|
||||||
// the natural ratio, so this early return is fine.
|
// the natural ratio, so this early return is fine.
|
||||||
if (!IsFrameOfType(eSupportsAspectRatio)) {
|
if (!SupportsAspectRatio()) {
|
||||||
return AspectRatio();
|
return AspectRatio();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -6496,7 +6473,7 @@ nsIFrame::SizeComputationResult nsIFrame::ComputeSize(
|
||||||
// This means we successfully applied aspect-ratio and now need to check
|
// This means we successfully applied aspect-ratio and now need to check
|
||||||
// if we need to apply the implied minimum size:
|
// if we need to apply the implied minimum size:
|
||||||
// https://drafts.csswg.org/css-sizing-4/#aspect-ratio-minimum
|
// https://drafts.csswg.org/css-sizing-4/#aspect-ratio-minimum
|
||||||
MOZ_ASSERT(!IsFrameOfType(eReplacedSizing),
|
MOZ_ASSERT(!HasReplacedSizing(),
|
||||||
"aspect-ratio minimums should not apply to replaced elements");
|
"aspect-ratio minimums should not apply to replaced elements");
|
||||||
// The inline size computed by aspect-ratio shouldn't less than the content
|
// The inline size computed by aspect-ratio shouldn't less than the content
|
||||||
// size.
|
// size.
|
||||||
|
|
@ -6687,7 +6664,7 @@ Maybe<nscoord> nsIFrame::ComputeInlineSizeFromAspectRatio(
|
||||||
aSizeOverrides.mAspectRatio
|
aSizeOverrides.mAspectRatio
|
||||||
? *aSizeOverrides.mAspectRatio
|
? *aSizeOverrides.mAspectRatio
|
||||||
: StylePosition()->mAspectRatio.ToLayoutRatio();
|
: StylePosition()->mAspectRatio.ToLayoutRatio();
|
||||||
if (!IsFrameOfType(eSupportsAspectRatio) || !aspectRatio) {
|
if (!SupportsAspectRatio() || !aspectRatio) {
|
||||||
return Nothing();
|
return Nothing();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7969,7 +7946,7 @@ void nsIFrame::UnionChildOverflow(OverflowAreas& aOverflowAreas) {
|
||||||
// property or preferred size property should be resolved against zero. This is
|
// property or preferred size property should be resolved against zero. This is
|
||||||
// handled in IsPercentageResolvedAgainstZero().
|
// handled in IsPercentageResolvedAgainstZero().
|
||||||
inline static bool FormControlShrinksForPercentSize(const nsIFrame* aFrame) {
|
inline static bool FormControlShrinksForPercentSize(const nsIFrame* aFrame) {
|
||||||
if (!aFrame->IsFrameOfType(nsIFrame::eReplaced)) {
|
if (!aFrame->IsReplaced()) {
|
||||||
// Quick test to reject most frames.
|
// Quick test to reject most frames.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -8003,7 +7980,7 @@ bool nsIFrame::IsPercentageResolvedAgainstZero(
|
||||||
const StyleSize& aStyleSize, const StyleMaxSize& aStyleMaxSize) const {
|
const StyleSize& aStyleSize, const StyleMaxSize& aStyleMaxSize) const {
|
||||||
const bool sizeHasPercent = aStyleSize.HasPercent();
|
const bool sizeHasPercent = aStyleSize.HasPercent();
|
||||||
return ((sizeHasPercent || aStyleMaxSize.HasPercent()) &&
|
return ((sizeHasPercent || aStyleMaxSize.HasPercent()) &&
|
||||||
IsFrameOfType(nsIFrame::eReplacedSizing)) ||
|
HasReplacedSizing()) ||
|
||||||
(sizeHasPercent && FormControlShrinksForPercentSize(this));
|
(sizeHasPercent && FormControlShrinksForPercentSize(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -8023,8 +8000,7 @@ bool nsIFrame::IsPercentageResolvedAgainstZero(const LengthPercentage& aSize,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool hasPercentOnReplaced =
|
const bool hasPercentOnReplaced = aSize.HasPercent() && HasReplacedSizing();
|
||||||
aSize.HasPercent() && IsFrameOfType(nsIFrame::eReplacedSizing);
|
|
||||||
if (aProperty == SizeProperty::MaxSize) {
|
if (aProperty == SizeProperty::MaxSize) {
|
||||||
return hasPercentOnReplaced;
|
return hasPercentOnReplaced;
|
||||||
}
|
}
|
||||||
|
|
@ -8077,8 +8053,7 @@ bool nsIFrame::IsBlockContainer() const {
|
||||||
//
|
//
|
||||||
// If we ever start skipping table row groups from being containing blocks,
|
// If we ever start skipping table row groups from being containing blocks,
|
||||||
// you need to remove the StickyScrollContainer hack referencing bug 1421660.
|
// you need to remove the StickyScrollContainer hack referencing bug 1421660.
|
||||||
return !IsFrameOfType(nsIFrame::eLineParticipant) && !IsBlockWrapper() &&
|
return !IsLineParticipant() && !IsBlockWrapper() && !IsSubgrid() &&
|
||||||
!IsSubgrid() &&
|
|
||||||
// Table rows are not containing blocks either
|
// Table rows are not containing blocks either
|
||||||
!IsTableRowFrame();
|
!IsTableRowFrame();
|
||||||
}
|
}
|
||||||
|
|
@ -9853,8 +9828,7 @@ static nsRect ComputeOutlineInnerRect(
|
||||||
// aOutValid is set to false if the returned nsRect is not valid
|
// aOutValid is set to false if the returned nsRect is not valid
|
||||||
// and should not be included in the outline rectangle.
|
// and should not be included in the outline rectangle.
|
||||||
aOutValid = !aFrame->HasAnyStateBits(NS_FRAME_SVG_LAYOUT) ||
|
aOutValid = !aFrame->HasAnyStateBits(NS_FRAME_SVG_LAYOUT) ||
|
||||||
!aFrame->IsFrameOfType(nsIFrame::eSVGContainer) ||
|
!aFrame->IsSVGContainerFrame() || aFrame->IsSVGTextFrame();
|
||||||
aFrame->IsSVGTextFrame();
|
|
||||||
|
|
||||||
nsRect u;
|
nsRect u;
|
||||||
|
|
||||||
|
|
@ -11001,7 +10975,7 @@ bool nsIFrame::IsStackingContext(const nsStyleDisplay* aStyleDisplay,
|
||||||
auto willChange = aStyleDisplay->mWillChange.bits;
|
auto willChange = aStyleDisplay->mWillChange.bits;
|
||||||
if (aStyleDisplay->IsContainPaint() || aStyleDisplay->IsContainLayout() ||
|
if (aStyleDisplay->IsContainPaint() || aStyleDisplay->IsContainLayout() ||
|
||||||
willChange & StyleWillChangeBits::CONTAIN) {
|
willChange & StyleWillChangeBits::CONTAIN) {
|
||||||
if (IsFrameOfType(eSupportsContainLayoutAndPaint)) {
|
if (SupportsContainLayoutAndPaint()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -11009,7 +10983,7 @@ bool nsIFrame::IsStackingContext(const nsStyleDisplay* aStyleDisplay,
|
||||||
// but the spec says it acts like the rest of these
|
// but the spec says it acts like the rest of these
|
||||||
if (aStyleDisplay->HasPerspectiveStyle() ||
|
if (aStyleDisplay->HasPerspectiveStyle() ||
|
||||||
willChange & StyleWillChangeBits::PERSPECTIVE) {
|
willChange & StyleWillChangeBits::PERSPECTIVE) {
|
||||||
if (IsFrameOfType(eSupportsCSSTransforms)) {
|
if (SupportsCSSTransforms()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -11442,7 +11416,7 @@ nsIFrame::PhysicalAxes nsIFrame::ShouldApplyOverflowClipping(
|
||||||
// 'contain:paint' should prevent all means of escaping that clipping
|
// 'contain:paint' should prevent all means of escaping that clipping
|
||||||
// (e.g. because it forms a fixed-pos containing block).
|
// (e.g. because it forms a fixed-pos containing block).
|
||||||
if (aDisp->IsContainPaint() && !IsScrollFrame() &&
|
if (aDisp->IsContainPaint() && !IsScrollFrame() &&
|
||||||
IsFrameOfType(eSupportsContainLayoutAndPaint)) {
|
SupportsContainLayoutAndPaint()) {
|
||||||
return PhysicalAxes::Both;
|
return PhysicalAxes::Both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -11460,7 +11434,7 @@ nsIFrame::PhysicalAxes nsIFrame::ShouldApplyOverflowClipping(
|
||||||
case LayoutFrameType::SVGForeignObject:
|
case LayoutFrameType::SVGForeignObject:
|
||||||
return PhysicalAxes::Both;
|
return PhysicalAxes::Both;
|
||||||
default:
|
default:
|
||||||
if (IsFrameOfType(nsIFrame::eReplacedContainsBlock)) {
|
if (IsReplacedWithBlock()) {
|
||||||
if (type == mozilla::LayoutFrameType::TextInput) {
|
if (type == mozilla::LayoutFrameType::TextInput) {
|
||||||
// It has an anonymous scroll frame that handles any overflow.
|
// It has an anonymous scroll frame that handles any overflow.
|
||||||
return PhysicalAxes::None;
|
return PhysicalAxes::None;
|
||||||
|
|
|
||||||
|
|
@ -520,6 +520,43 @@ struct MOZ_RAII FrameDestroyContext {
|
||||||
AutoTArray<RefPtr<nsIContent>, 100> mAnonymousContent;
|
AutoTArray<RefPtr<nsIContent>, 100> mAnonymousContent;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bit-flags specific to a given layout class id.
|
||||||
|
*/
|
||||||
|
enum class LayoutFrameClassFlags : uint16_t {
|
||||||
|
None = 0,
|
||||||
|
Leaf = 1 << 0,
|
||||||
|
LeafDynamic = 1 << 1,
|
||||||
|
MathML = 1 << 2,
|
||||||
|
SVG = 1 << 3,
|
||||||
|
SVGContainer = 1 << 4,
|
||||||
|
BidiInlineContainer = 1 << 5,
|
||||||
|
// The frame is for a replaced element, such as an image
|
||||||
|
Replaced = 1 << 6,
|
||||||
|
// Frame that contains a block but looks like a replaced element from the
|
||||||
|
// outside.
|
||||||
|
ReplacedContainsBlock = 1 << 7,
|
||||||
|
// A replaced element that has replaced-element sizing characteristics (i.e.,
|
||||||
|
// like images or iframes), as opposed to inline-block sizing characteristics
|
||||||
|
// (like form controls).
|
||||||
|
ReplacedSizing = 1 << 8,
|
||||||
|
// A frame that participates in inline reflow, i.e., one that requires
|
||||||
|
// ReflowInput::mLineLayout.
|
||||||
|
LineParticipant = 1 << 9,
|
||||||
|
// Whether this frame is a table part (but not a table or table wrapper).
|
||||||
|
TablePart = 1 << 10,
|
||||||
|
CanContainOverflowContainers = 1 << 11,
|
||||||
|
// Whether the frame supports CSS transforms.
|
||||||
|
SupportsCSSTransforms = 1 << 12,
|
||||||
|
// Whether this frame class supports 'contain: layout' and 'contain: paint'
|
||||||
|
// (supporting one is equivalent to supporting the other).
|
||||||
|
SupportsContainLayoutAndPaint = 1 << 13,
|
||||||
|
// Whether this frame class supports the `aspect-ratio` property.
|
||||||
|
SupportsAspectRatio = 1 << 14,
|
||||||
|
};
|
||||||
|
|
||||||
|
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(LayoutFrameClassFlags)
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -578,6 +615,8 @@ class nsIFrame : public nsQueryFrame {
|
||||||
|
|
||||||
typedef nsQueryFrame::ClassID ClassID;
|
typedef nsQueryFrame::ClassID ClassID;
|
||||||
|
|
||||||
|
using ClassFlags = mozilla::LayoutFrameClassFlags;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
using ChildList = mozilla::FrameChildList;
|
using ChildList = mozilla::FrameChildList;
|
||||||
using ChildListID = mozilla::FrameChildListID;
|
using ChildListID = mozilla::FrameChildListID;
|
||||||
|
|
@ -3277,6 +3316,60 @@ class nsIFrame : public nsQueryFrame {
|
||||||
return sLayoutFrameTypes[uint8_t(mClass)];
|
return sLayoutFrameTypes[uint8_t(mClass)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the type flags of the frame.
|
||||||
|
*
|
||||||
|
* @see mozilla::LayoutFrameType
|
||||||
|
*/
|
||||||
|
ClassFlags GetClassFlags() const {
|
||||||
|
MOZ_ASSERT(uint8_t(mClass) < mozilla::ArrayLength(sLayoutFrameClassFlags));
|
||||||
|
return sLayoutFrameClassFlags[uint8_t(mClass)];
|
||||||
|
}
|
||||||
|
|
||||||
|
bool HasAnyClassFlag(ClassFlags aFlag) const {
|
||||||
|
return bool(GetClassFlags() & aFlag);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is this a leaf frame? Frames that want the frame constructor to be able to
|
||||||
|
* construct kids for them should return false, all others should return true.
|
||||||
|
*
|
||||||
|
* Note that returning true here does not mean that the frame _can't_ have
|
||||||
|
* kids. It could still have kids created via nsIAnonymousContentCreator.
|
||||||
|
*
|
||||||
|
* Returning true indicates that "normal" (non-anonymous, CSS generated
|
||||||
|
* content, etc) children should not be constructed.
|
||||||
|
*/
|
||||||
|
bool IsLeaf() const {
|
||||||
|
auto bits = GetClassFlags();
|
||||||
|
if (MOZ_UNLIKELY(bits & ClassFlags::LeafDynamic)) {
|
||||||
|
return IsLeafDynamic();
|
||||||
|
}
|
||||||
|
return bool(bits & ClassFlags::Leaf);
|
||||||
|
}
|
||||||
|
virtual bool IsLeafDynamic() const { return false; }
|
||||||
|
|
||||||
|
#define CLASS_FLAG_METHOD(name_, flag_) \
|
||||||
|
bool name_() const { return HasAnyClassFlag(ClassFlags::flag_); }
|
||||||
|
#define CLASS_FLAG_METHOD0(name_) CLASS_FLAG_METHOD(name_, name_)
|
||||||
|
|
||||||
|
CLASS_FLAG_METHOD(IsMathMLFrame, MathML);
|
||||||
|
CLASS_FLAG_METHOD(IsSVGFrame, SVG);
|
||||||
|
CLASS_FLAG_METHOD(IsSVGContainerFrame, SVGContainer);
|
||||||
|
CLASS_FLAG_METHOD(IsBidiInlineContainer, BidiInlineContainer);
|
||||||
|
CLASS_FLAG_METHOD(IsLineParticipant, LineParticipant);
|
||||||
|
CLASS_FLAG_METHOD(IsReplaced, Replaced);
|
||||||
|
CLASS_FLAG_METHOD(IsReplacedWithBlock, ReplacedContainsBlock);
|
||||||
|
CLASS_FLAG_METHOD(HasReplacedSizing, ReplacedSizing);
|
||||||
|
CLASS_FLAG_METHOD(IsTablePart, TablePart);
|
||||||
|
CLASS_FLAG_METHOD0(CanContainOverflowContainers)
|
||||||
|
CLASS_FLAG_METHOD0(SupportsCSSTransforms);
|
||||||
|
CLASS_FLAG_METHOD0(SupportsContainLayoutAndPaint)
|
||||||
|
CLASS_FLAG_METHOD0(SupportsAspectRatio)
|
||||||
|
|
||||||
|
#undef CLASS_FLAG_METHOD
|
||||||
|
#undef CLASS_FLAG_METHOD0
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
# pragma GCC diagnostic push
|
# pragma GCC diagnostic push
|
||||||
# pragma GCC diagnostic ignored "-Wtype-limits"
|
# pragma GCC diagnostic ignored "-Wtype-limits"
|
||||||
|
|
@ -3331,63 +3424,6 @@ class nsIFrame : public nsQueryFrame {
|
||||||
nsIFrame** aOutAncestor,
|
nsIFrame** aOutAncestor,
|
||||||
uint32_t aFlags = 0) const;
|
uint32_t aFlags = 0) const;
|
||||||
|
|
||||||
/**
|
|
||||||
* Bit-flags to pass to IsFrameOfType()
|
|
||||||
*/
|
|
||||||
enum {
|
|
||||||
eMathML = 1 << 0,
|
|
||||||
eSVG = 1 << 1,
|
|
||||||
eSVGContainer = 1 << 2,
|
|
||||||
eBidiInlineContainer = 1 << 3,
|
|
||||||
// the frame is for a replaced element, such as an image
|
|
||||||
eReplaced = 1 << 4,
|
|
||||||
// Frame that contains a block but looks like a replaced element
|
|
||||||
// from the outside
|
|
||||||
eReplacedContainsBlock = 1 << 5,
|
|
||||||
// A frame that participates in inline reflow, i.e., one that
|
|
||||||
// requires ReflowInput::mLineLayout.
|
|
||||||
eLineParticipant = 1 << 6,
|
|
||||||
eCanContainOverflowContainers = 1 << 7,
|
|
||||||
eTablePart = 1 << 8,
|
|
||||||
eSupportsCSSTransforms = 1 << 9,
|
|
||||||
|
|
||||||
// A replaced element that has replaced-element sizing
|
|
||||||
// characteristics (i.e., like images or iframes), as opposed to
|
|
||||||
// inline-block sizing characteristics (like form controls).
|
|
||||||
eReplacedSizing = 1 << 10,
|
|
||||||
|
|
||||||
// Does this frame class support 'contain: layout' and
|
|
||||||
// 'contain:paint' (supporting one is equivalent to supporting the
|
|
||||||
// other).
|
|
||||||
eSupportsContainLayoutAndPaint = 1 << 11,
|
|
||||||
|
|
||||||
// Does this frame class support `aspect-ratio` property.
|
|
||||||
eSupportsAspectRatio = 1 << 12,
|
|
||||||
|
|
||||||
// These are to allow nsIFrame::Init to assert that IsFrameOfType
|
|
||||||
// implementations all call the base class method. They are only
|
|
||||||
// meaningful in DEBUG builds.
|
|
||||||
eDEBUGAllFrames = 1 << 30,
|
|
||||||
eDEBUGNoFrames = 1 << 31
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* API for doing a quick check if a frame is of a given
|
|
||||||
* type. Returns true if the frame matches ALL flags passed in.
|
|
||||||
*
|
|
||||||
* Implementations should always override with inline virtual
|
|
||||||
* functions that call the base class's IsFrameOfType method.
|
|
||||||
*/
|
|
||||||
virtual bool IsFrameOfType(uint32_t aFlags) const {
|
|
||||||
return !(aFlags & ~(
|
|
||||||
#ifdef DEBUG
|
|
||||||
nsIFrame::eDEBUGAllFrames |
|
|
||||||
#endif
|
|
||||||
nsIFrame::eSupportsCSSTransforms |
|
|
||||||
nsIFrame::eSupportsContainLayoutAndPaint |
|
|
||||||
nsIFrame::eSupportsAspectRatio));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if this frame's preferred size property or max size property
|
* Return true if this frame's preferred size property or max size property
|
||||||
* contains a percentage value that should be resolved against zero when
|
* contains a percentage value that should be resolved against zero when
|
||||||
|
|
@ -3472,26 +3508,6 @@ class nsIFrame : public nsQueryFrame {
|
||||||
*/
|
*/
|
||||||
virtual bool IsFloatContainingBlock() const { return false; }
|
virtual bool IsFloatContainingBlock() const { return false; }
|
||||||
|
|
||||||
/**
|
|
||||||
* Is this a leaf frame? Frames that want the frame constructor to be able
|
|
||||||
* to construct kids for them should return false, all others should return
|
|
||||||
* true. Note that returning true here does not mean that the frame _can't_
|
|
||||||
* have kids. It could still have kids created via
|
|
||||||
* nsIAnonymousContentCreator. Returning true indicates that "normal"
|
|
||||||
* (non-anonymous, CSS generated content, etc) children should not be
|
|
||||||
* constructed.
|
|
||||||
*/
|
|
||||||
bool IsLeaf() const {
|
|
||||||
MOZ_ASSERT(uint8_t(mClass) < mozilla::ArrayLength(sFrameClassBits));
|
|
||||||
FrameClassBits bits = sFrameClassBits[uint8_t(mClass)];
|
|
||||||
if (MOZ_UNLIKELY(bits & eFrameClassBitsDynamicLeaf)) {
|
|
||||||
return IsLeafDynamic();
|
|
||||||
}
|
|
||||||
return bits & eFrameClassBitsLeaf;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool IsLeafDynamic() const { return false; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Marks all display items created by this frame as needing a repaint,
|
* Marks all display items created by this frame as needing a repaint,
|
||||||
* and calls SchedulePaint() if requested and one is not already pending.
|
* and calls SchedulePaint() if requested and one is not already pending.
|
||||||
|
|
@ -5361,28 +5377,18 @@ class nsIFrame : public nsQueryFrame {
|
||||||
const nsStyleEffects* aStyleEffects,
|
const nsStyleEffects* aStyleEffects,
|
||||||
mozilla::EffectSet* aEffectSet = nullptr) const;
|
mozilla::EffectSet* aEffectSet = nullptr) const;
|
||||||
|
|
||||||
// Maps mClass to LayoutFrameType.
|
static constexpr size_t kFrameClassCount =
|
||||||
static const mozilla::LayoutFrameType sLayoutFrameTypes[
|
|
||||||
#define FRAME_ID(...) 1 +
|
#define FRAME_ID(...) 1 +
|
||||||
#define ABSTRACT_FRAME_ID(...)
|
#define ABSTRACT_FRAME_ID(...)
|
||||||
#include "mozilla/FrameIdList.h"
|
#include "mozilla/FrameIdList.h"
|
||||||
#undef FRAME_ID
|
#undef FRAME_ID
|
||||||
#undef ABSTRACT_FRAME_ID
|
#undef ABSTRACT_FRAME_ID
|
||||||
0];
|
0;
|
||||||
|
|
||||||
enum FrameClassBits {
|
// Maps mClass to LayoutFrameType.
|
||||||
eFrameClassBitsNone = 0x0,
|
static const mozilla::LayoutFrameType sLayoutFrameTypes[kFrameClassCount];
|
||||||
eFrameClassBitsLeaf = 0x1,
|
// Maps mClass to LayoutFrameTypeFlags.
|
||||||
eFrameClassBitsDynamicLeaf = 0x2,
|
static const ClassFlags sLayoutFrameClassFlags[kFrameClassCount];
|
||||||
};
|
|
||||||
// Maps mClass to IsLeaf() flags.
|
|
||||||
static const FrameClassBits sFrameClassBits[
|
|
||||||
#define FRAME_ID(...) 1 +
|
|
||||||
#define ABSTRACT_FRAME_ID(...)
|
|
||||||
#include "mozilla/FrameIdList.h"
|
|
||||||
#undef FRAME_ID
|
|
||||||
#undef ABSTRACT_FRAME_ID
|
|
||||||
0];
|
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -115,11 +115,6 @@ class nsImageFrame : public nsAtomicContainerFrame, public nsIReflowCallback {
|
||||||
mozilla::a11y::AccType AccessibleType() override;
|
mozilla::a11y::AccType AccessibleType() override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const final {
|
|
||||||
return nsAtomicContainerFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedSizing));
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
nsresult GetFrameName(nsAString& aResult) const override;
|
nsresult GetFrameName(nsAString& aResult) const override;
|
||||||
void List(FILE* out = stderr, const char* aPrefix = "",
|
void List(FILE* out = stderr, const char* aPrefix = "",
|
||||||
|
|
|
||||||
|
|
@ -44,16 +44,6 @@ class nsInlineFrame : public nsContainerFrame {
|
||||||
virtual nsresult GetFrameName(nsAString& aResult) const override;
|
virtual nsresult GetFrameName(nsAString& aResult) const override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
virtual bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
if (aFlags & (eSupportsCSSTransforms | eSupportsContainLayoutAndPaint |
|
|
||||||
eSupportsAspectRatio)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return nsContainerFrame::IsFrameOfType(
|
|
||||||
aFlags &
|
|
||||||
~(nsIFrame::eBidiInlineContainer | nsIFrame::eLineParticipant));
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void InvalidateFrame(uint32_t aDisplayItemKey = 0,
|
virtual void InvalidateFrame(uint32_t aDisplayItemKey = 0,
|
||||||
bool aRebuildDisplayItems = true) override;
|
bool aRebuildDisplayItems = true) override;
|
||||||
virtual void InvalidateFrameWithRect(
|
virtual void InvalidateFrameWithRect(
|
||||||
|
|
|
||||||
|
|
@ -52,13 +52,6 @@ class nsLeafFrame : public nsIFrame {
|
||||||
const ReflowInput& aReflowInput,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override = 0;
|
nsReflowStatus& aStatus) override = 0;
|
||||||
|
|
||||||
virtual bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
// We don't actually contain a block, but we do always want a
|
|
||||||
// computed width, so tell a little white lie here.
|
|
||||||
return nsIFrame::IsFrameOfType(aFlags &
|
|
||||||
~(nsIFrame::eReplacedContainsBlock));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
nsLeafFrame(ComputedStyle* aStyle, nsPresContext* aPresContext, ClassID aID)
|
nsLeafFrame(ComputedStyle* aStyle, nsPresContext* aPresContext, ClassID aID)
|
||||||
: nsIFrame(aStyle, aPresContext, aID) {}
|
: nsIFrame(aStyle, aPresContext, aID) {}
|
||||||
|
|
|
||||||
|
|
@ -1377,7 +1377,7 @@ void nsLineLayout::PlaceFrame(PerFrameData* pfd, ReflowOutput& aMetrics) {
|
||||||
// vertically aligned, which happens after this.
|
// vertically aligned, which happens after this.
|
||||||
const auto baselineSource = pfd->mFrame->StyleDisplay()->mBaselineSource;
|
const auto baselineSource = pfd->mFrame->StyleDisplay()->mBaselineSource;
|
||||||
if (baselineSource == StyleBaselineSource::Auto ||
|
if (baselineSource == StyleBaselineSource::Auto ||
|
||||||
pfd->mFrame->IsFrameOfType(nsIFrame::eLineParticipant)) {
|
pfd->mFrame->IsLineParticipant()) {
|
||||||
if (aMetrics.BlockStartAscent() == ReflowOutput::ASK_FOR_BASELINE) {
|
if (aMetrics.BlockStartAscent() == ReflowOutput::ASK_FOR_BASELINE) {
|
||||||
pfd->mAscent = pfd->mFrame->GetLogicalBaseline(lineWM);
|
pfd->mAscent = pfd->mFrame->GetLogicalBaseline(lineWM);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -31,11 +31,6 @@ class nsPageContentFrame final : public mozilla::ViewportFrame {
|
||||||
const ReflowInput& aReflowInput,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return ViewportFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eCanContainOverflowContainers));
|
|
||||||
}
|
|
||||||
|
|
||||||
const nsAtom* GetPageName() const { return mPageName; }
|
const nsAtom* GetPageName() const { return mPageName; }
|
||||||
|
|
||||||
void SetSharedPageData(nsSharedPageData* aPD) { mPD = aPD; }
|
void SetSharedPageData(nsSharedPageData* aPD) { mPD = aPD; }
|
||||||
|
|
|
||||||
|
|
@ -236,16 +236,6 @@ void nsRubyBaseContainerFrame::AddInlinePrefISize(
|
||||||
aData->mCurrentLine += sum;
|
aData->mCurrentLine += sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* virtual */
|
|
||||||
bool nsRubyBaseContainerFrame::IsFrameOfType(uint32_t aFlags) const {
|
|
||||||
if (aFlags & (eSupportsCSSTransforms | eSupportsContainLayoutAndPaint |
|
|
||||||
eSupportsAspectRatio)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return nsContainerFrame::IsFrameOfType(aFlags &
|
|
||||||
~(nsIFrame::eLineParticipant));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* virtual */
|
/* virtual */
|
||||||
bool nsRubyBaseContainerFrame::CanContinueTextRun() const { return true; }
|
bool nsRubyBaseContainerFrame::CanContinueTextRun() const { return true; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ class nsRubyBaseContainerFrame final : public nsContainerFrame {
|
||||||
NS_DECL_QUERYFRAME
|
NS_DECL_QUERYFRAME
|
||||||
|
|
||||||
// nsIFrame overrides
|
// nsIFrame overrides
|
||||||
virtual bool IsFrameOfType(uint32_t aFlags) const override;
|
|
||||||
virtual bool CanContinueTextRun() const override;
|
virtual bool CanContinueTextRun() const override;
|
||||||
virtual void AddInlineMinISize(gfxContext* aRenderingContext,
|
virtual void AddInlineMinISize(gfxContext* aRenderingContext,
|
||||||
InlineMinISizeData* aData) override;
|
InlineMinISizeData* aData) override;
|
||||||
|
|
|
||||||
|
|
@ -19,14 +19,6 @@ using namespace mozilla;
|
||||||
// nsRubyContentFrame Method Implementations
|
// nsRubyContentFrame Method Implementations
|
||||||
// ======================================
|
// ======================================
|
||||||
|
|
||||||
/* virtual */
|
|
||||||
bool nsRubyContentFrame::IsFrameOfType(uint32_t aFlags) const {
|
|
||||||
if (aFlags & eBidiInlineContainer) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return nsInlineFrame::IsFrameOfType(aFlags);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool nsRubyContentFrame::IsIntraLevelWhitespace() const {
|
bool nsRubyContentFrame::IsIntraLevelWhitespace() const {
|
||||||
auto pseudoType = Style()->GetPseudoType();
|
auto pseudoType = Style()->GetPseudoType();
|
||||||
if (pseudoType != PseudoStyleType::rubyBase &&
|
if (pseudoType != PseudoStyleType::rubyBase &&
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,6 @@ class nsRubyContentFrame : public nsInlineFrame {
|
||||||
public:
|
public:
|
||||||
NS_DECL_ABSTRACT_FRAME(nsRubyContentFrame)
|
NS_DECL_ABSTRACT_FRAME(nsRubyContentFrame)
|
||||||
|
|
||||||
// nsIFrame overrides
|
|
||||||
virtual bool IsFrameOfType(uint32_t aFlags) const override;
|
|
||||||
|
|
||||||
// Indicates whether this is an "intra-level whitespace" frame, i.e.
|
// Indicates whether this is an "intra-level whitespace" frame, i.e.
|
||||||
// an anonymous frame that was created to contain non-droppable
|
// an anonymous frame that was created to contain non-droppable
|
||||||
// whitespaces directly inside a ruby level container. This impacts
|
// whitespaces directly inside a ruby level container. This impacts
|
||||||
|
|
|
||||||
|
|
@ -44,14 +44,6 @@ nsContainerFrame* NS_NewRubyFrame(PresShell* aPresShell,
|
||||||
// nsRubyFrame Method Implementations
|
// nsRubyFrame Method Implementations
|
||||||
// ==================================
|
// ==================================
|
||||||
|
|
||||||
/* virtual */
|
|
||||||
bool nsRubyFrame::IsFrameOfType(uint32_t aFlags) const {
|
|
||||||
if (aFlags & eBidiInlineContainer) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return nsInlineFrame::IsFrameOfType(aFlags);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
nsresult nsRubyFrame::GetFrameName(nsAString& aResult) const {
|
nsresult nsRubyFrame::GetFrameName(nsAString& aResult) const {
|
||||||
return MakeFrameName(u"Ruby"_ns, aResult);
|
return MakeFrameName(u"Ruby"_ns, aResult);
|
||||||
|
|
@ -86,7 +78,7 @@ void nsRubyFrame::AddInlinePrefISize(gfxContext* aRenderingContext,
|
||||||
static nsRubyBaseContainerFrame* FindRubyBaseContainerAncestor(
|
static nsRubyBaseContainerFrame* FindRubyBaseContainerAncestor(
|
||||||
nsIFrame* aFrame) {
|
nsIFrame* aFrame) {
|
||||||
for (nsIFrame* ancestor = aFrame->GetParent();
|
for (nsIFrame* ancestor = aFrame->GetParent();
|
||||||
ancestor && ancestor->IsFrameOfType(nsIFrame::eLineParticipant);
|
ancestor && ancestor->IsLineParticipant();
|
||||||
ancestor = ancestor->GetParent()) {
|
ancestor = ancestor->GetParent()) {
|
||||||
if (ancestor->IsRubyBaseContainerFrame()) {
|
if (ancestor->IsRubyBaseContainerFrame()) {
|
||||||
return static_cast<nsRubyBaseContainerFrame*>(ancestor);
|
return static_cast<nsRubyBaseContainerFrame*>(ancestor);
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ class nsRubyFrame final : public nsInlineFrame {
|
||||||
NS_DECL_QUERYFRAME
|
NS_DECL_QUERYFRAME
|
||||||
|
|
||||||
// nsIFrame overrides
|
// nsIFrame overrides
|
||||||
virtual bool IsFrameOfType(uint32_t aFlags) const override;
|
|
||||||
virtual void AddInlineMinISize(gfxContext* aRenderingContext,
|
virtual void AddInlineMinISize(gfxContext* aRenderingContext,
|
||||||
InlineMinISizeData* aData) override;
|
InlineMinISizeData* aData) override;
|
||||||
virtual void AddInlinePrefISize(gfxContext* aRenderingContext,
|
virtual void AddInlinePrefISize(gfxContext* aRenderingContext,
|
||||||
|
|
|
||||||
|
|
@ -46,15 +46,6 @@ nsresult nsRubyTextContainerFrame::GetFrameName(nsAString& aResult) const {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* virtual */
|
|
||||||
bool nsRubyTextContainerFrame::IsFrameOfType(uint32_t aFlags) const {
|
|
||||||
if (aFlags & (eSupportsCSSTransforms | eSupportsContainLayoutAndPaint |
|
|
||||||
eSupportsAspectRatio)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return nsContainerFrame::IsFrameOfType(aFlags);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* virtual */
|
/* virtual */
|
||||||
void nsRubyTextContainerFrame::SetInitialChildList(ChildListID aListID,
|
void nsRubyTextContainerFrame::SetInitialChildList(ChildListID aListID,
|
||||||
nsFrameList&& aChildList) {
|
nsFrameList&& aChildList) {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ class nsRubyTextContainerFrame final : public nsContainerFrame {
|
||||||
NS_DECL_QUERYFRAME
|
NS_DECL_QUERYFRAME
|
||||||
|
|
||||||
// nsIFrame overrides
|
// nsIFrame overrides
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override;
|
|
||||||
void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
|
void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowInput,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
|
||||||
|
|
@ -44,12 +44,6 @@ class nsSubDocumentFrame final : public nsAtomicContainerFrame,
|
||||||
|
|
||||||
NS_DECL_QUERYFRAME
|
NS_DECL_QUERYFRAME
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsAtomicContainerFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedSizing |
|
|
||||||
nsIFrame::eReplacedContainsBlock));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1129,8 +1129,8 @@ class BuildTextRunsScanner {
|
||||||
};
|
};
|
||||||
|
|
||||||
static nsIFrame* FindLineContainer(nsIFrame* aFrame) {
|
static nsIFrame* FindLineContainer(nsIFrame* aFrame) {
|
||||||
while (aFrame && (aFrame->IsFrameOfType(nsIFrame::eLineParticipant) ||
|
while (aFrame &&
|
||||||
aFrame->CanContinueTextRun())) {
|
(aFrame->IsLineParticipant() || aFrame->CanContinueTextRun())) {
|
||||||
aFrame = aFrame->GetParent();
|
aFrame = aFrame->GetParent();
|
||||||
}
|
}
|
||||||
return aFrame;
|
return aFrame;
|
||||||
|
|
@ -5019,8 +5019,7 @@ static already_AddRefed<gfxTextRun> GenerateTextRunForEmphasisMarks(
|
||||||
static nsRubyFrame* FindFurthestInlineRubyAncestor(nsTextFrame* aFrame) {
|
static nsRubyFrame* FindFurthestInlineRubyAncestor(nsTextFrame* aFrame) {
|
||||||
nsRubyFrame* rubyFrame = nullptr;
|
nsRubyFrame* rubyFrame = nullptr;
|
||||||
for (nsIFrame* frame = aFrame->GetParent();
|
for (nsIFrame* frame = aFrame->GetParent();
|
||||||
frame && frame->IsFrameOfType(nsIFrame::eLineParticipant);
|
frame && frame->IsLineParticipant(); frame = frame->GetParent()) {
|
||||||
frame = frame->GetParent()) {
|
|
||||||
if (frame->IsRubyFrame()) {
|
if (frame->IsRubyFrame()) {
|
||||||
rubyFrame = static_cast<nsRubyFrame*>(frame);
|
rubyFrame = static_cast<nsRubyFrame*>(frame);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -273,13 +273,6 @@ class nsTextFrame : public nsIFrame {
|
||||||
nsTextFrame* LastInFlow() const final;
|
nsTextFrame* LastInFlow() const final;
|
||||||
nsTextFrame* LastContinuation() const final;
|
nsTextFrame* LastContinuation() const final;
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const final {
|
|
||||||
// Set the frame state bit for text frames to mark them as replaced.
|
|
||||||
// XXX kipp: temporary
|
|
||||||
return nsIFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eReplaced | nsIFrame::eLineParticipant));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShouldSuppressLineBreak() const;
|
bool ShouldSuppressLineBreak() const;
|
||||||
|
|
||||||
void InvalidateFrame(uint32_t aDisplayItemKey = 0,
|
void InvalidateFrame(uint32_t aDisplayItemKey = 0,
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,20 @@ nsIFrame* NS_NewHTMLVideoFrame(PresShell* aPresShell, ComputedStyle* aStyle) {
|
||||||
return new (aPresShell) nsVideoFrame(aStyle, aPresShell->GetPresContext());
|
return new (aPresShell) nsVideoFrame(aStyle, aPresShell->GetPresContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsIFrame* NS_NewHTMLAudioFrame(PresShell* aPresShell, ComputedStyle* aStyle) {
|
||||||
|
return new (aPresShell) nsAudioFrame(aStyle, aPresShell->GetPresContext());
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMPL_FRAMEARENA_HELPERS(nsVideoFrame)
|
NS_IMPL_FRAMEARENA_HELPERS(nsVideoFrame)
|
||||||
|
NS_QUERYFRAME_HEAD(nsVideoFrame)
|
||||||
|
NS_QUERYFRAME_ENTRY(nsVideoFrame)
|
||||||
|
NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
|
||||||
|
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
|
||||||
|
|
||||||
|
NS_IMPL_FRAMEARENA_HELPERS(nsAudioFrame)
|
||||||
|
NS_QUERYFRAME_HEAD(nsAudioFrame)
|
||||||
|
NS_QUERYFRAME_ENTRY(nsAudioFrame)
|
||||||
|
NS_QUERYFRAME_TAIL_INHERITING(nsVideoFrame)
|
||||||
|
|
||||||
// A matrix to obtain a correct-rotated video frame.
|
// A matrix to obtain a correct-rotated video frame.
|
||||||
static Matrix ComputeRotationMatrix(gfxFloat aRotatedWidth,
|
static Matrix ComputeRotationMatrix(gfxFloat aRotatedWidth,
|
||||||
|
|
@ -71,17 +84,19 @@ static void SwapScaleWidthHeightForRotation(IntSize& aSize,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsVideoFrame::nsVideoFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
|
nsVideoFrame::nsVideoFrame(ComputedStyle* aStyle, nsPresContext* aPc,
|
||||||
: nsContainerFrame(aStyle, aPresContext, kClassID) {
|
ClassID aClassID)
|
||||||
|
: nsContainerFrame(aStyle, aPc, aClassID),
|
||||||
|
mIsAudio(aClassID == nsAudioFrame::kClassID) {
|
||||||
EnableVisibilityTracking();
|
EnableVisibilityTracking();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsVideoFrame::~nsVideoFrame() = default;
|
nsVideoFrame::~nsVideoFrame() = default;
|
||||||
|
|
||||||
NS_QUERYFRAME_HEAD(nsVideoFrame)
|
nsAudioFrame::nsAudioFrame(ComputedStyle* aStyle, nsPresContext* aPc)
|
||||||
NS_QUERYFRAME_ENTRY(nsVideoFrame)
|
: nsVideoFrame(aStyle, aPc, kClassID) {}
|
||||||
NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
|
|
||||||
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
|
nsAudioFrame::~nsAudioFrame() = default;
|
||||||
|
|
||||||
nsresult nsVideoFrame::CreateAnonymousContent(
|
nsresult nsVideoFrame::CreateAnonymousContent(
|
||||||
nsTArray<ContentInfo>& aElements) {
|
nsTArray<ContentInfo>& aElements) {
|
||||||
|
|
@ -519,10 +534,6 @@ void nsVideoFrame::OnVisibilityChange(
|
||||||
nsContainerFrame::OnVisibilityChange(aNewVisibility, aNonvisibleAction);
|
nsContainerFrame::OnVisibilityChange(aNewVisibility, aNonvisibleAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool nsVideoFrame::HasVideoElement() const {
|
|
||||||
return static_cast<HTMLMediaElement*>(GetContent())->IsVideo();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool nsVideoFrame::HasVideoData() const {
|
bool nsVideoFrame::HasVideoData() const {
|
||||||
if (!HasVideoElement()) {
|
if (!HasVideoElement()) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -19,16 +19,18 @@
|
||||||
class nsPresContext;
|
class nsPresContext;
|
||||||
class nsDisplayItem;
|
class nsDisplayItem;
|
||||||
|
|
||||||
class nsVideoFrame final : public nsContainerFrame,
|
class nsVideoFrame : public nsContainerFrame,
|
||||||
public nsIReflowCallback,
|
public nsIReflowCallback,
|
||||||
public nsIAnonymousContentCreator {
|
public nsIAnonymousContentCreator {
|
||||||
public:
|
public:
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using Maybe = mozilla::Maybe<T>;
|
using Maybe = mozilla::Maybe<T>;
|
||||||
using Nothing = mozilla::Nothing;
|
using Nothing = mozilla::Nothing;
|
||||||
using Visibility = mozilla::Visibility;
|
using Visibility = mozilla::Visibility;
|
||||||
|
|
||||||
explicit nsVideoFrame(ComputedStyle*, nsPresContext*);
|
nsVideoFrame(ComputedStyle* aStyle, nsPresContext* aPc)
|
||||||
|
: nsVideoFrame(aStyle, aPc, kClassID) {}
|
||||||
|
nsVideoFrame(ComputedStyle*, nsPresContext*, ClassID);
|
||||||
|
|
||||||
NS_DECL_QUERYFRAME
|
NS_DECL_QUERYFRAME
|
||||||
NS_DECL_FRAMEARENA_HELPERS(nsVideoFrame)
|
NS_DECL_FRAMEARENA_HELPERS(nsVideoFrame)
|
||||||
|
|
@ -37,51 +39,39 @@ class nsVideoFrame final : public nsContainerFrame,
|
||||||
bool ReflowFinished() final;
|
bool ReflowFinished() final;
|
||||||
|
|
||||||
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists) override;
|
const nsDisplayListSet& aLists) final;
|
||||||
|
|
||||||
nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
||||||
int32_t aModType) override;
|
int32_t aModType) final;
|
||||||
|
|
||||||
void OnVisibilityChange(
|
void OnVisibilityChange(
|
||||||
Visibility aNewVisibility,
|
Visibility aNewVisibility,
|
||||||
const Maybe<OnNonvisible>& aNonvisibleAction = Nothing()) override;
|
const Maybe<OnNonvisible>& aNonvisibleAction = Nothing()) final;
|
||||||
|
|
||||||
/* get the size of the video's display */
|
/* get the size of the video's display */
|
||||||
mozilla::IntrinsicSize GetIntrinsicSize() override;
|
mozilla::IntrinsicSize GetIntrinsicSize() final;
|
||||||
mozilla::AspectRatio GetIntrinsicRatio() const override;
|
mozilla::AspectRatio GetIntrinsicRatio() const final;
|
||||||
SizeComputationResult ComputeSize(
|
SizeComputationResult ComputeSize(
|
||||||
gfxContext* aRenderingContext, mozilla::WritingMode aWM,
|
gfxContext* aRenderingContext, mozilla::WritingMode aWM,
|
||||||
const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize,
|
const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize,
|
||||||
const mozilla::LogicalSize& aMargin,
|
const mozilla::LogicalSize& aMargin,
|
||||||
const mozilla::LogicalSize& aBorderPadding,
|
const mozilla::LogicalSize& aBorderPadding,
|
||||||
const mozilla::StyleSizeOverrides& aSizeOverrides,
|
const mozilla::StyleSizeOverrides& aSizeOverrides,
|
||||||
mozilla::ComputeSizeFlags aFlags) override;
|
mozilla::ComputeSizeFlags aFlags) final;
|
||||||
nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
nscoord GetMinISize(gfxContext* aRenderingContext) final;
|
||||||
nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
nscoord GetPrefISize(gfxContext* aRenderingContext) final;
|
||||||
void Destroy(DestroyContext&) override;
|
void Destroy(DestroyContext&) final;
|
||||||
|
|
||||||
void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
|
void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowInput,
|
const ReflowInput& aReflowInput, nsReflowStatus& aStatus) final;
|
||||||
nsReflowStatus& aStatus) override;
|
|
||||||
|
|
||||||
#ifdef ACCESSIBILITY
|
#ifdef ACCESSIBILITY
|
||||||
mozilla::a11y::AccType AccessibleType() override;
|
mozilla::a11y::AccType AccessibleType() final;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) final;
|
||||||
// audio element with visible controls is an inline element, so we don't
|
|
||||||
// apply aspect-ratio.
|
|
||||||
if ((aFlags & nsIFrame::eSupportsAspectRatio) && !HasVideoElement()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsSplittableFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedSizing));
|
|
||||||
}
|
|
||||||
|
|
||||||
nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
|
|
||||||
void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
|
void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
|
||||||
uint32_t aFilters) override;
|
uint32_t aFilters) final;
|
||||||
|
|
||||||
mozilla::dom::Element* GetPosterImage() const { return mPosterImage; }
|
mozilla::dom::Element* GetPosterImage() const { return mPosterImage; }
|
||||||
|
|
||||||
|
|
@ -97,9 +87,10 @@ class nsVideoFrame final : public nsContainerFrame,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Returns true if we're rendering for a video element. We still create
|
// Returns true if we're rendering for a video element. We create an
|
||||||
// nsVideoFrame to render controls for an audio element.
|
// nsAudioFrame (which is still an nsVideoFrame) to render controls for an
|
||||||
bool HasVideoElement() const;
|
// audio element.
|
||||||
|
bool HasVideoElement() const { return !mIsAudio; }
|
||||||
|
|
||||||
// Returns true if there is video data to render. Can return false
|
// Returns true if there is video data to render. Can return false
|
||||||
// when we're the frame for an audio element, or we've created a video
|
// when we're the frame for an audio element, or we've created a video
|
||||||
|
|
@ -131,6 +122,21 @@ class nsVideoFrame final : public nsContainerFrame,
|
||||||
nsSize mControlsTrackedSize{-1, -1};
|
nsSize mControlsTrackedSize{-1, -1};
|
||||||
nsSize mCaptionTrackedSize{-1, -1};
|
nsSize mCaptionTrackedSize{-1, -1};
|
||||||
bool mReflowCallbackPosted = false;
|
bool mReflowCallbackPosted = false;
|
||||||
|
const bool mIsAudio;
|
||||||
|
};
|
||||||
|
|
||||||
|
// NOTE(emilio): This class here only for the purpose of having different
|
||||||
|
// ClassFlags for <audio> elements. This frame shouldn't contain extra logic, as
|
||||||
|
// things are set up now, because <audio> can also use video controls etc.
|
||||||
|
// In the future we might want to rejigger this to be less weird (e.g, an audio
|
||||||
|
// frame might not need a caption, or text tracks, or what not).
|
||||||
|
class nsAudioFrame final : public nsVideoFrame {
|
||||||
|
public:
|
||||||
|
NS_DECL_QUERYFRAME
|
||||||
|
NS_DECL_FRAMEARENA_HELPERS(nsAudioFrame)
|
||||||
|
|
||||||
|
nsAudioFrame(ComputedStyle*, nsPresContext*);
|
||||||
|
virtual ~nsAudioFrame();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* nsVideoFrame_h___ */
|
#endif /* nsVideoFrame_h___ */
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ void nsDisplayMathMLError::Paint(nsDisplayListBuilder* aBuilder,
|
||||||
static bool IsForeignChild(const nsIFrame* aFrame) {
|
static bool IsForeignChild(const nsIFrame* aFrame) {
|
||||||
// This counts nsMathMLmathBlockFrame as a foreign child, because it
|
// This counts nsMathMLmathBlockFrame as a foreign child, because it
|
||||||
// uses block reflow
|
// uses block reflow
|
||||||
return !(aFrame->IsFrameOfType(nsIFrame::eMathML)) || aFrame->IsBlockFrame();
|
return !aFrame->IsMathMLFrame() || aFrame->IsBlockFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_DECLARE_FRAME_PROPERTY_DELETABLE(HTMLReflowOutputProperty, ReflowOutput)
|
NS_DECLARE_FRAME_PROPERTY_DELETABLE(HTMLReflowOutputProperty, ReflowOutput)
|
||||||
|
|
|
||||||
|
|
@ -65,13 +65,6 @@ class nsMathMLContainerFrame : public nsContainerFrame, public nsMathMLFrame {
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// Overloaded nsContainerFrame methods -- see documentation in nsIFrame.h
|
// Overloaded nsContainerFrame methods -- see documentation in nsIFrame.h
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
if (aFlags & (eLineParticipant | eSupportsContainLayoutAndPaint)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return nsContainerFrame::IsFrameOfType(aFlags & ~eMathML);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AppendFrames(ChildListID aListID, nsFrameList&& aFrameList) override;
|
void AppendFrames(ChildListID aListID, nsFrameList&& aFrameList) override;
|
||||||
|
|
||||||
void InsertFrames(ChildListID aListID, nsIFrame* aPrevFrame,
|
void InsertFrames(ChildListID aListID, nsIFrame* aPrevFrame,
|
||||||
|
|
@ -428,10 +421,6 @@ class nsMathMLmathBlockFrame final : public nsBlockFrame {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsBlockFrame::IsFrameOfType(aFlags & ~nsIFrame::eMathML);
|
|
||||||
}
|
|
||||||
|
|
||||||
// See nsIMathMLFrame.h
|
// See nsIMathMLFrame.h
|
||||||
bool IsMrowLike() {
|
bool IsMrowLike() {
|
||||||
return mFrames.FirstChild() != mFrames.LastChild() || !mFrames.FirstChild();
|
return mFrames.FirstChild() != mFrames.LastChild() || !mFrames.FirstChild();
|
||||||
|
|
@ -503,10 +492,6 @@ class nsMathMLmathInlineFrame final : public nsInlineFrame,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsInlineFrame::IsFrameOfType(aFlags & ~nsIFrame::eMathML);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsMrowLike() override {
|
bool IsMrowLike() override {
|
||||||
return mFrames.FirstChild() != mFrames.LastChild() || !mFrames.FirstChild();
|
return mFrames.FirstChild() != mFrames.LastChild() || !mFrames.FirstChild();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ void nsMathMLFrame::GetEmbellishDataFrom(nsIFrame* aFrame,
|
||||||
aEmbellishData.leadingSpace = 0;
|
aEmbellishData.leadingSpace = 0;
|
||||||
aEmbellishData.trailingSpace = 0;
|
aEmbellishData.trailingSpace = 0;
|
||||||
|
|
||||||
if (aFrame && aFrame->IsFrameOfType(nsIFrame::eMathML)) {
|
if (aFrame && aFrame->IsMathMLFrame()) {
|
||||||
nsIMathMLFrame* mathMLFrame = do_QueryFrame(aFrame);
|
nsIMathMLFrame* mathMLFrame = do_QueryFrame(aFrame);
|
||||||
if (mathMLFrame) {
|
if (mathMLFrame) {
|
||||||
mathMLFrame->GetEmbellishData(aEmbellishData);
|
mathMLFrame->GetEmbellishData(aEmbellishData);
|
||||||
|
|
@ -116,7 +116,7 @@ void nsMathMLFrame::GetPresentationDataFrom(
|
||||||
|
|
||||||
nsIFrame* frame = aFrame;
|
nsIFrame* frame = aFrame;
|
||||||
while (frame) {
|
while (frame) {
|
||||||
if (frame->IsFrameOfType(nsIFrame::eMathML)) {
|
if (frame->IsMathMLFrame()) {
|
||||||
nsIMathMLFrame* mathMLFrame = do_QueryFrame(frame);
|
nsIMathMLFrame* mathMLFrame = do_QueryFrame(frame);
|
||||||
if (mathMLFrame) {
|
if (mathMLFrame) {
|
||||||
mathMLFrame->GetPresentationData(aPresentationData);
|
mathMLFrame->GetPresentationData(aPresentationData);
|
||||||
|
|
|
||||||
|
|
@ -132,9 +132,10 @@ class nsMathMLFrame : public nsIMathMLFrame {
|
||||||
float aFontSizeInflation);
|
float aFontSizeInflation);
|
||||||
|
|
||||||
static eMathMLFrameType GetMathMLFrameTypeFor(nsIFrame* aFrame) {
|
static eMathMLFrameType GetMathMLFrameTypeFor(nsIFrame* aFrame) {
|
||||||
if (aFrame->IsFrameOfType(nsIFrame::eMathML)) {
|
if (aFrame->IsMathMLFrame()) {
|
||||||
nsIMathMLFrame* mathMLFrame = do_QueryFrame(aFrame);
|
if (nsIMathMLFrame* mathMLFrame = do_QueryFrame(aFrame)) {
|
||||||
if (mathMLFrame) return mathMLFrame->GetMathMLFrameType();
|
return mathMLFrame->GetMathMLFrameType();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return eMathMLFrameType_UNKNOWN;
|
return eMathMLFrameType_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,6 @@ class nsMathMLmtableWrapperFrame final : public nsTableWrapperFrame,
|
||||||
nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
||||||
int32_t aModType) override;
|
int32_t aModType) override;
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsTableWrapperFrame::IsFrameOfType(aFlags & ~(nsIFrame::eMathML));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit nsMathMLmtableWrapperFrame(ComputedStyle* aStyle,
|
explicit nsMathMLmtableWrapperFrame(ComputedStyle* aStyle,
|
||||||
nsPresContext* aPresContext)
|
nsPresContext* aPresContext)
|
||||||
|
|
@ -94,10 +90,6 @@ class nsMathMLmtableFrame final : public nsTableFrame {
|
||||||
RestyleTable();
|
RestyleTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsTableFrame::IsFrameOfType(aFlags & ~(nsIFrame::eMathML));
|
|
||||||
}
|
|
||||||
|
|
||||||
// helper to restyle and reflow the table when a row is changed -- since
|
// helper to restyle and reflow the table when a row is changed -- since
|
||||||
// MathML attributes are inter-dependent and row/colspan can affect the table,
|
// MathML attributes are inter-dependent and row/colspan can affect the table,
|
||||||
// it is safer (albeit grossly suboptimal) to just relayout the whole thing.
|
// it is safer (albeit grossly suboptimal) to just relayout the whole thing.
|
||||||
|
|
@ -191,14 +183,10 @@ class nsMathMLmtrFrame final : public nsTableRowFrame {
|
||||||
RestyleTable();
|
RestyleTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsTableRowFrame::IsFrameOfType(aFlags & ~(nsIFrame::eMathML));
|
|
||||||
}
|
|
||||||
|
|
||||||
// helper to restyle and reflow the table -- @see nsMathMLmtableFrame.
|
// helper to restyle and reflow the table -- @see nsMathMLmtableFrame.
|
||||||
void RestyleTable() {
|
void RestyleTable() {
|
||||||
nsTableFrame* tableFrame = GetTableFrame();
|
nsTableFrame* tableFrame = GetTableFrame();
|
||||||
if (tableFrame && tableFrame->IsFrameOfType(nsIFrame::eMathML)) {
|
if (tableFrame && tableFrame->IsMathMLFrame()) {
|
||||||
// relayout the table
|
// relayout the table
|
||||||
((nsMathMLmtableFrame*)tableFrame)->RestyleTable();
|
((nsMathMLmtableFrame*)tableFrame)->RestyleTable();
|
||||||
}
|
}
|
||||||
|
|
@ -234,10 +222,6 @@ class nsMathMLmtdFrame final : public nsTableCellFrame {
|
||||||
mozilla::nsDisplayListBuilder* aBuilder,
|
mozilla::nsDisplayListBuilder* aBuilder,
|
||||||
const mozilla::nsDisplayListSet& aLists) override;
|
const mozilla::nsDisplayListSet& aLists) override;
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsTableCellFrame::IsFrameOfType(aFlags & ~(nsIFrame::eMathML));
|
|
||||||
}
|
|
||||||
|
|
||||||
LogicalMargin GetBorderWidth(WritingMode aWM) const override;
|
LogicalMargin GetBorderWidth(WritingMode aWM) const override;
|
||||||
|
|
||||||
nsMargin GetBorderOverflow() override;
|
nsMargin GetBorderOverflow() override;
|
||||||
|
|
@ -274,10 +258,6 @@ class nsMathMLmtdInnerFrame final : public nsBlockFrame, public nsMathMLFrame {
|
||||||
const ReflowInput& aReflowInput,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return nsBlockFrame::IsFrameOfType(aFlags & ~nsIFrame::eMathML);
|
|
||||||
}
|
|
||||||
|
|
||||||
const nsStyleText* StyleTextForLineLayout() override;
|
const nsStyleText* StyleTextForLineLayout() override;
|
||||||
void DidSetComputedStyle(ComputedStyle* aOldComputedStyle) override;
|
void DidSetComputedStyle(ComputedStyle* aOldComputedStyle) override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -339,8 +339,7 @@ struct InlineBackgroundData {
|
||||||
if (mBidiEnabled) {
|
if (mBidiEnabled) {
|
||||||
// Find the line container frame
|
// Find the line container frame
|
||||||
mLineContainer = aFrame;
|
mLineContainer = aFrame;
|
||||||
while (mLineContainer &&
|
while (mLineContainer && mLineContainer->IsLineParticipant()) {
|
||||||
mLineContainer->IsFrameOfType(nsIFrame::eLineParticipant)) {
|
|
||||||
mLineContainer = mLineContainer->GetParent();
|
mLineContainer = mLineContainer->GetParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2910,8 +2910,7 @@ nsDisplayBackgroundImage::nsDisplayBackgroundImage(
|
||||||
if (mBackgroundStyle && mBackgroundStyle != mFrame->Style()) {
|
if (mBackgroundStyle && mBackgroundStyle != mFrame->Style()) {
|
||||||
// If this changes, then you also need to adjust css::ImageLoader to
|
// If this changes, then you also need to adjust css::ImageLoader to
|
||||||
// invalidate mFrame as needed.
|
// invalidate mFrame as needed.
|
||||||
MOZ_ASSERT(mFrame->IsCanvasFrame() ||
|
MOZ_ASSERT(mFrame->IsCanvasFrame() || mFrame->IsTablePart());
|
||||||
mFrame->IsFrameOfType(nsIFrame::eTablePart));
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -171,12 +171,11 @@ bool nsImageRenderer::PrepareImage() {
|
||||||
paintElement ? paintElement->GetPrimaryFrame() : nullptr;
|
paintElement ? paintElement->GetPrimaryFrame() : nullptr;
|
||||||
// If there's no referenced frame, or the referenced frame is
|
// If there's no referenced frame, or the referenced frame is
|
||||||
// non-displayable SVG, then we have nothing valid to paint.
|
// non-displayable SVG, then we have nothing valid to paint.
|
||||||
if (!paintServerFrame ||
|
if (!paintServerFrame || (paintServerFrame->IsSVGFrame() &&
|
||||||
(paintServerFrame->IsFrameOfType(nsIFrame::eSVG) &&
|
!static_cast<SVGPaintServerFrame*>(
|
||||||
!static_cast<SVGPaintServerFrame*>(
|
do_QueryFrame(paintServerFrame)) &&
|
||||||
do_QueryFrame(paintServerFrame)) &&
|
!static_cast<ISVGDisplayableFrame*>(
|
||||||
!static_cast<ISVGDisplayableFrame*>(
|
do_QueryFrame(paintServerFrame)))) {
|
||||||
do_QueryFrame(paintServerFrame)))) {
|
|
||||||
mPrepareResult = ImgDrawResult::BAD_IMAGE;
|
mPrepareResult = ImgDrawResult::BAD_IMAGE;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -238,7 +237,7 @@ CSSSizeOrRatio nsImageRenderer::ComputeIntrinsicSize() {
|
||||||
// when fixing this!
|
// when fixing this!
|
||||||
if (mPaintServerFrame) {
|
if (mPaintServerFrame) {
|
||||||
// SVG images have no intrinsic size
|
// SVG images have no intrinsic size
|
||||||
if (!mPaintServerFrame->IsFrameOfType(nsIFrame::eSVG)) {
|
if (!mPaintServerFrame->IsSVGFrame()) {
|
||||||
// The intrinsic image size for a generic nsIFrame paint server is
|
// The intrinsic image size for a generic nsIFrame paint server is
|
||||||
// the union of the border-box rects of all of its continuations,
|
// the union of the border-box rects of all of its continuations,
|
||||||
// rounded to device pixels.
|
// rounded to device pixels.
|
||||||
|
|
|
||||||
|
|
@ -106,11 +106,11 @@ bool ComputedStyle::IsFixedPosContainingBlock(
|
||||||
}
|
}
|
||||||
const auto& disp = *StyleDisplay();
|
const auto& disp = *StyleDisplay();
|
||||||
if (disp.IsFixedPosContainingBlockForContainLayoutAndPaintSupportingFrames() &&
|
if (disp.IsFixedPosContainingBlockForContainLayoutAndPaintSupportingFrames() &&
|
||||||
aContextFrame->IsFrameOfType(nsIFrame::eSupportsContainLayoutAndPaint)) {
|
aContextFrame->SupportsContainLayoutAndPaint()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (disp.IsFixedPosContainingBlockForTransformSupportingFrames() &&
|
if (disp.IsFixedPosContainingBlockForTransformSupportingFrames() &&
|
||||||
aContextFrame->IsFrameOfType(nsIFrame::eSupportsCSSTransforms)) {
|
aContextFrame->SupportsCSSTransforms()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -520,7 +520,7 @@ static void InvalidateImages(nsIFrame* aFrame, imgIRequest* aRequest,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aFrame->IsFrameOfType(nsIFrame::eTablePart)) {
|
if (aFrame->IsTablePart()) {
|
||||||
// Tables don't necessarily build border/background display items
|
// Tables don't necessarily build border/background display items
|
||||||
// for the individual table part frames, so IterateRetainedDataFor
|
// for the individual table part frames, so IterateRetainedDataFor
|
||||||
// might not find the right display item.
|
// might not find the right display item.
|
||||||
|
|
|
||||||
|
|
@ -881,8 +881,7 @@ bool nsComputedDOMStyle::NeedsToFlushStyle(nsCSSPropertyID aPropID) const {
|
||||||
static bool IsNonReplacedInline(nsIFrame* aFrame) {
|
static bool IsNonReplacedInline(nsIFrame* aFrame) {
|
||||||
// FIXME: this should be IsInlineInsideStyle() since width/height
|
// FIXME: this should be IsInlineInsideStyle() since width/height
|
||||||
// doesn't apply to ruby boxes.
|
// doesn't apply to ruby boxes.
|
||||||
return aFrame->StyleDisplay()->IsInlineFlow() &&
|
return aFrame->StyleDisplay()->IsInlineFlow() && !aFrame->IsReplaced() &&
|
||||||
!aFrame->IsFrameOfType(nsIFrame::eReplaced) &&
|
|
||||||
!aFrame->IsFieldSetFrame() && !aFrame->IsBlockFrame() &&
|
!aFrame->IsFieldSetFrame() && !aFrame->IsBlockFrame() &&
|
||||||
!aFrame->IsScrollFrame() && !aFrame->IsColumnSetWrapperFrame();
|
!aFrame->IsScrollFrame() && !aFrame->IsColumnSetWrapperFrame();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ static FontUsageKind FrameFontUsage(nsIFrame* aFrame,
|
||||||
// TODO(emilio): Can we use the restyle-hint machinery instead of this?
|
// TODO(emilio): Can we use the restyle-hint machinery instead of this?
|
||||||
static void ScheduleReflow(PresShell* aPresShell, nsIFrame* aFrame) {
|
static void ScheduleReflow(PresShell* aPresShell, nsIFrame* aFrame) {
|
||||||
nsIFrame* f = aFrame;
|
nsIFrame* f = aFrame;
|
||||||
if (f->IsFrameOfType(nsIFrame::eSVG) || f->IsInSVGTextSubtree()) {
|
if (f->IsSVGFrame() || f->IsInSVGTextSubtree()) {
|
||||||
// SVG frames (and the non-SVG descendants of an SVGTextFrame) need special
|
// SVG frames (and the non-SVG descendants of an SVGTextFrame) need special
|
||||||
// reflow handling. We need to search upwards for the first displayed
|
// reflow handling. We need to search upwards for the first displayed
|
||||||
// SVGOuterSVGFrame or non-SVG frame, which is the frame we can call
|
// SVGOuterSVGFrame or non-SVG frame, which is the frame we can call
|
||||||
|
|
|
||||||
|
|
@ -3496,8 +3496,7 @@ bool nsStyleDisplay::PrecludesSizeContainmentOrContentVisibilityWithFrame(
|
||||||
const nsIFrame& aFrame) const {
|
const nsIFrame& aFrame) const {
|
||||||
// Note: The spec for size containment says it should have no effect on
|
// Note: The spec for size containment says it should have no effect on
|
||||||
// non-atomic, inline-level boxes.
|
// non-atomic, inline-level boxes.
|
||||||
bool isNonReplacedInline = aFrame.IsFrameOfType(nsIFrame::eLineParticipant) &&
|
bool isNonReplacedInline = aFrame.IsLineParticipant() && !aFrame.IsReplaced();
|
||||||
!aFrame.IsFrameOfType(nsIFrame::eReplaced);
|
|
||||||
return isNonReplacedInline || IsInternalRubyDisplayType() ||
|
return isNonReplacedInline || IsInternalRubyDisplayType() ||
|
||||||
DisplayInside() == mozilla::StyleDisplayInside::Table ||
|
DisplayInside() == mozilla::StyleDisplayInside::Table ||
|
||||||
IsInnerTableStyle();
|
IsInnerTableStyle();
|
||||||
|
|
|
||||||
|
|
@ -77,14 +77,12 @@ bool nsStyleDisplay::IsFloating(const nsIFrame* aContextFrame) const {
|
||||||
bool nsStyleDisplay::HasTransform(const nsIFrame* aContextFrame) const {
|
bool nsStyleDisplay::HasTransform(const nsIFrame* aContextFrame) const {
|
||||||
NS_ASSERTION(aContextFrame->StyleDisplay() == this,
|
NS_ASSERTION(aContextFrame->StyleDisplay() == this,
|
||||||
"unexpected aContextFrame");
|
"unexpected aContextFrame");
|
||||||
return HasTransformStyle() &&
|
return HasTransformStyle() && aContextFrame->SupportsCSSTransforms();
|
||||||
aContextFrame->IsFrameOfType(nsIFrame::eSupportsCSSTransforms);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool nsStyleDisplay::HasPerspective(const nsIFrame* aContextFrame) const {
|
bool nsStyleDisplay::HasPerspective(const nsIFrame* aContextFrame) const {
|
||||||
MOZ_ASSERT(aContextFrame->StyleDisplay() == this, "unexpected aContextFrame");
|
MOZ_ASSERT(aContextFrame->StyleDisplay() == this, "unexpected aContextFrame");
|
||||||
return HasPerspectiveStyle() &&
|
return HasPerspectiveStyle() && aContextFrame->SupportsCSSTransforms();
|
||||||
aContextFrame->IsFrameOfType(nsIFrame::eSupportsCSSTransforms);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool nsStyleDisplay::
|
bool nsStyleDisplay::
|
||||||
|
|
|
||||||
|
|
@ -105,19 +105,17 @@ void SVGContainerFrame::ReflowSVGNonDisplayText(nsIFrame* aContainer) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MOZ_ASSERT(aContainer->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY) ||
|
MOZ_ASSERT(aContainer->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY) ||
|
||||||
!aContainer->IsFrameOfType(nsIFrame::eSVG),
|
!aContainer->IsSVGFrame(),
|
||||||
"it is wasteful to call ReflowSVGNonDisplayText on a container "
|
"it is wasteful to call ReflowSVGNonDisplayText on a container "
|
||||||
"frame that is not NS_FRAME_IS_NONDISPLAY or not SVG");
|
"frame that is not NS_FRAME_IS_NONDISPLAY or not SVG");
|
||||||
for (nsIFrame* kid : aContainer->PrincipalChildList()) {
|
for (nsIFrame* kid : aContainer->PrincipalChildList()) {
|
||||||
LayoutFrameType type = kid->Type();
|
LayoutFrameType type = kid->Type();
|
||||||
if (type == LayoutFrameType::SVGText) {
|
if (type == LayoutFrameType::SVGText) {
|
||||||
static_cast<SVGTextFrame*>(kid)->ReflowSVGNonDisplayText();
|
static_cast<SVGTextFrame*>(kid)->ReflowSVGNonDisplayText();
|
||||||
} else {
|
} else if (kid->IsSVGContainerFrame() ||
|
||||||
if (kid->IsFrameOfType(nsIFrame::eSVG | nsIFrame::eSVGContainer) ||
|
type == LayoutFrameType::SVGForeignObject ||
|
||||||
type == LayoutFrameType::SVGForeignObject ||
|
!kid->IsSVGFrame()) {
|
||||||
!kid->IsFrameOfType(nsIFrame::eSVG)) {
|
ReflowSVGNonDisplayText(kid);
|
||||||
ReflowSVGNonDisplayText(kid);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -348,8 +346,7 @@ void SVGDisplayContainerFrame::ReflowSVG() {
|
||||||
// SVGTextFrames. We need to cause those to get reflowed in
|
// SVGTextFrames. We need to cause those to get reflowed in
|
||||||
// case they are the target of a rendering observer.
|
// case they are the target of a rendering observer.
|
||||||
MOZ_ASSERT(
|
MOZ_ASSERT(
|
||||||
kid->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY) ||
|
kid->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY) || !kid->IsSVGFrame(),
|
||||||
!kid->IsFrameOfType(nsIFrame::eSVG),
|
|
||||||
"expected kid to be a NS_FRAME_IS_NONDISPLAY frame or not SVG");
|
"expected kid to be a NS_FRAME_IS_NONDISPLAY frame or not SVG");
|
||||||
if (kid->HasAnyStateBits(NS_FRAME_IS_DIRTY)) {
|
if (kid->HasAnyStateBits(NS_FRAME_IS_DIRTY)) {
|
||||||
SVGContainerFrame* container = do_QueryFrame(kid);
|
SVGContainerFrame* container = do_QueryFrame(kid);
|
||||||
|
|
|
||||||
|
|
@ -78,15 +78,6 @@ class SVGContainerFrame : public nsContainerFrame {
|
||||||
nsFrameList&& aFrameList) override;
|
nsFrameList&& aFrameList) override;
|
||||||
void RemoveFrame(DestroyContext&, ChildListID, nsIFrame*) override;
|
void RemoveFrame(DestroyContext&, ChildListID, nsIFrame*) override;
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
if (aFlags & eSupportsContainLayoutAndPaint) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsContainerFrame::IsFrameOfType(
|
|
||||||
aFlags & ~(nsIFrame::eSVG | nsIFrame::eSVGContainer));
|
|
||||||
}
|
|
||||||
|
|
||||||
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists) override {}
|
const nsDisplayListSet& aLists) override {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,14 +38,6 @@ class SVGFEContainerFrame final : public nsContainerFrame {
|
||||||
public:
|
public:
|
||||||
NS_DECL_FRAMEARENA_HELPERS(SVGFEContainerFrame)
|
NS_DECL_FRAMEARENA_HELPERS(SVGFEContainerFrame)
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
if (aFlags & eSupportsContainLayoutAndPaint) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsContainerFrame::IsFrameOfType(aFlags & ~nsIFrame::eSVG);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
nsresult GetFrameName(nsAString& aResult) const override {
|
nsresult GetFrameName(nsAString& aResult) const override {
|
||||||
return MakeFrameName(u"SVGFEContainer"_ns, aResult);
|
return MakeFrameName(u"SVGFEContainer"_ns, aResult);
|
||||||
|
|
|
||||||
|
|
@ -44,14 +44,6 @@ class SVGFEImageFrame final : public nsIFrame {
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
void Destroy(DestroyContext&) override;
|
void Destroy(DestroyContext&) override;
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
if (aFlags & eSupportsContainLayoutAndPaint) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsIFrame::IsFrameOfType(aFlags & ~(nsIFrame::eSVG));
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
nsresult GetFrameName(nsAString& aResult) const override {
|
nsresult GetFrameName(nsAString& aResult) const override {
|
||||||
return MakeFrameName(u"SVGFEImage"_ns, aResult);
|
return MakeFrameName(u"SVGFEImage"_ns, aResult);
|
||||||
|
|
|
||||||
|
|
@ -41,14 +41,6 @@ class SVGFELeafFrame final : public nsIFrame {
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
if (aFlags & eSupportsContainLayoutAndPaint) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsIFrame::IsFrameOfType(aFlags & ~(nsIFrame::eSVG));
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
nsresult GetFrameName(nsAString& aResult) const override {
|
nsresult GetFrameName(nsAString& aResult) const override {
|
||||||
return MakeFrameName(u"SVGFELeaf"_ns, aResult);
|
return MakeFrameName(u"SVGFELeaf"_ns, aResult);
|
||||||
|
|
|
||||||
|
|
@ -34,14 +34,6 @@ class SVGFEUnstyledLeafFrame final : public nsIFrame {
|
||||||
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists) override {}
|
const nsDisplayListSet& aLists) override {}
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
if (aFlags & eSupportsContainLayoutAndPaint) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsIFrame::IsFrameOfType(aFlags & ~(nsIFrame::eSVG));
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
nsresult GetFrameName(nsAString& aResult) const override {
|
nsresult GetFrameName(nsAString& aResult) const override {
|
||||||
return MakeFrameName(u"SVGFEUnstyledLeaf"_ns, aResult);
|
return MakeFrameName(u"SVGFEUnstyledLeaf"_ns, aResult);
|
||||||
|
|
|
||||||
|
|
@ -50,14 +50,6 @@ class SVGForeignObjectFrame final : public nsContainerFrame,
|
||||||
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists) override;
|
const nsDisplayListSet& aLists) override;
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
if (aFlags & eSupportsContainLayoutAndPaint) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsContainerFrame::IsFrameOfType(aFlags & ~nsIFrame::eSVG);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsSVGTransformed(Matrix* aOwnTransform,
|
bool IsSVGTransformed(Matrix* aOwnTransform,
|
||||||
Matrix* aFromParentTransform) const override;
|
Matrix* aFromParentTransform) const override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,14 +65,6 @@ class SVGGeometryFrame final : public nsIFrame, public ISVGDisplayableFrame {
|
||||||
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
if (aFlags & eSupportsContainLayoutAndPaint) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsIFrame::IsFrameOfType(aFlags & ~nsIFrame::eSVG);
|
|
||||||
}
|
|
||||||
|
|
||||||
nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
||||||
int32_t aModType) override;
|
int32_t aModType) override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,14 +72,6 @@ class SVGImageFrame final : public nsIFrame,
|
||||||
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists) override;
|
const nsDisplayListSet& aLists) override;
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
if (aFlags & eSupportsContainLayoutAndPaint) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsIFrame::IsFrameOfType(aFlags & ~nsIFrame::eSVG);
|
|
||||||
}
|
|
||||||
|
|
||||||
nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
||||||
int32_t aModType) override;
|
int32_t aModType) override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ static EffectOffsets ComputeEffectOffset(
|
||||||
result.offsetToBoundingBox =
|
result.offsetToBoundingBox =
|
||||||
aParams.builder->ToReferenceFrame(aFrame) -
|
aParams.builder->ToReferenceFrame(aFrame) -
|
||||||
SVGIntegrationUtils::GetOffsetToBoundingBox(aFrame);
|
SVGIntegrationUtils::GetOffsetToBoundingBox(aFrame);
|
||||||
if (!aFrame->IsFrameOfType(nsIFrame::eSVG)) {
|
if (!aFrame->IsSVGFrame()) {
|
||||||
/* Snap the offset if the reference frame is not a SVG frame,
|
/* Snap the offset if the reference frame is not a SVG frame,
|
||||||
* since other frames will be snapped to pixel when rendering. */
|
* since other frames will be snapped to pixel when rendering. */
|
||||||
result.offsetToBoundingBox =
|
result.offsetToBoundingBox =
|
||||||
|
|
@ -263,8 +263,7 @@ gfxPoint SVGIntegrationUtils::GetOffsetToUserSpaceInDevPx(
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
nsSize SVGIntegrationUtils::GetContinuationUnionSize(nsIFrame* aNonSVGFrame) {
|
nsSize SVGIntegrationUtils::GetContinuationUnionSize(nsIFrame* aNonSVGFrame) {
|
||||||
NS_ASSERTION(!aNonSVGFrame->IsFrameOfType(nsIFrame::eSVG),
|
NS_ASSERTION(!aNonSVGFrame->IsSVGFrame(), "SVG frames should not get here");
|
||||||
"SVG frames should not get here");
|
|
||||||
nsIFrame* firstFrame =
|
nsIFrame* firstFrame =
|
||||||
nsLayoutUtils::FirstContinuationOrIBSplitSibling(aNonSVGFrame);
|
nsLayoutUtils::FirstContinuationOrIBSplitSibling(aNonSVGFrame);
|
||||||
return nsLayoutUtils::GetAllInFlowRectsUnion(firstFrame, firstFrame).Size();
|
return nsLayoutUtils::GetAllInFlowRectsUnion(firstFrame, firstFrame).Size();
|
||||||
|
|
@ -272,8 +271,7 @@ nsSize SVGIntegrationUtils::GetContinuationUnionSize(nsIFrame* aNonSVGFrame) {
|
||||||
|
|
||||||
/* static */ gfx::Size SVGIntegrationUtils::GetSVGCoordContextForNonSVGFrame(
|
/* static */ gfx::Size SVGIntegrationUtils::GetSVGCoordContextForNonSVGFrame(
|
||||||
nsIFrame* aNonSVGFrame) {
|
nsIFrame* aNonSVGFrame) {
|
||||||
NS_ASSERTION(!aNonSVGFrame->IsFrameOfType(nsIFrame::eSVG),
|
NS_ASSERTION(!aNonSVGFrame->IsSVGFrame(), "SVG frames should not get here");
|
||||||
"SVG frames should not get here");
|
|
||||||
nsIFrame* firstFrame =
|
nsIFrame* firstFrame =
|
||||||
nsLayoutUtils::FirstContinuationOrIBSplitSibling(aNonSVGFrame);
|
nsLayoutUtils::FirstContinuationOrIBSplitSibling(aNonSVGFrame);
|
||||||
nsRect r = nsLayoutUtils::GetAllInFlowRectsUnion(firstFrame, firstFrame);
|
nsRect r = nsLayoutUtils::GetAllInFlowRectsUnion(firstFrame, firstFrame);
|
||||||
|
|
@ -1193,7 +1191,7 @@ already_AddRefed<gfxDrawable> SVGIntegrationUtils::DrawableFromPaintServer(
|
||||||
return drawable.forget();
|
return drawable.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aFrame->IsFrameOfType(nsIFrame::eSVG) &&
|
if (aFrame->IsSVGFrame() &&
|
||||||
!static_cast<ISVGDisplayableFrame*>(do_QueryFrame(aFrame))) {
|
!static_cast<ISVGDisplayableFrame*>(do_QueryFrame(aFrame))) {
|
||||||
MOZ_ASSERT_UNREACHABLE(
|
MOZ_ASSERT_UNREACHABLE(
|
||||||
"We should prevent painting of unpaintable SVG "
|
"We should prevent painting of unpaintable SVG "
|
||||||
|
|
|
||||||
|
|
@ -527,9 +527,8 @@ void SVGTextPathObserver::OnRenderingChange() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(
|
MOZ_ASSERT(frame->IsSVGFrame() || frame->IsInSVGTextSubtree(),
|
||||||
frame->IsFrameOfType(nsIFrame::eSVG) || frame->IsInSVGTextSubtree(),
|
"SVG frame expected");
|
||||||
"SVG frame expected");
|
|
||||||
|
|
||||||
MOZ_ASSERT(frame->GetContent()->IsSVGElement(nsGkAtoms::textPath),
|
MOZ_ASSERT(frame->GetContent()->IsSVGElement(nsGkAtoms::textPath),
|
||||||
"expected frame for a <textPath> element");
|
"expected frame for a <textPath> element");
|
||||||
|
|
@ -601,7 +600,7 @@ void SVGMarkerObserver::OnRenderingChange() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(frame->IsFrameOfType(nsIFrame::eSVG), "SVG frame expected");
|
MOZ_ASSERT(frame->IsSVGFrame(), "SVG frame expected");
|
||||||
|
|
||||||
// Don't need to request ReflowFrame if we're being reflowed.
|
// Don't need to request ReflowFrame if we're being reflowed.
|
||||||
// Because mRect for SVG frames includes the bounds of any markers
|
// Because mRect for SVG frames includes the bounds of any markers
|
||||||
|
|
@ -1814,8 +1813,8 @@ void SVGObserverUtils::InvalidateRenderingObservers(nsIFrame* aFrame) {
|
||||||
|
|
||||||
// Check ancestor SVG containers. The root frame cannot be of type
|
// Check ancestor SVG containers. The root frame cannot be of type
|
||||||
// eSVGContainer so we don't have to check f for null here.
|
// eSVGContainer so we don't have to check f for null here.
|
||||||
for (nsIFrame* f = aFrame->GetParent();
|
for (nsIFrame* f = aFrame->GetParent(); f->IsSVGContainerFrame();
|
||||||
f->IsFrameOfType(nsIFrame::eSVGContainer); f = f->GetParent()) {
|
f = f->GetParent()) {
|
||||||
if (auto* element = Element::FromNode(f->GetContent())) {
|
if (auto* element = Element::FromNode(f->GetContent())) {
|
||||||
if (auto* observers = GetObserverSet(element)) {
|
if (auto* observers = GetObserverSet(element)) {
|
||||||
observers->InvalidateAll();
|
observers->InvalidateAll();
|
||||||
|
|
|
||||||
|
|
@ -74,12 +74,6 @@ class SVGOuterSVGFrame final : public SVGDisplayContainerFrame,
|
||||||
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
return SVGDisplayContainerFrame::IsFrameOfType(
|
|
||||||
aFlags &
|
|
||||||
~(eSupportsContainLayoutAndPaint | eReplaced | eReplacedSizing));
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
nsresult GetFrameName(nsAString& aResult) const override {
|
nsresult GetFrameName(nsAString& aResult) const override {
|
||||||
return MakeFrameName(u"SVGOuterSVG"_ns, aResult);
|
return MakeFrameName(u"SVGOuterSVG"_ns, aResult);
|
||||||
|
|
|
||||||
|
|
@ -47,14 +47,6 @@ class SVGStopFrame : public nsIFrame {
|
||||||
nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
||||||
int32_t aModType) override;
|
int32_t aModType) override;
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
if (aFlags & eSupportsContainLayoutAndPaint) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsIFrame::IsFrameOfType(aFlags & ~(nsIFrame::eSVG));
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
nsresult GetFrameName(nsAString& aResult) const override {
|
nsresult GetFrameName(nsAString& aResult) const override {
|
||||||
return MakeFrameName(u"SVGStop"_ns, aResult);
|
return MakeFrameName(u"SVGStop"_ns, aResult);
|
||||||
|
|
|
||||||
|
|
@ -119,10 +119,9 @@ nsIFrame* SVGSwitchFrame::GetFrameForPoint(const gfxPoint& aPoint) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool shouldReflowSVGTextFrameInside(nsIFrame* aFrame) {
|
static bool ShouldReflowSVGTextFrameInside(nsIFrame* aFrame) {
|
||||||
return aFrame->IsFrameOfType(nsIFrame::eSVG | nsIFrame::eSVGContainer) ||
|
return aFrame->IsSVGContainerFrame() || aFrame->IsSVGForeignObjectFrame() ||
|
||||||
aFrame->IsSVGForeignObjectFrame() ||
|
!aFrame->IsSVGFrame();
|
||||||
!aFrame->IsFrameOfType(nsIFrame::eSVG);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SVGSwitchFrame::AlwaysReflowSVGTextFrameDoForOneKid(nsIFrame* aKid) {
|
void SVGSwitchFrame::AlwaysReflowSVGTextFrameDoForOneKid(nsIFrame* aKid) {
|
||||||
|
|
@ -135,7 +134,7 @@ void SVGSwitchFrame::AlwaysReflowSVGTextFrameDoForOneKid(nsIFrame* aKid) {
|
||||||
"A non-display SVGTextFrame directly contained in a display "
|
"A non-display SVGTextFrame directly contained in a display "
|
||||||
"container?");
|
"container?");
|
||||||
static_cast<SVGTextFrame*>(aKid)->ReflowSVG();
|
static_cast<SVGTextFrame*>(aKid)->ReflowSVG();
|
||||||
} else if (shouldReflowSVGTextFrameInside(aKid)) {
|
} else if (ShouldReflowSVGTextFrameInside(aKid)) {
|
||||||
if (!aKid->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY)) {
|
if (!aKid->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY)) {
|
||||||
for (nsIFrame* kid : aKid->PrincipalChildList()) {
|
for (nsIFrame* kid : aKid->PrincipalChildList()) {
|
||||||
AlwaysReflowSVGTextFrameDoForOneKid(kid);
|
AlwaysReflowSVGTextFrameDoForOneKid(kid);
|
||||||
|
|
@ -205,10 +204,10 @@ void SVGSwitchFrame::ReflowSVG() {
|
||||||
// nsLayoutUtils::UnionChildOverflow since SVG frame's all use the same
|
// nsLayoutUtils::UnionChildOverflow since SVG frame's all use the same
|
||||||
// frame list, and we're iterating over that list now anyway.
|
// frame list, and we're iterating over that list now anyway.
|
||||||
ConsiderChildOverflow(overflowRects, child);
|
ConsiderChildOverflow(overflowRects, child);
|
||||||
} else if (child && shouldReflowSVGTextFrameInside(child)) {
|
} else if (child && ShouldReflowSVGTextFrameInside(child)) {
|
||||||
MOZ_ASSERT(child->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY) ||
|
MOZ_ASSERT(
|
||||||
!child->IsFrameOfType(nsIFrame::eSVG),
|
child->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY) || !child->IsSVGFrame(),
|
||||||
"Check for this explicitly in the |if|, then");
|
"Check for this explicitly in the |if|, then");
|
||||||
ReflowSVGNonDisplayText(child);
|
ReflowSVGNonDisplayText(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ bool SVGUtils::AnyOuterSVGIsCallingReflowSVG(nsIFrame* aFrame) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SVGUtils::ScheduleReflowSVG(nsIFrame* aFrame) {
|
void SVGUtils::ScheduleReflowSVG(nsIFrame* aFrame) {
|
||||||
MOZ_ASSERT(aFrame->IsFrameOfType(nsIFrame::eSVG), "Passed bad frame!");
|
MOZ_ASSERT(aFrame->IsSVGFrame(), "Passed bad frame!");
|
||||||
|
|
||||||
// If this is triggered, the callers should be fixed to call us before
|
// If this is triggered, the callers should be fixed to call us before
|
||||||
// ReflowSVG is called. If we try to mark dirty bits on frames while we're
|
// ReflowSVG is called. If we try to mark dirty bits on frames while we're
|
||||||
|
|
@ -183,8 +183,7 @@ void SVGUtils::ScheduleReflowSVG(nsIFrame* aFrame) {
|
||||||
}
|
}
|
||||||
f->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
f->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||||
f = f->GetParent();
|
f = f->GetParent();
|
||||||
MOZ_ASSERT(f->IsFrameOfType(nsIFrame::eSVG),
|
MOZ_ASSERT(f->IsSVGFrame(), "IsSVGOuterSVGFrame check above not valid!");
|
||||||
"IsSVGOuterSVGFrame check above not valid!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
outerSVGFrame = static_cast<SVGOuterSVGFrame*>(f);
|
outerSVGFrame = static_cast<SVGOuterSVGFrame*>(f);
|
||||||
|
|
@ -209,8 +208,7 @@ void SVGUtils::ScheduleReflowSVG(nsIFrame* aFrame) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SVGUtils::NeedsReflowSVG(const nsIFrame* aFrame) {
|
bool SVGUtils::NeedsReflowSVG(const nsIFrame* aFrame) {
|
||||||
MOZ_ASSERT(aFrame->IsFrameOfType(nsIFrame::eSVG),
|
MOZ_ASSERT(aFrame->IsSVGFrame(), "SVG uses bits differently!");
|
||||||
"SVG uses bits differently!");
|
|
||||||
|
|
||||||
// The flags we test here may change, hence why we have this separate
|
// The flags we test here may change, hence why we have this separate
|
||||||
// function.
|
// function.
|
||||||
|
|
@ -342,7 +340,7 @@ gfxMatrix SVGUtils::GetCanvasTM(nsIFrame* aFrame) {
|
||||||
return containerFrame->GetCanvasTM();
|
return containerFrame->GetCanvasTM();
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(aFrame->GetParent()->IsFrameOfType(nsIFrame::eSVGContainer));
|
MOZ_ASSERT(aFrame->GetParent()->IsSVGContainerFrame());
|
||||||
|
|
||||||
auto* parent = static_cast<SVGContainerFrame*>(aFrame->GetParent());
|
auto* parent = static_cast<SVGContainerFrame*>(aFrame->GetParent());
|
||||||
auto* content = static_cast<SVGElement*>(aFrame->GetContent());
|
auto* content = static_cast<SVGElement*>(aFrame->GetContent());
|
||||||
|
|
@ -383,12 +381,11 @@ void SVGUtils::NotifyChildrenOfSVGChange(nsIFrame* aFrame, uint32_t aFlags) {
|
||||||
if (SVGFrame) {
|
if (SVGFrame) {
|
||||||
SVGFrame->NotifySVGChanged(aFlags);
|
SVGFrame->NotifySVGChanged(aFlags);
|
||||||
} else {
|
} else {
|
||||||
NS_ASSERTION(
|
NS_ASSERTION(kid->IsSVGFrame() || kid->IsInSVGTextSubtree(),
|
||||||
kid->IsFrameOfType(nsIFrame::eSVG) || kid->IsInSVGTextSubtree(),
|
"SVG frame expected");
|
||||||
"SVG frame expected");
|
|
||||||
// recurse into the children of container frames e.g. <clipPath>, <mask>
|
// recurse into the children of container frames e.g. <clipPath>, <mask>
|
||||||
// in case they have child frames with transformation matrices
|
// in case they have child frames with transformation matrices
|
||||||
if (kid->IsFrameOfType(nsIFrame::eSVG)) {
|
if (kid->IsSVGFrame()) {
|
||||||
NotifyChildrenOfSVGChange(kid, aFlags);
|
NotifyChildrenOfSVGChange(kid, aFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,14 +44,6 @@ class SVGViewFrame final : public nsIFrame {
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
if (aFlags & eSupportsContainLayoutAndPaint) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsIFrame::IsFrameOfType(aFlags & ~(nsIFrame::eSVG));
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
nsresult GetFrameName(nsAString& aResult) const override {
|
nsresult GetFrameName(nsAString& aResult) const override {
|
||||||
return MakeFrameName(u"SVGView"_ns, aResult);
|
return MakeFrameName(u"SVGView"_ns, aResult);
|
||||||
|
|
|
||||||
|
|
@ -225,14 +225,6 @@ class nsTableCellFrame : public nsContainerFrame,
|
||||||
|
|
||||||
bool ComputeCustomOverflow(mozilla::OverflowAreas& aOverflowAreas) override;
|
bool ComputeCustomOverflow(mozilla::OverflowAreas& aOverflowAreas) override;
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
if (aFlags & eSupportsAspectRatio) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsContainerFrame::IsFrameOfType(aFlags & ~(nsIFrame::eTablePart));
|
|
||||||
}
|
|
||||||
|
|
||||||
void InvalidateFrame(uint32_t aDisplayItemKey = 0,
|
void InvalidateFrame(uint32_t aDisplayItemKey = 0,
|
||||||
bool aRebuildDisplayItems = true) override;
|
bool aRebuildDisplayItems = true) override;
|
||||||
void InvalidateFrameWithRect(const nsRect& aRect,
|
void InvalidateFrameWithRect(const nsRect& aRect,
|
||||||
|
|
|
||||||
|
|
@ -260,14 +260,6 @@ class nsTableColFrame final : public nsSplittableFrame {
|
||||||
void SetFinalISize(nscoord aFinalISize) { mFinalISize = aFinalISize; }
|
void SetFinalISize(nscoord aFinalISize) { mFinalISize = aFinalISize; }
|
||||||
nscoord GetFinalISize() { return mFinalISize; }
|
nscoord GetFinalISize() { return mFinalISize; }
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
||||||
if (aFlags & (eSupportsContainLayoutAndPaint | eSupportsAspectRatio)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsSplittableFrame::IsFrameOfType(aFlags & ~(nsIFrame::eTablePart));
|
|
||||||
}
|
|
||||||
|
|
||||||
void InvalidateFrame(uint32_t aDisplayItemKey = 0,
|
void InvalidateFrame(uint32_t aDisplayItemKey = 0,
|
||||||
bool aRebuildDisplayItems = true) override;
|
bool aRebuildDisplayItems = true) override;
|
||||||
void InvalidateFrameWithRect(const nsRect& aRect,
|
void InvalidateFrameWithRect(const nsRect& aRect,
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue