From 2a8880f043420f505ab54a33f7ba3bc2cb8b6c68 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Fri, 12 Jul 2013 17:13:07 +1000 Subject: [PATCH] Bug 890782 - Part 3: Inherit NS_FRAME_IS_NONDISPLAY by default. r=jwatt --- layout/generic/nsFrame.cpp | 3 ++- layout/svg/nsSVGContainerFrame.cpp | 3 +-- layout/svg/nsSVGForeignObjectFrame.cpp | 3 +-- layout/svg/nsSVGGeometryFrame.cpp | 3 +-- layout/svg/nsSVGOuterSVGFrame.cpp | 13 ------------- layout/svg/nsSVGTextFrame2.cpp | 3 +-- 6 files changed, 6 insertions(+), 22 deletions(-) diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 2d50b19922f9..c99e64f87847 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -517,7 +517,8 @@ nsFrame::Init(nsIContent* aContent, mState |= state & (NS_FRAME_INDEPENDENT_SELECTION | NS_FRAME_GENERATED_CONTENT | NS_FRAME_IS_SVG_TEXT | - NS_FRAME_IN_POPUP); + NS_FRAME_IN_POPUP | + NS_FRAME_IS_NONDISPLAY); } const nsStyleDisplay *disp = StyleDisplay(); if (disp->HasTransform(this)) { diff --git a/layout/svg/nsSVGContainerFrame.cpp b/layout/svg/nsSVGContainerFrame.cpp index 17c51c1ba3a5..7aa7ab90c527 100644 --- a/layout/svg/nsSVGContainerFrame.cpp +++ b/layout/svg/nsSVGContainerFrame.cpp @@ -88,8 +88,7 @@ nsSVGDisplayContainerFrame::Init(nsIContent* aContent, nsIFrame* aPrevInFlow) { if (!(GetStateBits() & NS_STATE_IS_OUTER_SVG)) { - AddStateBits(aParent->GetStateBits() & - (NS_FRAME_IS_NONDISPLAY | NS_STATE_SVG_CLIPPATH_CHILD)); + AddStateBits(aParent->GetStateBits() & NS_STATE_SVG_CLIPPATH_CHILD); } nsSVGContainerFrame::Init(aContent, aParent, aPrevInFlow); } diff --git a/layout/svg/nsSVGForeignObjectFrame.cpp b/layout/svg/nsSVGForeignObjectFrame.cpp index 5b13e30db745..fd790909dbdb 100644 --- a/layout/svg/nsSVGForeignObjectFrame.cpp +++ b/layout/svg/nsSVGForeignObjectFrame.cpp @@ -61,8 +61,7 @@ nsSVGForeignObjectFrame::Init(nsIContent* aContent, "Content is not an SVG foreignObject!"); nsSVGForeignObjectFrameBase::Init(aContent, aParent, aPrevInFlow); - AddStateBits(aParent->GetStateBits() & - (NS_FRAME_IS_NONDISPLAY | NS_STATE_SVG_CLIPPATH_CHILD)); + AddStateBits(aParent->GetStateBits() & NS_STATE_SVG_CLIPPATH_CHILD); AddStateBits(NS_FRAME_FONT_INFLATION_CONTAINER | NS_FRAME_FONT_INFLATION_FLOW_ROOT); if (!(mState & NS_FRAME_IS_NONDISPLAY)) { diff --git a/layout/svg/nsSVGGeometryFrame.cpp b/layout/svg/nsSVGGeometryFrame.cpp index e5d3eeaebb8b..b0f7fe9bb0a2 100644 --- a/layout/svg/nsSVGGeometryFrame.cpp +++ b/layout/svg/nsSVGGeometryFrame.cpp @@ -24,8 +24,7 @@ nsSVGGeometryFrame::Init(nsIContent* aContent, nsIFrame* aParent, nsIFrame* aPrevInFlow) { - AddStateBits(aParent->GetStateBits() & - (NS_FRAME_IS_NONDISPLAY | NS_STATE_SVG_CLIPPATH_CHILD)); + AddStateBits(aParent->GetStateBits() & NS_STATE_SVG_CLIPPATH_CHILD); nsSVGGeometryFrameBase::Init(aContent, aParent, aPrevInFlow); } diff --git a/layout/svg/nsSVGOuterSVGFrame.cpp b/layout/svg/nsSVGOuterSVGFrame.cpp index 2c9118500ee8..aea2f60c097a 100644 --- a/layout/svg/nsSVGOuterSVGFrame.cpp +++ b/layout/svg/nsSVGOuterSVGFrame.cpp @@ -167,19 +167,6 @@ nsSVGOuterSVGFrame::Init(nsIContent* aContent, SVGSVGElement *svg = static_cast(aContent); if (!svg->PassesConditionalProcessingTests()) { AddStateBits(NS_FRAME_IS_NONDISPLAY); - } else { - // If this outer element is the child of a that - // is non-display, or is the child of a frame for HTML content that - // itself is a descendant of a non-display SVG frame, then we want to - // it non-display also. The second case is not as simple to handle - // as copying a state bit from the parent, since non-SVG frames do - // not use NS_FRAME_IS_NONDISPLAY. - for (nsIFrame* f = aParent; f; f = f->GetParent()) { - if (f->IsFrameOfType(eSVG)) { - AddStateBits(f->GetStateBits() & NS_FRAME_IS_NONDISPLAY); - break; - } - } } nsSVGOuterSVGFrameBase::Init(aContent, aParent, aPrevInFlow); diff --git a/layout/svg/nsSVGTextFrame2.cpp b/layout/svg/nsSVGTextFrame2.cpp index f6ea82e4cd91..3a2d2c5526ce 100644 --- a/layout/svg/nsSVGTextFrame2.cpp +++ b/layout/svg/nsSVGTextFrame2.cpp @@ -3023,8 +3023,7 @@ nsSVGTextFrame2::Init(nsIContent* aContent, NS_ASSERTION(aContent->IsSVG(nsGkAtoms::text), "Content is not an SVG text"); nsSVGTextFrame2Base::Init(aContent, aParent, aPrevInFlow); - AddStateBits((aParent->GetStateBits() & - (NS_FRAME_IS_NONDISPLAY | NS_STATE_SVG_CLIPPATH_CHILD)) | + AddStateBits((aParent->GetStateBits() & NS_STATE_SVG_CLIPPATH_CHILD) | NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_SVG_TEXT); mMutationObserver.StartObserving(this);