Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests failing in IE #7461

Merged
merged 7 commits into from
Nov 1, 2021
Merged

Fix tests failing in IE #7461

merged 7 commits into from
Nov 1, 2021

Conversation

johnd0e
Copy link
Collaborator

@johnd0e johnd0e commented Feb 9, 2021

Usage sample

npm run test-nolint -- --browsers IE,IE10

Fix most of the #7414
What is left:

  • (2) Marker/Map drag in CSS scaled container - perhaps is really broken (untested yet).
  • (5) Depend on prosthetic-hand, and cannot be fixed on our side.

@johnd0e johnd0e added compatibility Cross-browser/device/environment compatibility tests labels Feb 9, 2021
johndoe added 6 commits February 25, 2021 16:48
Otherwise we get: TypeError: Argument not optional
I can confirm that only IE10 profile is working.

Sample commandline:

npm run test-nolint -- --browsers IE,IE10
in IE when container.style.height is not set, container.clientWidth is always 0, despite container.style.width value.
Event properties is not preserved across different listeners calls in IE,
so we have to make all checks in the same listener.

Also: control case added.

Note: previously here used to be different implementation that was also reliable,
as it relied on return value of https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent

```
		function dispatchClick(el) { // return: cancelled
			if (document.createEvent) {
				var e = document.createEvent('MouseEvents');
				e.initMouseEvent('click', true, true, window,
					0, 0, 0, 0, 0, false, false, false, false, 0, null);
				return el.dispatchEvent(e);
			} else if (el.fireEvent) { // IE<11
				return el.fireEvent('onclick');
			}
		}

		it('prevents the default action of event', function () {
			expect(dispatchClick(el)).to.be.ok(); // control case

			L.DomEvent.on(el, 'click', L.DomEvent.preventDefault);

			expect(dispatchClick(el)).to.not.be.ok();
		});
```
@johnd0e johnd0e marked this pull request as ready for review March 18, 2021 13:20
@mourner mourner merged commit f018e2d into Leaflet:master Nov 1, 2021
@johnd0e johnd0e deleted the fix-ie-tests branch November 1, 2021 09:42
@Malvoz Malvoz added the ie Internet Explorer label May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Cross-browser/device/environment compatibility ie Internet Explorer tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants