Bug 1447358: Unifdef the old style system code. r=jwatt
Summary: This has been automatically generated using: http://dotat.at/prog/unifdef/ And: find $OBJDIR -type f -name '*.h' | while read FILE; do echo "$FILE" unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE"; done find $OBJDIR -type f -name '*.cpp' | while read FILE; do echo "$FILE" unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE"; done MozReview-Commit-ID: I4NdKqbMXzJ Reviewers: jwatt Bug #: 1447358 Differential Revision: https://phabricator.services.mozilla.com/D779
This commit is contained in:
@@ -23,9 +23,6 @@
|
||||
#include "nsQueryObject.h"
|
||||
#include "nsIContentInlines.h"
|
||||
#include "nsIContentViewer.h"
|
||||
#ifdef MOZ_OLD_STYLE
|
||||
#include "mozilla/css/Declaration.h"
|
||||
#endif
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDocumentEncoder.h"
|
||||
#include "nsIDOMDocumentFragment.h"
|
||||
@@ -2966,39 +2963,7 @@ IsOrHasAncestorWithDisplayNone(Element* aElement, nsIPresShell* aPresShell)
|
||||
return !aElement->HasServoData() || Servo_Element_IsDisplayNone(aElement);
|
||||
}
|
||||
|
||||
#ifdef MOZ_OLD_STYLE
|
||||
AutoTArray<Element*, 10> elementsToCheck;
|
||||
// Style and layout work on the flattened tree, so this is what we need to
|
||||
// check in order to figure out whether we're in a display: none subtree.
|
||||
for (Element* e = aElement; e; e = e->GetFlattenedTreeParentElement()) {
|
||||
if (e->GetPrimaryFrame()) {
|
||||
// e definitely isn't display:none and doesn't have a display:none
|
||||
// ancestor.
|
||||
break;
|
||||
}
|
||||
elementsToCheck.AppendElement(e);
|
||||
}
|
||||
|
||||
if (elementsToCheck.IsEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsStyleSet* styleSet = aPresShell->StyleSet()->AsGecko();
|
||||
RefPtr<GeckoStyleContext> sc;
|
||||
for (auto* element : Reversed(elementsToCheck)) {
|
||||
if (sc) {
|
||||
sc = styleSet->ResolveStyleFor(element, sc, LazyComputeBehavior::Assert);
|
||||
} else {
|
||||
sc = nsComputedDOMStyle::GetStyleContextNoFlush(element, nullptr)
|
||||
.downcast<GeckoStyleContext>();
|
||||
}
|
||||
if (sc->StyleDisplay()->mDisplay == StyleDisplay::None) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#else
|
||||
MOZ_CRASH("Old style system disabled");
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user