Lines Matching refs:node
16 function positionedAncestor(node)
18 var ancestor = node.parentNode;
27 Array.prototype.forEach.call(parent.childNodes, function(node) {
28 checkedLayout |= checkSubtreeExpectedValues(node, failures);
33 function checkAttribute(output, node, attribute)
35 var result = node.getAttribute && node.getAttribute(attribute);
40 function checkExpectedValues(node, failures)
43 var expectedWidth = checkAttribute(output, node, "data-expected-width");
45 if (isNaN(expectedWidth) || Math.abs(node.offsetWidth - expectedWidth) >= 1)
46 failures.push("Expected " + expectedWidth + " for width, but got " + node.offsetWidth + ". ");
49 var expectedHeight = checkAttribute(output, node, "data-expected-height");
51 if (isNaN(expectedHeight) || Math.abs(node.offsetHeight - expectedHeight) >= 1)
52 failures.push("Expected " + expectedHeight + " for height, but got " + node.offsetHeight + ". ");
55 var expectedOffset = checkAttribute(output, node, "data-offset-x");
57 if (isNaN(expectedOffset) || Math.abs(node.offsetLeft - expectedOffset) >= 1)
58 failures.push("Expected " + expectedOffset + " for offsetLeft, but got " + node.offsetLeft + ". ");
61 var expectedOffset = checkAttribute(output, node, "data-offset-y");
63 if (isNaN(expectedOffset) || Math.abs(node.offsetTop - expectedOffset) >= 1)
64 failures.push("Expected " + expectedOffset + " for offsetTop, but got " + node.offsetTop + ". ");
67 var expectedOffset = checkAttribute(output, node, "data-positioned-offset-x");
69 var actualOffset = node.getBoundingClientRect().left - positionedAncestor(node).getBoundingClientRect().left;
74 var expectedOffset = checkAttribute(output, node, "data-positioned-offset-y");
76 var actualOffset = node.getBoundingClientRect().top - positionedAncestor(node).getBoundingClientRect().top;
81 var expectedWidth = checkAttribute(output, node, "data-expected-client-width");
83 if (isNaN(expectedWidth) || Math.abs(node.clientWidth - expectedWidth) >= 1)
84 failures.push("Expected " + expectedWidth + " for clientWidth, but got " + node.clientWidth + ". ");
87 var expectedHeight = checkAttribute(output, node, "data-expected-client-height");
89 if (isNaN(expectedHeight) || Math.abs(node.clientHeight - expectedHeight) >= 1)
90 failures.push("Expected " + expectedHeight + " for clientHeight, but got " + node.clientHeight + ". ");
93 var expectedWidth = checkAttribute(output, node, "data-expected-scroll-width");
95 if (isNaN(expectedWidth) || Math.abs(node.scrollWidth - expectedWidth) >= 1)
96 failures.push("Expected " + expectedWidth + " for scrollWidth, but got " + node.scrollWidth + ". ");
99 var expectedHeight = checkAttribute(output, node, "data-expected-scroll-height");
101 if (isNaN(expectedHeight) || Math.abs(node.scrollHeight - expectedHeight) >= 1)
102 failures.push("Expected " + expectedHeight + " for scrollHeight, but got " + node.scrollHeight + ". ");
105 var expectedOffset = checkAttribute(output, node, "data-total-x");
107 var totalLeft = node.clientLeft + node.offsetLeft;
109 failures.push("Expected " + expectedOffset + " for clientLeft+offsetLeft, but got " + totalLeft + ", clientLeft: " + node.clientLeft + ", offsetLeft: " + node.offsetLeft + ". ");
112 var expectedOffset = checkAttribute(output, node, "data-total-y");
114 var totalTop = node.clientTop + node.offsetTop;
116 failures.push("Expected " + expectedOffset + " for clientTop+offsetTop, but got " + totalTop + ", clientTop: " + node.clientTop + ", + offsetTop: " + node.offsetTop + ". ");
119 var expectedDisplay = checkAttribute(output, node, "data-expected-display");
121 var actualDisplay = getComputedStyle(node).display;
126 var expectedPaddingTop = checkAttribute(output, node, "data-expected-padding-top");
128 var actualPaddingTop = getComputedStyle(node).paddingTop;
135 var expectedPaddingBottom = checkAttribute(output, node, "data-expected-padding-bottom");
137 var actualPaddingBottom = getComputedStyle(node).paddingBottom;
144 var expectedPaddingLeft = checkAttribute(output, node, "data-expected-padding-left");
146 var actualPaddingLeft = getComputedStyle(node).paddingLeft;
153 var expectedPaddingRight = checkAttribute(output, node, "data-expected-padding-right");
155 var actualPaddingRight = getComputedStyle(node).paddingRight;
162 var expectedMarginTop = checkAttribute(output, node, "data-expected-margin-top");
164 var actualMarginTop = getComputedStyle(node).marginTop;
171 var expectedMarginBottom = checkAttribute(output, node, "data-expected-margin-bottom");
173 var actualMarginBottom = getComputedStyle(node).marginBottom;
180 var expectedMarginLeft = checkAttribute(output, node, "data-expected-margin-left");
182 var actualMarginLeft = getComputedStyle(node).marginLeft;
189 var expectedMarginRight = checkAttribute(output, node, "data-expected-margin-right");
191 var actualMarginRight = getComputedStyle(node).marginRight;
212 Array.prototype.forEach.call(nodes, function(node) {
214 checkedLayout |= checkExpectedValues(node.parentNode, failures);
215 checkedLayout |= checkSubtreeExpectedValues(node, failures);
217 var container = node.parentNode.className == 'container' ? node.parentNode : node;
229 // Inserting a text node so we have something to insertAfter.