Bug 1647525 - Use HasAnyStateBits() in nsSVGContainerFrame r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D81216
This commit is contained in:
Kagami Sascha Rosylight 2020-06-27 14:15:42 +00:00
Родитель e6be47e504
Коммит ea355c9152
1 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -101,10 +101,10 @@ bool nsSVGContainerFrame::ComputeCustomOverflow(
*/
/* static */
void nsSVGContainerFrame::ReflowSVGNonDisplayText(nsIFrame* aContainer) {
if (!(aContainer->GetStateBits() & NS_FRAME_IS_DIRTY)) {
if (!aContainer->HasAnyStateBits(NS_FRAME_IS_DIRTY)) {
return;
}
NS_ASSERTION((aContainer->GetStateBits() & NS_FRAME_IS_NONDISPLAY) ||
NS_ASSERTION(aContainer->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY) ||
!aContainer->IsFrameOfType(nsIFrame::eSVG),
"it is wasteful to call ReflowSVGNonDisplayText on a container "
"frame that is not NS_FRAME_IS_NONDISPLAY");
@ -158,15 +158,15 @@ void nsSVGDisplayContainerFrame::InsertFrames(
// If we are not a non-display SVG frame and we do not have a bounds update
// pending, then we need to schedule one for our new children:
if (!(GetStateBits() & (NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN |
NS_FRAME_IS_NONDISPLAY))) {
if (!HasAnyStateBits(NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN |
NS_FRAME_IS_NONDISPLAY)) {
for (nsIFrame* kid = firstNewFrame; kid != nextFrame;
kid = kid->GetNextSibling()) {
nsSVGDisplayableFrame* SVGFrame = do_QueryFrame(kid);
if (SVGFrame) {
MOZ_ASSERT(!(kid->GetStateBits() & NS_FRAME_IS_NONDISPLAY),
MOZ_ASSERT(!kid->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY),
"Check for this explicitly in the |if|, then");
bool isFirstReflow = (kid->GetStateBits() & NS_FRAME_FIRST_REFLOW);
bool isFirstReflow = kid->HasAnyStateBits(NS_FRAME_FIRST_REFLOW);
// Remove bits so that ScheduleBoundsUpdate will work:
kid->RemoveStateBits(NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_DIRTY |
NS_FRAME_HAS_DIRTY_CHILDREN);
@ -284,7 +284,7 @@ void nsSVGDisplayContainerFrame::ReflowSVG() {
NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
"This call is probably a wasteful mistake");
MOZ_ASSERT(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
MOZ_ASSERT(!HasAnyStateBits(NS_FRAME_IS_NONDISPLAY),
"ReflowSVG mechanism not designed for this");
MOZ_ASSERT(!IsSVGOuterSVGFrame(), "Do not call on outer-<svg>");
@ -303,7 +303,7 @@ void nsSVGDisplayContainerFrame::ReflowSVG() {
bool isFirstReflow = (mState & NS_FRAME_FIRST_REFLOW);
bool outerSVGHasHadFirstReflow =
(GetParent()->GetStateBits() & NS_FRAME_FIRST_REFLOW) == 0;
!GetParent()->HasAnyStateBits(NS_FRAME_FIRST_REFLOW);
if (outerSVGHasHadFirstReflow) {
RemoveStateBits(NS_FRAME_FIRST_REFLOW); // tell our children
@ -314,7 +314,7 @@ void nsSVGDisplayContainerFrame::ReflowSVG() {
for (nsIFrame* kid = mFrames.FirstChild(); kid; kid = kid->GetNextSibling()) {
nsSVGDisplayableFrame* SVGFrame = do_QueryFrame(kid);
if (SVGFrame) {
MOZ_ASSERT(!(kid->GetStateBits() & NS_FRAME_IS_NONDISPLAY),
MOZ_ASSERT(!kid->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY),
"Check for this explicitly in the |if|, then");
SVGFrame->ReflowSVG();
@ -326,9 +326,9 @@ void nsSVGDisplayContainerFrame::ReflowSVG() {
// Inside a non-display container frame, we might have some
// SVGTextFrames. We need to cause those to get reflowed in
// case they are the target of a rendering observer.
NS_ASSERTION(kid->GetStateBits() & NS_FRAME_IS_NONDISPLAY,
NS_ASSERTION(kid->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY),
"expected kid to be a NS_FRAME_IS_NONDISPLAY frame");
if (kid->GetStateBits() & NS_FRAME_IS_DIRTY) {
if (kid->HasAnyStateBits(NS_FRAME_IS_DIRTY)) {
nsSVGContainerFrame* container = do_QueryFrame(kid);
if (container && container->GetContent()->IsSVGElement()) {
ReflowSVGNonDisplayText(container);