- 06 Oct, 2020 19 commits
-
-
Robert Knight authored
Handle scenarios flagged by type checking where `nodeFromXPath` may return `null` or a non-Element node. Previously it could never return `null` but would throw an exception if the node was not found. In the new code a check is needed. The case where `nodeFromXPath` returned a non-Element node would never happen with XPaths generated by the client but could happen if an annotation was created via the API with a non-simple XPath.
-
Robert Knight authored
I don't believe this issue will ever occur in the real application, but we currently have tests (in `html-test.js`) where the passed node comes from a different iframe and therefore a different JS environment where globals including `Text` and `Element` have different identities.
-
Robert Knight authored
The expression `n.data.length` cannot be nullish. This was left over from a previous version that read `n.nodeValue?.length`.
-
Robert Knight authored
Rewrite an async test to use async/await syntax for readability and add a missing `return` so that mocha correctly waits for the test to finish before continuing.
-
Robert Knight authored
In HTML documents that have been served with an XML mime type, `document.evaluate` handles element names differently. In HTML documents the XPath segments do not require prefixes on element names. In XHTML documents however they do. Since the client always generates the same un-prefixed XPaths regardless of document type, evaluation always failed. There was a fallback path but it was only executed if `document.evaluate` threw an error, not if it returned `null` as in this case. This commit resolves the issue by first attempting to evaluate the XPath using custom logic that only handles simple XPaths and then using `document.evaluate` only for more complex XPaths. The _simple XPath_ logic behaves the same in HTML and XML documents and ignores namespaces. As a result it works with the XPaths that the client generates regardless of document type and also regardless of whether the XPath references only HTML elements or elements from other namespaces (eg. MathML or SVG). We could change the way that the client generates XPaths in future in XML documents or SVG/MathML content within HTML documents, but the client would still need to handle `RangeSelector` selectors on existing annotations. For more details, see https://github.com/hypothesis/client/pull/2590#issuecomment-702132563 Fixes #2592
-
Robert Knight authored
The test case given in the comment no longer fails in modern versions of Safari and I was unable to find any open or closed bug reports mentioning `Node.contains`. Since the comment referenced a very old version of Safari, I think it is reasonable to assume it has long been resolved.
-
Robert Knight authored
`nodeValue` is an alias for `data` in text nodes, but `data` is never null, which keeps TS happy.
-
Robert Knight authored
As part of the removal of jQuery from the annotator, remove usage from `range.js`: - Replace `parents()` method with a small helper function - Rewrite `getTextNodes` function to accept and return DOM nodes rather than jQuery collections - Use `Node.contains` instead of jQuery's `contains` method. Note that there is a semantic difference that `contains(nodeA, nodeA)` returns `false` whereas `nodeA.contains(nodeA)` returns `true`. This enabled simplifying a condition.
-
Robert Knight authored
We use both terms to refer to an annotation in various places, but `annotation` is more common in this module.
-
Robert Knight authored
- Remove an `callback: RpcCallback` argument which was unused - Document the type of annotation bodies and RPC messages
-
Robert Knight authored
The `AnnotationSync` class was an ES5-style class that had a ton of ES5-isms, odd constructions probably resulting from a historical conversion from CoffeeScript and unnecessary abstractions. It was also lacking in documentation. This commit rewrites the class using modern syntax and removing unused code and unnecessary abstractions (eg. the `_eventListeners` and `_channelListeners` properties). The API and behavior should be unchanged. An additional test was added for the `sync` method.
-
dependabot-preview[bot] authored
Bumps [terser](https://github.com/terser/terser) from 5.3.3 to 5.3.4. - [Release notes](https://github.com/terser/terser/releases) - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md) - [Commits](https://github.com/terser/terser/compare/v5.3.3...v5.3.4) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-
dependabot-preview[bot] authored
Bumps [preact](https://github.com/preactjs/preact) from 10.5.3 to 10.5.4. - [Release notes](https://github.com/preactjs/preact/releases) - [Commits](https://github.com/preactjs/preact/compare/10.5.3...10.5.4) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-
dependabot-preview[bot] authored
Bumps [codecov](https://github.com/codecov/codecov-node) from 3.7.2 to 3.8.0. - [Release notes](https://github.com/codecov/codecov-node/releases) - [Changelog](https://github.com/codecov/codecov-node/blob/master/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-node/compare/v3.7.2...v3.8.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-
dependabot-preview[bot] authored
Bumps [@sentry/browser](https://github.com/getsentry/sentry-javascript) from 5.24.2 to 5.25.0. - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/5.24.2...5.25.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-
dependabot-preview[bot] authored
Bumps [sinon](https://github.com/sinonjs/sinon) from 9.0.3 to 9.1.0. - [Release notes](https://github.com/sinonjs/sinon/releases) - [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md) - [Commits](https://github.com/sinonjs/sinon/compare/v9.0.3...v9.1.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-
dependabot-preview[bot] authored
Bumps [sass](https://github.com/sass/dart-sass) from 1.26.11 to 1.26.12. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.26.11...1.26.12) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-
dependabot-preview[bot] authored
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.21.2 to 7.21.3. - [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases) - [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md) - [Commits](https://github.com/yannickcr/eslint-plugin-react/compare/v7.21.2...v7.21.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-
dependabot-preview[bot] authored
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.762.0 to 2.767.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js/compare/v2.762.0...v2.767.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-
- 05 Oct, 2020 5 commits
-
-
Lyza Danger Gardner authored
-
Lyza Danger Gardner authored
-
Lyza Danger Gardner authored
-
Robert Knight authored
Previously plugin initialization happened in several steps: 1. The plugin constructor was called with the root element and config options 2. The plugin's `annotator` property was set to a reference to the `Guest` instance for the current document 3. The plugin's `pluginInit` method was called There was no real need for this multi-step process. This commit simplifies it by removing the `pluginInit` method and passing the guest reference as a third argument to the constructor in step 1. As a result, the `Plugin` base class is no longer needed. Plugins now extend the parent `Delegator` class instead.
-
Eduardo Sanz García authored
-
- 02 Oct, 2020 3 commits
-
-
Kyle Keating authored
- Convert types to js - Add missing test coverage in types module
-
Robert Knight authored
Respond to PR feedback by updating comments
-
Robert Knight authored
For reasons that AFAIK are no longer relevant, there were two implementations of XPath generation for use in serializing range selectors. Since we're removing jQuery from the Hypothesis client, this removes the jQuery implementation and simplifies the remaining DOM-only one. - Remove jQuery XPath generation - Change the non-jQuery implementation to take DOM Nodes as input rather than jQuery collections - Simplify and add type documentation for the remaining implementation - Correct the documentation for `xpathFromNode`. The previous comments said that it _evaluated_ XPaths but actually it _generates_ them.
-
- 30 Sep, 2020 1 commit
-
-
Robert Knight authored
The `el` property of PDF pages was removed from PDF.js in February 2015 in eed67ea8bbba61a05877a99dc2f03b5adad5a288 so we can remove this check while still supporting older versions of PDF.js that we care about. Also rewrite an unnecessarily complex loop header. The `pagesCount` property cannot be negative, so there is no need to check for this.
-
- 29 Sep, 2020 12 commits
-
-
Kyle Keating authored
This was to be deleted with recent changes to range and xpath coffescript to js conversions but omitted by mistake at that time.
-
Robert Knight authored
-
dependabot-preview[bot] authored
Bumps [postcss](https://github.com/postcss/postcss) from 8.0.7 to 8.1.1. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.0.7...8.1.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-
dependabot-preview[bot] authored
Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 5.3.0 to 5.3.1. - [Release notes](https://github.com/puppeteer/puppeteer/releases) - [Commits](https://github.com/puppeteer/puppeteer/compare/v5.3.0...v5.3.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-
dependabot-preview[bot] authored
Bumps [preact](https://github.com/preactjs/preact) from 10.4.8 to 10.5.3. - [Release notes](https://github.com/preactjs/preact/releases) - [Commits](https://github.com/preactjs/preact/compare/10.4.8...10.5.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-
dependabot-preview[bot] authored
Bumps [vinyl](https://github.com/gulpjs/vinyl) from 2.2.0 to 2.2.1. - [Release notes](https://github.com/gulpjs/vinyl/releases) - [Commits](https://github.com/gulpjs/vinyl/compare/v2.2.0...v2.2.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-
dependabot-preview[bot] authored
Bumps [karma](https://github.com/karma-runner/karma) from 5.2.2 to 5.2.3. - [Release notes](https://github.com/karma-runner/karma/releases) - [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md) - [Commits](https://github.com/karma-runner/karma/compare/v5.2.2...v5.2.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-
dependabot-preview[bot] authored
Bumps [terser](https://github.com/terser/terser) from 5.3.2 to 5.3.3. - [Release notes](https://github.com/terser/terser/releases) - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md) - [Commits](https://github.com/terser/terser/compare/v5.3.2...v5.3.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-
dependabot-preview[bot] authored
Bumps [eslint](https://github.com/eslint/eslint) from 7.9.0 to 7.10.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.9.0...v7.10.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-
dependabot-preview[bot] authored
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.757.0 to 2.762.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js/compare/v2.757.0...v2.762.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-
dependabot-preview[bot] authored
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.20.6 to 7.21.2. - [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases) - [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md) - [Commits](https://github.com/yannickcr/eslint-plugin-react/commits) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-
dependabot-preview[bot] authored
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 2.0.17 to 2.1.1. - [Release notes](https://github.com/cure53/DOMPurify/releases) - [Commits](https://github.com/cure53/DOMPurify/compare/2.0.17...2.1.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
-