Bug 1379516 - Add isStyledByServo(). r?birtles
DOMWindowUtils.isStyledByServo checks not only the preference value but also
STYLO_FORCE_ENABLED value. This is important especially when we run test on
our CI. On our CI, the preference value is false but just STYLO_FORCE_ENABLED
is set.
MozReview-Commit-ID: FKEd5LFwcxf
--- a/dom/animation/test/testcommon.js
+++ b/dom/animation/test/testcommon.js
@@ -315,16 +315,23 @@ function useTestRefreshMode(t) {
*/
function isOMTAEnabled() {
const OMTAPrefKey = 'layers.offmainthreadcomposition.async-animations';
return SpecialPowers.DOMWindowUtils.layerManagerRemote &&
SpecialPowers.getBoolPref(OMTAPrefKey);
}
/**
+ * Returns true if the document is styled by servo.
+ */
+function isStyledByServo() {
+ return SpecialPowers.DOMWindowUtils.isStyledByServo;
+}
+
+/**
* Append an SVG element to the target element.
*
* @param target The element which want to append.
* @param attrs A array object with attribute name and values to set on
* the SVG element.
* @return An SVG outer element.
*/
function addSVGElement(target, tag, attrs) {