happo 2.7.4 → 2.7.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5392e41f49f8130ab113b0498649d96b247a1d6f
4
- data.tar.gz: 527abaf52f6b0ee89a0e2088868c79865ac8e33f
3
+ metadata.gz: 80c0b6b398d484f5ed1cc3fda76d24c5d038f184
4
+ data.tar.gz: adcca757456079200cd1d322acc1269de56c66cc
5
5
  SHA512:
6
- metadata.gz: 24338f75e979dc40fbf319fa9bfb3fc011e53c6209204ed2fd306b6c94a2f7e9ea68386fafb54c878345d2d7d3b3acb36e4487409afc65291a19f01ea9fd9d21
7
- data.tar.gz: 48a670b1576e7894bc7453c9146fa41a9d3dc1a9e8c4199210aa1bd8df2e47f0cb9a466b3f4df92718d4dc8b0e31db29f3a678693e8570f451296d3dc3a9c953
6
+ metadata.gz: 392c63412bcc3a919d36735c0fbcde7ede071f096af776046a40b17342761282022e414ad7d61cd4c920ef731222a0e0a68fdec55a170b790d7d38625c020931
7
+ data.tar.gz: 2faafe9d4c0144d35a4e460c14a3bd9812495cb61955ce0a5625a252dbe31ec53c6691451cc38d6828548e7f3cea9b2e31c2bebf39645b86f9a7448f6a288c8c
@@ -202,6 +202,17 @@ window.happo = {
202
202
  }
203
203
  },
204
204
 
205
+ /**
206
+ * Gets the DOM elements that we will use as source for the snapshot. The
207
+ * default version simply gets the direct children of document.body, but you
208
+ * can override this method to better control the root nodes.
209
+ *
210
+ * @return Array|NodeList
211
+ */
212
+ getRootNodes: function getRootNodes() {
213
+ return document.body.children;
214
+ },
215
+
205
216
  // This function gets the full size of children in the document body,
206
217
  // including all descendent nodes. This allows us to ensure that the
207
218
  // screenshot includes absolutely positioned elements. It is important that
@@ -215,11 +226,13 @@ window.happo = {
215
226
  top: 0,
216
227
  };
217
228
 
229
+ var rootNodes = this.getRootNodes();
230
+
218
231
  // If there are any children, we want to iterate over them recursively,
219
232
  // mutating our box object along the way to expand to include all descendent
220
233
  // nodes.
221
- for (var i = 0; i < document.body.children.length; i++) {
222
- var node = document.body.children[i];
234
+ for (var i = 0; i < rootNodes.length; i++) {
235
+ var node = rootNodes[i];
223
236
 
224
237
  this.getFullRectRecursive(node, box);
225
238
 
data/lib/happo/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # Defines the gem version.
2
2
  module Happo
3
- VERSION = '2.7.4'
3
+ VERSION = '2.7.5'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: happo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.4
4
+ version: 2.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henric Trotzig
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-09-12 00:00:00.000000000 Z
12
+ date: 2016-09-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chunky_png