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

Differential Revision: https://phabricator.services.mozilla.com/D81201
This commit is contained in:
Kagami Sascha Rosylight 2020-06-27 13:16:49 +00:00
Родитель 665e5fe0b3
Коммит ac5b595f91
2 изменённых файлов: 7 добавлений и 7 удалений

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

@ -27,7 +27,7 @@ NS_DECLARE_FRAME_PROPERTY_DELETABLE(FontInflationDataProperty,
const nsIFrame* aFrame) {
// We have one set of font inflation data per block formatting context.
const nsIFrame* bfc = FlowRootFor(aFrame);
NS_ASSERTION(bfc->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT,
NS_ASSERTION(bfc->HasAnyStateBits(NS_FRAME_FONT_INFLATION_FLOW_ROOT),
"should have found a flow root");
MOZ_ASSERT(aFrame->GetWritingMode().IsVertical() ==
bfc->GetWritingMode().IsVertical(),
@ -40,7 +40,7 @@ NS_DECLARE_FRAME_PROPERTY_DELETABLE(FontInflationDataProperty,
bool nsFontInflationData::UpdateFontInflationDataISizeFor(
const ReflowInput& aReflowInput) {
nsIFrame* bfc = aReflowInput.mFrame;
NS_ASSERTION(bfc->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT,
NS_ASSERTION(bfc->HasAnyStateBits(NS_FRAME_FONT_INFLATION_FLOW_ROOT),
"should have been given a flow root");
nsFontInflationData* data = bfc->GetProperty(FontInflationDataProperty());
bool oldInflationEnabled;
@ -64,7 +64,7 @@ bool nsFontInflationData::UpdateFontInflationDataISizeFor(
/* static */
void nsFontInflationData::MarkFontInflationDataTextDirty(nsIFrame* aBFCFrame) {
NS_ASSERTION(aBFCFrame->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT,
NS_ASSERTION(aBFCFrame->HasAnyStateBits(NS_FRAME_FONT_INFLATION_FLOW_ROOT),
"should have been given a flow root");
nsFontInflationData* data =
@ -167,7 +167,7 @@ static nscoord ComputeDescendantISize(const ReflowInput& aAncestorReflowInput,
void nsFontInflationData::UpdateISize(const ReflowInput& aReflowInput) {
nsIFrame* bfc = aReflowInput.mFrame;
NS_ASSERTION(bfc->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT,
NS_ASSERTION(bfc->HasAnyStateBits(NS_FRAME_FONT_INFLATION_FLOW_ROOT),
"must be block formatting context");
nsIFrame* firstInflatableDescendant =
@ -249,7 +249,7 @@ void nsFontInflationData::UpdateISize(const ReflowInput& aReflowInput) {
: list.LastChild();
kid; kid = (aDirection == eFromStart) ? kid->GetNextSibling()
: kid->GetPrevSibling()) {
if (kid->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT) {
if (kid->HasAnyStateBits(NS_FRAME_FONT_INFLATION_FLOW_ROOT)) {
// Goes in a different set of inflation data.
continue;
}
@ -322,7 +322,7 @@ void nsFontInflationData::ScanTextIn(nsIFrame* aFrame) {
for (const auto& childList : aFrame->ChildLists()) {
for (nsIFrame* kid : childList.mList) {
if (kid->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT) {
if (kid->HasAnyStateBits(NS_FRAME_FONT_INFLATION_FLOW_ROOT)) {
// Goes in a different set of inflation data.
continue;
}

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

@ -54,7 +54,7 @@ class nsFontInflationData {
void ScanTextIn(nsIFrame* aFrame);
static const nsIFrame* FlowRootFor(const nsIFrame* aFrame) {
while (!(aFrame->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT)) {
while (!aFrame->HasAnyStateBits(NS_FRAME_FONT_INFLATION_FLOW_ROOT)) {
aFrame = aFrame->GetParent();
}
return aFrame;