Skip to content

Commit 55d3bfc

Browse files
authored
Merge pull request #7252 from QwikDev/computed-style-map-fix
fix: remove usage of computedStyleMap
2 parents 3342d58 + 20fa9bd commit 55d3bfc

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.changeset/cold-dogs-hunt.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@builder.io/qwik': patch
3+
---
4+
5+
fix: remove usage of `computedStyleMap`

packages/qwik/src/optimizer/src/plugins/image-size-runtime.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,11 +312,11 @@ <h2 id="title"></h2>
312312
const browserArea = rect.width * rect.height;
313313
if (!node.hasAttribute('width') || !node.hasAttribute('height')) {
314314
skip = true;
315-
const computedStyles = node.computedStyleMap();
316-
const hasAspect = computedStyles.get('aspect-ratio').toString() !== 'auto';
317-
const hasWidth = isDefinedUnit(computedStyles.get('width').toString());
318-
const hasHeight = isDefinedUnit(computedStyles.get('height').toString());
319-
const isAbsolute = computedStyles.get('position').toString() === 'absolute';
315+
const computedStyles = getComputedStyle(node);
316+
const hasAspect = computedStyles.getPropertyValue('aspect-ratio').toString() !== 'auto';
317+
const hasWidth = isDefinedUnit(computedStyles.getPropertyValue('width').toString());
318+
const hasHeight = isDefinedUnit(computedStyles.getPropertyValue('height').toString());
319+
const isAbsolute = computedStyles.getPropertyValue('position').toString() === 'absolute';
320320
layoutInvalidation =
321321
browserArea > 1000 && !isAbsolute && !hasAspect && (!hasWidth || !hasHeight);
322322
}

0 commit comments

Comments
 (0)