Bug 1379516 - Add isStyledByServo(). r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Fri, 11 Aug 2017 08:43:45 +0900
changeset 644555 a64536312ca7ff6573a71d4e3a97a3d5d312e72e
parent 644554 adf6350223860d94cb3f17c2dbf5609133d9b024
child 644556 861d7a09950811b04627f20f8fded8b4b8c31c14
push id73463
push userhikezoe@mozilla.com
push dateFri, 11 Aug 2017 02:58:58 +0000
reviewersbirtles
bugs1379516
milestone57.0a1
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
dom/animation/test/testcommon.js
--- 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) {