@juggle/resize-observer
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -14,11 +14,12 @@ import { ResizeObserverBoxOptions } from '../ResizeObserverBoxOptions'; | ||
const cs = getComputedStyle(target); | ||
const hidden = cs.display === 'none'; | ||
const removePadding = !IE && cs.boxSizing === 'border-box'; | ||
const paddingTop = svg ? 0 : parseDimension(cs.paddingTop); | ||
const paddingRight = svg ? 0 : parseDimension(cs.paddingRight); | ||
const paddingBottom = svg ? 0 : parseDimension(cs.paddingBottom); | ||
const paddingLeft = svg ? 0 : parseDimension(cs.paddingLeft); | ||
const borderTop = svg ? 0 : parseDimension(cs.borderTopWidth); | ||
const borderRight = svg ? 0 : parseDimension(cs.borderRightWidth); | ||
const borderBottom = svg ? 0 : parseDimension(cs.borderBottomWidth); | ||
const borderLeft = svg ? 0 : parseDimension(cs.borderLeftWidth); | ||
const paddingTop = svg || hidden ? 0 : parseDimension(cs.paddingTop); | ||
const paddingRight = svg || hidden ? 0 : parseDimension(cs.paddingRight); | ||
const paddingBottom = svg || hidden ? 0 : parseDimension(cs.paddingBottom); | ||
const paddingLeft = svg || hidden ? 0 : parseDimension(cs.paddingLeft); | ||
const borderTop = svg || hidden ? 0 : parseDimension(cs.borderTopWidth); | ||
const borderRight = svg || hidden ? 0 : parseDimension(cs.borderRightWidth); | ||
const borderBottom = svg || hidden ? 0 : parseDimension(cs.borderBottomWidth); | ||
const borderLeft = svg || hidden ? 0 : parseDimension(cs.borderLeftWidth); | ||
const horizontalPadding = paddingLeft + paddingRight; | ||
@@ -30,5 +31,4 @@ const verticalPadding = paddingTop + paddingBottom; | ||
const heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0; | ||
const width = svg ? svg.width : parseDimension(cs.width) - widthReduction; | ||
const height = svg ? svg.height : parseDimension(cs.height) - heightReduction; | ||
const hidden = cs.display === 'none'; | ||
const width = hidden ? 0 : svg ? svg.width : parseDimension(cs.width) - widthReduction; | ||
const height = hidden ? 0 : svg ? svg.height : parseDimension(cs.height) - heightReduction; | ||
const borderBoxSize = { | ||
@@ -35,0 +35,0 @@ inlineSize: width + horizontalPadding + horizontalBorderArea, |
import { ResizeObserverBoxOptions } from './ResizeObserverBoxOptions'; | ||
import { calculateBoxSize } from './algorithms/calculateBoxSize'; | ||
const DEFAULT_SIZE = -1; | ||
class ResizeObservation { | ||
@@ -9,4 +8,4 @@ constructor(target, observedBox) { | ||
this.lastReportedSize = { | ||
inlineSize: DEFAULT_SIZE, | ||
blockSize: DEFAULT_SIZE | ||
inlineSize: 0, | ||
blockSize: 0 | ||
}; | ||
@@ -13,0 +12,0 @@ } |
{ | ||
"name": "@juggle/resize-observer", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "ResizeObserver - Based on the official draft specification", | ||
@@ -5,0 +5,0 @@ "main": "./lib/ResizeObserver.js", |
@@ -22,11 +22,12 @@ import { ResizeObserverBoxOptions } from '../ResizeObserverBoxOptions'; | ||
const cs = getComputedStyle(target); | ||
const hidden = cs.display === 'none'; | ||
const removePadding = !IE && cs.boxSizing === 'border-box'; | ||
const paddingTop = svg ? 0 : parseDimension(cs.paddingTop); | ||
const paddingRight = svg ? 0 : parseDimension(cs.paddingRight); | ||
const paddingBottom = svg ? 0 : parseDimension(cs.paddingBottom); | ||
const paddingLeft = svg ? 0 : parseDimension(cs.paddingLeft); | ||
const borderTop = svg ? 0 : parseDimension(cs.borderTopWidth); | ||
const borderRight = svg ? 0 : parseDimension(cs.borderRightWidth); | ||
const borderBottom = svg ? 0 : parseDimension(cs.borderBottomWidth); | ||
const borderLeft = svg ? 0 : parseDimension(cs.borderLeftWidth); | ||
const paddingTop = svg || hidden ? 0 : parseDimension(cs.paddingTop); | ||
const paddingRight = svg || hidden ? 0 : parseDimension(cs.paddingRight); | ||
const paddingBottom = svg || hidden ? 0 : parseDimension(cs.paddingBottom); | ||
const paddingLeft = svg || hidden ? 0 : parseDimension(cs.paddingLeft); | ||
const borderTop = svg || hidden ? 0 : parseDimension(cs.borderTopWidth); | ||
const borderRight = svg || hidden ? 0 : parseDimension(cs.borderRightWidth); | ||
const borderBottom = svg || hidden ? 0 : parseDimension(cs.borderBottomWidth); | ||
const borderLeft = svg || hidden ? 0 : parseDimension(cs.borderLeftWidth); | ||
const horizontalPadding = paddingLeft + paddingRight; | ||
@@ -38,5 +39,4 @@ const verticalPadding = paddingTop + paddingBottom; | ||
const heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0; | ||
const width = svg ? svg.width : parseDimension(cs.width) - widthReduction; | ||
const height = svg ? svg.height : parseDimension(cs.height) - heightReduction; | ||
const hidden = cs.display === 'none'; | ||
const width = hidden ? 0 : svg ? svg.width : parseDimension(cs.width) - widthReduction; | ||
const height = hidden ? 0 : svg ? svg.height : parseDimension(cs.height) - heightReduction; | ||
@@ -43,0 +43,0 @@ const borderBoxSize: ResizeObserverSize = { |
@@ -5,4 +5,2 @@ import { ResizeObserverSize } from './ResizeObserverSize'; | ||
const DEFAULT_SIZE = -1; // against the spec here to trigger initial observervation | ||
class ResizeObservation { | ||
@@ -18,4 +16,4 @@ | ||
this.lastReportedSize = { | ||
inlineSize: DEFAULT_SIZE, | ||
blockSize: DEFAULT_SIZE | ||
inlineSize: 0, | ||
blockSize: 0 | ||
} | ||
@@ -22,0 +20,0 @@ } |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
40713
0
923