Bug 1391014 - take in account the ancestor's transformation too for the current matrix; r=gl
authorZER0 <zer0.kaos@gmail.com>
Fri, 08 Sep 2017 17:18:21 +0200
changeset 429392 76eda7d1476e9a1937d6e77a8ef8aea005ba43f2
parent 429391 276422b549db0d1be89a3fa1b660ca93ad81ed24
child 429393 e49627fdbf67dffd50ffc7a0febf1fd5f34c3819
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgl
bugs1391014
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1391014 - take in account the ancestor's transformation too for the current matrix; r=gl MozReview-Commit-ID: Dc4DU3wPzU8
devtools/shared/layout/dom-matrix-2d.js
--- a/devtools/shared/layout/dom-matrix-2d.js
+++ b/devtools/shared/layout/dom-matrix-2d.js
@@ -115,29 +115,30 @@ exports.apply = apply;
 const isIdentity = (M) =>
   M[0] === 1 && M[1] === 0 && M[2] === 0 &&
   M[3] === 0 && M[4] === 1 && M[5] === 0 &&
   M[6] === 0 && M[7] === 0 && M[8] === 1;
 exports.isIdentity = isIdentity;
 
 /**
  * Returns the transformation matrix for the given node, relative to the ancestor passed
- * as second argument.
+ * as second argument; considering the ancestor transformation too.
  * If no ancestor is specified, it will returns the transformation matrix relative to the
  * node's parent element.
  *
  * @param {DOMNode} node
  *        The node.
  * @param {DOMNode} ancestor
  *        The ancestor of the node given.
  ** @return {Array}
  *        The transformation matrix.
  */
 function getNodeTransformationMatrix(node, ancestor = node.parentElement) {
-  let { a, b, c, d, e, f } = node.getTransformToAncestor(ancestor);
+  let { a, b, c, d, e, f } = ancestor.getTransformToParent()
+                                     .multiply(node.getTransformToAncestor(ancestor));
 
   return [
     a, c, e,
     b, d, f,
     0, 0, 1
   ];
 }
 exports.getNodeTransformationMatrix = getNodeTransformationMatrix;