Skip to content

Commit f662fa4

Browse files
authored
refactor: remove no longer needed icon Safari workaround (#9302)
1 parent 7468f51 commit f662fa4

File tree

6 files changed

+3
-216
lines changed

6 files changed

+3
-216
lines changed

packages/icon/src/vaadin-icon-font-size-mixin.d.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

packages/icon/src/vaadin-icon-font-size-mixin.js

Lines changed: 0 additions & 74 deletions
This file was deleted.

packages/icon/src/vaadin-icon-helpers.js

Lines changed: 0 additions & 52 deletions
This file was deleted.

packages/icon/src/vaadin-icon-mixin.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
*/
66
import type { Constructor } from '@open-wc/dedupe-mixin';
77
import type { SlotStylesMixinClass } from '@vaadin/component-base/src/slot-styles-mixin.js';
8-
import type { IconFontSizeMixinClass } from './vaadin-icon-font-size-mixin.js';
98
import type { IconSvgLiteral } from './vaadin-icon-svg.js';
109

1110
/**
1211
* A mixin providing common icon functionality.
1312
*/
1413
export declare function IconMixin<T extends Constructor<HTMLElement>>(
1514
base: T,
16-
): Constructor<IconFontSizeMixinClass> & Constructor<IconMixinClass> & Constructor<SlotStylesMixinClass> & T;
15+
): Constructor<IconMixinClass> & Constructor<SlotStylesMixinClass> & T;
1716

1817
export declare class IconMixinClass {
1918
/**

packages/icon/src/vaadin-icon-mixin.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
import { SlotStylesMixin } from '@vaadin/component-base/src/slot-styles-mixin.js';
77
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
8-
import { IconFontSizeMixin } from './vaadin-icon-font-size-mixin.js';
98
import { ensureSvgLiteral, renderSvg, unsafeSvgLiteral } from './vaadin-icon-svg.js';
109

1110
const srcCache = new Map();
@@ -15,10 +14,9 @@ const Iconset = customElements.get('vaadin-iconset');
1514
/**
1615
* @polymerMixin
1716
* @mixes SlotStylesMixin
18-
* @mixes IconFontSizeMixin
1917
*/
2018
export const IconMixin = (superClass) =>
21-
class extends IconFontSizeMixin(SlotStylesMixin(superClass)) {
19+
class extends SlotStylesMixin(superClass) {
2220
static get properties() {
2321
return {
2422
/**

packages/icon/test/icon-font.test.js

Lines changed: 1 addition & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { expect } from '@vaadin/chai-plugins';
2-
import { fixtureSync, isChrome, nextFrame, nextResize } from '@vaadin/testing-helpers';
2+
import { fixtureSync, nextFrame, nextResize } from '@vaadin/testing-helpers';
33
import '../src/vaadin-icon.js';
4-
import { needsFontIconSizingFallback, supportsCQUnitsForPseudoElements } from '../src/vaadin-icon-helpers.js';
54
import { iconFontCss } from './test-icon-font.js';
65

76
describe('vaadin-icon - icon fonts', () => {
@@ -268,71 +267,4 @@ describe('vaadin-icon - icon fonts', () => {
268267
expect(['"My icons 6"', 'My icons 6']).to.include(fontIconStyle.fontFamily);
269268
});
270269
});
271-
272-
// These tests make sure that the heavy container query fallback is only used
273-
// when font icons are used.
274-
describe('container query fallback', () => {
275-
// Tests for browsers that require the fallback
276-
const fallBackIt = needsFontIconSizingFallback() ? it : it.skip;
277-
// Tests for browsers that we know for sure not to require the fallback
278-
const supportedIt = isChrome ? it : it.skip;
279-
280-
let icon;
281-
282-
supportedIt('should support CQ width units on pseudo elements', () => {
283-
expect(supportsCQUnitsForPseudoElements()).to.be.true;
284-
});
285-
286-
supportedIt('should not need the fallback', () => {
287-
expect(needsFontIconSizingFallback()).to.be.false;
288-
});
289-
290-
fallBackIt('should not support CQ width units on pseudo elements', () => {
291-
expect(supportsCQUnitsForPseudoElements()).to.be.false;
292-
});
293-
294-
fallBackIt('should have the custom property (iconClass)', async () => {
295-
icon = fixtureSync('<vaadin-icon icon-class="foo"></vaadin-icon>');
296-
await nextFrame();
297-
expect(icon.style.getPropertyValue('--_vaadin-font-icon-size')).to.equal('24px');
298-
});
299-
300-
fallBackIt('should have the custom property (char)', async () => {
301-
icon = fixtureSync('<vaadin-icon char="foo"></vaadin-icon>');
302-
await nextFrame();
303-
expect(icon.style.getPropertyValue('--_vaadin-font-icon-size')).to.equal('24px');
304-
});
305-
306-
fallBackIt('should not have the custom property', async () => {
307-
icon = fixtureSync('<vaadin-icon></vaadin-icon>');
308-
await nextFrame();
309-
expect(icon.style.getPropertyValue('--_vaadin-font-icon-size')).to.equal('');
310-
});
311-
312-
fallBackIt('should set the custom property', async () => {
313-
icon = fixtureSync('<vaadin-icon></vaadin-icon>');
314-
await nextFrame();
315-
icon.iconClass = 'foo';
316-
expect(icon.style.getPropertyValue('--_vaadin-font-icon-size')).to.equal('24px');
317-
});
318-
319-
fallBackIt('should update the custom property', async () => {
320-
icon = fixtureSync('<vaadin-icon icon-class="foo"></vaadin-icon>');
321-
await nextFrame();
322-
icon.style.width = '100px';
323-
icon.style.height = '100px';
324-
await nextResize(icon);
325-
expect(icon.style.getPropertyValue('--_vaadin-font-icon-size')).to.equal('100px');
326-
});
327-
328-
fallBackIt('should not update the custom property', async () => {
329-
icon = fixtureSync('<vaadin-icon></vaadin-icon>');
330-
await nextFrame();
331-
icon.style.width = '100px';
332-
icon.style.height = '100px';
333-
await nextFrame(icon);
334-
await nextFrame(icon);
335-
expect(icon.style.getPropertyValue('--_vaadin-font-icon-size')).to.equal('');
336-
});
337-
});
338270
});

0 commit comments

Comments
 (0)