@juggle/resize-observer
Advanced tools
Comparing version 0.10.0 to 0.10.1
@@ -14,4 +14,6 @@ import { ResizeObserverBoxOptions } from '../ResizeObserverBoxOptions'; | ||
const cs = getComputedStyle(target); | ||
const hidden = cs.display === 'none'; | ||
const removePadding = !IE && cs.boxSizing === 'border-box'; | ||
const width = parseDimension(cs.width); | ||
const height = parseDimension(cs.height); | ||
const hidden = isNaN(width) || isNaN(height) || cs.display === 'none'; | ||
const paddingTop = svg || hidden ? 0 : parseDimension(cs.paddingTop); | ||
@@ -31,15 +33,15 @@ const paddingRight = svg || hidden ? 0 : parseDimension(cs.paddingRight); | ||
const heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0; | ||
const width = hidden ? 0 : svg ? svg.width : parseDimension(cs.width) - widthReduction; | ||
const height = hidden ? 0 : svg ? svg.height : parseDimension(cs.height) - heightReduction; | ||
const contentWidth = hidden ? 0 : svg ? svg.width : parseDimension(cs.width) - widthReduction; | ||
const contentHeight = hidden ? 0 : svg ? svg.height : parseDimension(cs.height) - heightReduction; | ||
const borderBoxSize = { | ||
inlineSize: width + horizontalPadding + horizontalBorderArea, | ||
blockSize: height + verticalPadding + verticalBorderArea | ||
inlineSize: contentWidth + horizontalPadding + horizontalBorderArea, | ||
blockSize: contentHeight + verticalPadding + verticalBorderArea | ||
}; | ||
const contentBoxSize = { | ||
inlineSize: width, | ||
blockSize: height | ||
inlineSize: contentWidth, | ||
blockSize: contentHeight | ||
}; | ||
const scrollBoxSize = { | ||
inlineSize: width + horizontalPadding, | ||
blockSize: height + verticalPadding | ||
inlineSize: contentWidth + horizontalPadding, | ||
blockSize: contentHeight + verticalPadding | ||
}; | ||
@@ -50,3 +52,3 @@ const devicePixelBorderBoxSize = { | ||
}; | ||
const contentRect = new DOMRectReadOnly(paddingLeft, paddingTop, width, height); | ||
const contentRect = new DOMRectReadOnly(paddingLeft, paddingTop, contentWidth, contentHeight); | ||
const boxes = { | ||
@@ -53,0 +55,0 @@ borderBoxSize, |
{ | ||
"name": "@juggle/resize-observer", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "ResizeObserver - Based on the official draft specification", | ||
@@ -5,0 +5,0 @@ "main": "./lib/ResizeObserver.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36996
477