MCPcopy Create free account
hub / github.com/nodejs/node / checkExpectedValues

Function checkExpectedValues

test/fixtures/wpt/resources/check-layout-th.js:65–205  ·  view source on GitHub ↗
(t, node, prefix)

Source from the content-addressed store, hash-verified

63}
64
65function checkExpectedValues(t, node, prefix)
66{
67 checkDataKeys(node);
68 var output = { checked: false };
69
70 var expectedWidth = checkAttribute(output, node, "data-expected-width");
71 if (expectedWidth) {
72 assert_tolerance(node.offsetWidth, expectedWidth, prefix + "width");
73 }
74
75 var expectedHeight = checkAttribute(output, node, "data-expected-height");
76 if (expectedHeight) {
77 assert_tolerance(node.offsetHeight, expectedHeight, prefix + "height");
78 }
79
80 var expectedOffset = checkAttribute(output, node, "data-offset-x");
81 if (expectedOffset) {
82 assert_tolerance(node.offsetLeft, expectedOffset, prefix + "offsetLeft");
83 }
84
85 var expectedOffset = checkAttribute(output, node, "data-offset-y");
86 if (expectedOffset) {
87 assert_tolerance(node.offsetTop, expectedOffset, prefix + "offsetTop");
88 }
89
90 var expectedWidth = checkAttribute(output, node, "data-expected-client-width");
91 if (expectedWidth) {
92 assert_tolerance(node.clientWidth, expectedWidth, prefix + "clientWidth");
93 }
94
95 var expectedHeight = checkAttribute(output, node, "data-expected-client-height");
96 if (expectedHeight) {
97 assert_tolerance(node.clientHeight, expectedHeight, prefix + "clientHeight");
98 }
99
100 var expectedWidth = checkAttribute(output, node, "data-expected-scroll-width");
101 if (expectedWidth) {
102 assert_tolerance(node.scrollWidth, expectedWidth, prefix + "scrollWidth");
103 }
104
105 var expectedHeight = checkAttribute(output, node, "data-expected-scroll-height");
106 if (expectedHeight) {
107 assert_tolerance(node.scrollHeight, expectedHeight, prefix + "scrollHeight");
108 }
109
110 var expectedWidth = checkAttribute(output, node, "data-expected-bounding-client-rect-width");
111 if (expectedWidth) {
112 assert_tolerance(node.getBoundingClientRect().width, expectedWidth, prefix + "getBoundingClientRect().width");
113 }
114
115 var expectedHeight = checkAttribute(output, node, "data-expected-bounding-client-rect-height");
116 if (expectedHeight) {
117 assert_tolerance(node.getBoundingClientRect().height, expectedHeight, prefix + "getBoundingClientRect().height");
118 }
119
120 var expectedOffset = checkAttribute(output, node, "data-total-x");
121 if (expectedOffset) {
122 var totalLeft = node.clientLeft + node.offsetLeft;

Callers 2

check-layout-th.jsFile · 0.85

Calls 5

checkDataKeysFunction · 0.85
checkAttributeFunction · 0.85
assert_toleranceFunction · 0.85
assert_equalsFunction · 0.70
sliceMethod · 0.65

Tested by

no test coverage detected