happo 2.5.2 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/happo/public/happo-runner.js +21 -0
- data/lib/happo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9a8cddb3cdd182db6d8d96d32b9a81c5802f449
|
4
|
+
data.tar.gz: 6d9726df428ef2da13115dbfedbf739d27e0875d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1b0f14bc41131d94b70ae1efc96bcde6e717958634dcb72cdd73438cc503b0a2aeadc1b7336589df246c1765c6c589ae1d313c4cba96c04b29d8d13ffb520c5
|
7
|
+
data.tar.gz: af494cf1cc7b4d18cf2aae3ab6941157f35a2cc474d9e7e1e3ae3c5661884cb54d838baf26a1939e02b869f4add0a1f6b7bb0739415cb1f8fb71d2b35b1fb90d
|
@@ -162,8 +162,27 @@ window.happo = {
|
|
162
162
|
}
|
163
163
|
},
|
164
164
|
|
165
|
+
// Scrollbars inside of elements may cause spurious visual diffs. To avoid
|
166
|
+
// this issue, we can hide them automatically by styling the overflow to be
|
167
|
+
// hidden.
|
168
|
+
removeScrollbars: function removeScrollbars(node) {
|
169
|
+
if (
|
170
|
+
node.scrollHeight !== node.clientHeight
|
171
|
+
|| node.scrollWidth !== node.clientWidth
|
172
|
+
) {
|
173
|
+
// We style this via node.style.cssText so that we can override any styles
|
174
|
+
// that might already be `!important`.
|
175
|
+
// eslint-disable-next-line no-param-reassign
|
176
|
+
node.style.cssText += 'overflow: hidden !important';
|
177
|
+
}
|
178
|
+
},
|
179
|
+
|
165
180
|
// This function takes a node and a box object that we will mutate.
|
166
181
|
getFullRectRecursive: function getFullRectRecursive(node, box) {
|
182
|
+
// Since we are already traversing through every node, let's piggyback on
|
183
|
+
// that work and remove scrollbars to prevent spurious diffs.
|
184
|
+
this.removeScrollbars(node);
|
185
|
+
|
167
186
|
var rect = node.getBoundingClientRect();
|
168
187
|
|
169
188
|
/* eslint-disable no-param-reassign */
|
@@ -183,6 +202,8 @@ window.happo = {
|
|
183
202
|
// absolutely positioned elements. It is important that this is fast, since we
|
184
203
|
// may be iterating over a high number of nodes.
|
185
204
|
getFullRect: function getFullRect(node) {
|
205
|
+
this.removeScrollbars(node);
|
206
|
+
|
186
207
|
var rect = node.getBoundingClientRect();
|
187
208
|
|
188
209
|
// Set up the initial object that we will mutate in our recursive function.
|
data/lib/happo/version.rb
CHANGED
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.
|
4
|
+
version: 2.6.0
|
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
|
+
date: 2016-09-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chunky_png
|