|
93 | 93 | </test-fixture>
|
94 | 94 |
|
95 | 95 | <script>
|
| 96 | + const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); |
| 97 | + |
96 | 98 | function dispatchMouseEvent(target, type, coords = {x: 0, y: 0}, button = 0) {
|
97 | 99 | const e = new MouseEvent(type, {
|
98 | 100 | view: window,
|
|
537 | 539 | expect(Math.floor(draggedBounds.left)).to.be.eql(Math.floor(bounds.left + dx));
|
538 | 540 | });
|
539 | 541 |
|
540 |
| - it('should drag and move dialog after resizing', () => { |
| 542 | + // TODO: unskip this test after https://github.com/webcomponents/polyfills/pull/472 is released |
| 543 | + (isSafari && window.ShadyDOM ? it.skip : it)('should drag and move dialog after resizing', () => { |
541 | 544 | resize(container.querySelector('.s'), 0, dx);
|
542 | 545 | const bounds = container.getBoundingClientRect();
|
543 | 546 | const coords = {y: bounds.top + (bounds.height / 2), x: bounds.left + (bounds.width / 2)};
|
| 547 | + // FIXME: the ShadyDOM polyfill breaks when calling document.elementFromPoint on older versions of Safari (<=10) |
544 | 548 | let target = document.elementFromPoint(coords.x, coords.y);
|
545 |
| - if (!window.ShadyDOM) { |
| 549 | + if (dialog.$.overlay.shadowRoot.elementFromPoint) { |
546 | 550 | target = dialog.$.overlay.shadowRoot.elementFromPoint(coords.x, coords.y);
|
547 | 551 | }
|
548 | 552 | drag(target);
|
|
715 | 719 | expect(e.defaultPrevented).to.be.false;
|
716 | 720 | });
|
717 | 721 |
|
718 |
| - it('should bring to front on touch start', () => { |
| 722 | + // TODO: unskip this test after https://github.com/webcomponents/polyfills/pull/472 is released |
| 723 | + (isSafari && window.ShadyDOM ? it.skip : it)('should bring to front on touch start', () => { |
719 | 724 | dispatchTouchEvent(resizableContainer, 'touchstart');
|
| 725 | + // FIXME: the ShadyDOM polyfill crashes when calling document.elementFromPoint on older versions of Safari (<=10) |
720 | 726 | expect(getFrontmostOverlayFromScreenCenter()).to.equal(resizableOverlay);
|
721 | 727 | });
|
722 | 728 |
|
|
791 | 797 | modalDialog = dialogs[0];
|
792 | 798 | modelessDialog = dialogs[1];
|
793 | 799 | });
|
794 |
| - |
795 |
| - it('modal should not bring to front and close if a modeless dialog is on top', () => { |
| 800 | + // TODO: unskip this test after https://github.com/webcomponents/polyfills/pull/472 is released |
| 801 | + (isSafari && window.ShadyDOM ? it.skip : it)('modal should not bring to front and close if a modeless dialog is on top', () => { |
796 | 802 | modalDialog.opened = true;
|
797 | 803 | modelessDialog.opened = true;
|
798 | 804 |
|
799 | 805 | const expectedTextContent = modelessDialog.$.overlay.innerText.trim();
|
800 | 806 |
|
801 | 807 | const windowCenterHeight = window.innerHeight / 2;
|
802 | 808 | const windowCenterWidth = window.innerWidth / 2;
|
| 809 | + // FIXME: the ShadyDOM polyfill crashes when calling document.elementFromPoint on older versions of Safari (<=10) |
803 | 810 | let actualTextContent = document.elementFromPoint(windowCenterWidth, windowCenterHeight).innerText.trim();
|
804 | 811 | expect(actualTextContent).to.be.equals(expectedTextContent);
|
805 | 812 |
|
|
0 commit comments