Skip to content

[pull] master from Leaflet:master - #19

Open
pull[bot] wants to merge 163 commits into
httpsgithu:masterfrom
Leaflet:master
Open

[pull] master from Leaflet:master#19
pull[bot] wants to merge 163 commits into
httpsgithu:masterfrom
Leaflet:master

Conversation

@pull

@pull pull Bot commented Nov 1, 2021

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

johnd0e and others added 29 commits November 1, 2021 10:23
…ies (#7057)

* Control.Layers: clean up (continue e287b5e)

* Control.Layers: stop relying on Browser `android` and `touch` properties

- `android` is useless here, as there are a lot of non-android touch devices (including desktop ones)
- `touch` is useless, as mouse can be used on touch-screen too

Now these usecases are covered:
- `mouseenter/leave` are handled on touch devices too
- If Layers control created with {collapsed:false}, and than it collapsed explicitly
  [using .collapse() method], it's now possible to expand it back with click.

* Control.LayersSpec.js: add test for toggle focus

* Control.Layers: fix unexpected layer switch when expanding control on touch

Most browsers produce compatibility mouseenter for touch event, but not all,
so we listen for click also.

The problem is that these compatibility events come all in single batch, so
same touch induces expand and then immediate input switching.

To avoid this we temporarily prevent click on layers section.
Note: more straight-forward way would be relying on e.sourceCapabilities.firesTouchEvents,
      but atm it has rather low support: https://caniuse.com/#feat=mdn-api_inputdevicecapabilities_firestouchevents
* Simplify touch detection

1. Detect touch in recommended way
   Ref: https://www.chromestatus.com/feature/4764225348042752
   More: https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/KV6kqDJpYiE/YFM28ZNBBAAJ

2. Drop legacy Firefox touch support
   It is deprecated since Gecko 25.
   https://developer.mozilla.org/en-US/docs/Web/API/DocumentTouch

* Introduce `Browser.touchNative`, separated from `Browser.touch`

Bring `Browser.touch` description to reality.
Add brief note about pointer->touch processing in Leaflet.

* DomEvent: do not use pointer wrapper when native touch events are available
…idates (#7544)

* Map: fix contextmenu default-preventing when there are >1 target candidates

_fireDOMEvent gets 2 separate targets lists
- from _findEventTargets - has only targets with listeners
- from canvas (passed in argument) - may contain targets without listeners too

Previous code was incorrect as it checked random (first) target, and if happened not to have listeners -
the issue was triggered: preventDefault was not called (despite existing listeners on other targets in list).

* MapSpec.js: fix contextmenu-preventing test in IE
..as there are no useful cases when we should allow omitting tooltip
* Handle touchcancel separately from touchend

The things were mixed up, and in cases when `Browser.pointer` - `false`
touchcancel was not handled at all.

* Minor simplification in DomEvent.Pointer

Reduce polluting of obj with private properties of Leaflet
Remove unfunctional bind
* tests: IE<11 does not understand const/let

* tests: specify all required initEvent arguments for (IE)

Otherwise we get: TypeError: Argument not optional

* tests: add profiles to emulate legacy IE versions in IE11

I can confirm that only IE10 profile is working.

Sample commandline:

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

* tests: consider that style.zIndex is Number type in IE

* tests: set container height explicitly to fix 6 tests failing in IE

in IE when container.style.height is not set, container.clientWidth is always 0, despite container.style.width value.

* tests: fix #preventDefault in IE

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();
		});
```

* tests: skip crossOrigin-related tests in IE<11

https://caniuse.com/mdn-html_elements_img_crossorigin
)

* TileLayer: fire a 'tileabort' event when a tile load is cancelled

* oops, fix whitespace per npm run lint
* Reimplement disableClickPropagation in more simple and reliable way

Original approach was even simpler 5a7420d
But was reworked in 5c1a349 to be compatible with IE<9

Todo: return to original after we drop support for legacy IE

* Get rid of skipped() in stopPropagation

It was originated from here: caece94
The only purpose of skipped there - neutralize flaws of former limited implementation of
disableClickPropagation, so it is not needed anymore.

* Reimplement preventing of double-processing of Canvas events in more simple and reliable way.

(fakeStop was used there for sole purpose here - do not pass events to map)

Remove unused functions fakeStop / skipped.

* Revert "DomEventSpec.js: test to ensure stopPropagation does not break disableClickPropagation logic"

This reverts commit 63a2809.

Remove test case which is not useful after disableClickPropagation reimplemented

* Remove excessive check

After previous refactoring corresponding events are stopped naturally

* DomEvent.disableClickPropagation: prevent contextmenu as well
We need pass event to map when canvas does not have targets
* Reimplement DoubleTap simulation in more simple and reliable way

Base handler on 'click' event instead of 'touch*' / 'pointer*'.
Ensure that simulated 'dblclicks' are fired only when needed.

ATM it's safe to use in any known browser, with or without touch support,
and it is equally efficient with or without pointer events.

Additionally: reduce `delay` value to 200, as it is closer to actually observed.

* Don't try to guess whether DoubleTap handler is needed or not

..as it is safe to use in either case.

This change is required to support following cases:
- Desktop Chrome + touch emulation (via dev tools)
- Android Firefox 70+ with mouse

* Add tests for DomEvent.DoubleTap.js

* Minor refactoring of DomEvent.DoubleTap.js

Reduce polluting of obj with private properties of Leaflet

* DomEvent.DoubleTapSpec.js: test if disableClickPropagation respected
To prevent regressions like e87ed0c
@pull pull Bot added the ⤵️ pull label Nov 1, 2021
jonkoops and others added 28 commits December 13, 2021 16:14
* Remove redundant condition

Source: 7c2ac9f#diff-f7c61cee5bee8604986cfce68530ef8df7316a4e93ea6a2ddfb6e97fa4234421R662

* Fix issue when contextmenu was prevented on map even w/o real listeners
* Fix opening / closing tooltip while dragging map

* Fix lint

* Update src/layer/Tooltip.js

Co-authored-by: johnd0e <johnd0e@mail.ua>

Co-authored-by: johnd0e <johnd0e@mail.ua>
* Update the doc of DivOverlay

* Moved popup options from DivOverlay to Popup
Bumps [eslint](https://github.com/eslint/eslint) from 8.4.1 to 8.5.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v8.4.1...v8.5.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Prevent browser (mostly Firefox) resource depletion by premature optimization usage of `will-change`. At the municipality of Amsterdam, we're heavily relying on Leaflet and having map instances open regularly leads to degraded performance in Firefox, because of the use of `will-change`.
A reset view control for Leaflet.

Design for [Drupal Leaflet Module](https://www.drupal.org/project/leaflet) integration.

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
A sync view control for Leaflet.

Design for [Drupal Leaflet Module](https://www.drupal.org/project/leaflet) integration.

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
Bumps [rollup](https://github.com/rollup/rollup) from 2.61.1 to 2.62.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](rollup/rollup@v2.61.1...v2.62.0)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [eslint](https://github.com/eslint/eslint) from 8.5.0 to 8.6.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v8.5.0...v8.6.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
* Update marker: default role=button, default alt=marker

* fix marker test

Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>
Bumps [rollup](https://github.com/rollup/rollup) from 2.62.0 to 2.63.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](rollup/rollup@v2.62.0...v2.63.0)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.9 to 6.3.10.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](karma-runner/karma@v6.3.9...v6.3.10)

---
updated-dependencies:
- dependency-name: karma
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Improve site accesibility

* Prettier formatting reverted

* Removed typo in docs/docs/css/main.css
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.10 to 6.3.11.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](karma-runner/karma@v6.3.10...v6.3.11)

---
updated-dependencies:
- dependency-name: karma
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [mocha](https://github.com/mochajs/mocha) from 9.1.3 to 9.1.4.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](mochajs/mocha@v9.1.3...v9.1.4)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [rollup](https://github.com/rollup/rollup) from 2.63.0 to 2.64.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](rollup/rollup@v2.63.0...v2.64.0)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [eslint](https://github.com/eslint/eslint) from 8.6.0 to 8.7.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v8.6.0...v8.7.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
* fixing noConflict and merge rollup-config

* Fix lint
* Refactor openPopup/Tooltip to use common functions [Map/Layer]\_initOverlay

* DivOverlay: common functions openOn/close

Refactor [Map\Layer] open/close-Popup/Tooltip to use DivOverlay's openOn/close

* DivOverlay: new public method `toggle`

Refactor Layer\ togglePopup/Tooltip: use common method DivOverlay\toggle

Popup: do not clear map._popup on close as it's redundant
@mourner
mourner deleted the branch httpsgithu:master January 19, 2022 10:39
@mourner
mourner deleted the master branch January 19, 2022 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.