Use first background repeat value for multiple backgrounds if only 1 available (Edge bug)

This commit is contained in:
MoyuScript 2017-08-05 21:40:56 +08:00
parent 09f8f0cf01
commit 8cd182b0d8
2 changed files with 8 additions and 3 deletions

View File

@ -128,14 +128,17 @@ export const cloneWindow = (
if ( if (
/(iPad|iPhone|iPod)/g.test(navigator.userAgent) && /(iPad|iPhone|iPod)/g.test(navigator.userAgent) &&
(cloneWindow.scrollY !== bounds.top || (cloneWindow.scrollY !== bounds.top ||
cloneWindow.scrollX !== bounds.left) cloneWindow.scrollX !== bounds.left)
) { ) {
documentClone.documentElement.style.top = -bounds.top + 'px'; documentClone.documentElement.style.top = -bounds.top + 'px';
documentClone.documentElement.style.left = -bounds.left + 'px'; documentClone.documentElement.style.left = -bounds.left + 'px';
documentClone.documentElement.style.position = 'absolute'; documentClone.documentElement.style.position = 'absolute';
} }
} }
if (referenceElementSearch[1] instanceof cloneWindow.HTMLElement || referenceElementSearch[1] instanceof HTMLElement) { if (
referenceElementSearch[1] instanceof cloneWindow.HTMLElement ||
referenceElementSearch[1] instanceof HTMLElement
) {
resolve([cloneIframeContainer, referenceElementSearch[1]]); resolve([cloneIframeContainer, referenceElementSearch[1]]);
} else { } else {
reject( reject(

View File

@ -292,7 +292,9 @@ const parseBackgroundImages = (
return { return {
source, source,
repeat: parseBackgroundRepeat(repeats[index]), repeat: parseBackgroundRepeat(
typeof repeats[index] === 'string' ? repeats[index] : repeats[0]
),
size: size.length < 2 ? [size[0], AUTO_SIZE] : [size[0], size[1]], size: size.length < 2 ? [size[0], AUTO_SIZE] : [size[0], size[1]],
position: position.length < 2 ? [position[0], position[0]] : [position[0], position[1]] position: position.length < 2 ? [position[0], position[0]] : [position[0], position[1]]
}; };