Bug 1430014 - Part 3: Add DOMWindowUtils.isOldStyleSystemEnabled. r?xidorn
MozReview-Commit-ID: 2MWbQzq19Ap
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -4441,16 +4441,27 @@ NS_IMETHODIMP
nsDOMWindowUtils::GetIsStyledByServo(bool* aStyledByServo)
{
nsIDocument* doc = GetDocument();
*aStyledByServo = doc && doc->IsStyledByServo();
return NS_OK;
}
NS_IMETHODIMP
+nsDOMWindowUtils::GetIsOldStyleSystemEnabled(bool* aResult)
+{
+#ifdef MOZ_OLD_STYLE
+ *aResult = true;
+#else
+ *aResult = false;
+#endif
+ return NS_OK;
+}
+
+NS_IMETHODIMP
nsDOMWindowUtils::AddToStyloBlocklist(const nsACString& aBlockedDomain)
{
#ifdef MOZ_STYLO
nsLayoutUtils::AddToStyloBlocklist(aBlockedDomain);
#endif
return NS_OK;
}
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl
+++ b/dom/interfaces/base/nsIDOMWindowUtils.idl
@@ -1976,16 +1976,24 @@ interface nsIDOMWindowUtils : nsISupport
/**
* Whether the current document is styled by Servo's style engine.
*
* This calls nsIDocument::IsStyledByServo().
*/
readonly attribute boolean isStyledByServo;
/**
+ * Whether the old style system is available.
+ *
+ * This is used to skip some tests that make no sense if we only have
+ * Servo's style system.
+ */
+ readonly attribute boolean isOldStyleSystemEnabled;
+
+ /**
* Add a domain to the existing stylo blocklist.
*
* This calls nsLayoutUtils::AddToStyloBlocklist().
*/
void addToStyloBlocklist(in ACString aBlockedDomain);
/**
* Remove a domain from the existing stylo blocklist.