1. 08 Mar, 2022 2 commits
  2. 04 Mar, 2022 3 commits
    • Lyza Danger Gardner's avatar
      Add local example document with margin-auto, max-width content area · ac8d90e2
      Lyza Danger Gardner authored
      This example can help test side-by-side mode on documents with a
      centered content area (e.g. `body` is set to `margin: 0 auto`) and a
      maximum content (`body`) width. This combination is used for some
      VitalSource EPUB books.
      ac8d90e2
    • Lyza Danger Gardner's avatar
      Make annotator component UI scale correctly to host page · 409706c3
      Lyza Danger Gardner authored
      Make certain annotator components — the adder toolbar popup, e.g. —
      scale when the root font size of the underlying host page changes.
      
      Make sure other annotator UI that is associated with the sidebar — the
      toolbar and bucket bar — do NOT scale with text scaling.
      
      All controls should scale with user/page zoom.
      409706c3
    • Robert Knight's avatar
      Inject client into newly loaded VitalSource book chapters sooner · 9481c420
      Robert Knight authored
      When a new content frame was found in VitalSource the client was only injected
      either if the frame is already loaded, or when the frame next emits a `load`
      event. In the latter case this waits until the document and its subresources
      have fully loaded. This can be slow in EPUB chapters that have a lot of images.
      Improve this by replacing the frame `load` event observer with a call to a new
      `onDocumentReady` function which fires as soon as a document becomes interactive
      (according to its `readyState`).
      
       - Rename existing `onDocumentReady` utility to `onNextDocumentReady` to
         make it clear that it only fires once, and change the implementation to
         be a wrapper around a new `onDocumentReady` function.
      
       - Add new `onDocumentReady` utility which monitors a frame for changes in the
         content document and invokes a callback each time a document becomes _ready_
         (`readyState` is `interactive` or `complete`).
      
       - Redo the tests for utilities in `frame-observer.js` so that they use
         real iframes rather than fake ones. Iframes have a complex interface
         and loading sequence, so we really need to use the real thing for
         tests to give us confidence.
      
       - Use `onDocumentReady` in the VitalSource integration to respond more quickly
         to book content loading in a new content frame.
      
       - Modify several tests for `FrameObserver`, `VitalSourceInjector` and
         `HypothesisInjector` to be less sensitive to exact timings of events,
         as these changed between the previous and new methods for detecting
         when a document is ready.
      
      Fixes https://github.com/hypothesis/client/issues/4270
      9481c420
  3. 02 Mar, 2022 13 commits
  4. 01 Mar, 2022 5 commits
    • Robert Knight's avatar
      Limit VitalSource iframe height in PDFs · bfe0e9a7
      Robert Knight authored
      VitalSource PDF books currently create very tall iframes. When a user
      scrolls through a PDF page, they are scrolling the _parent_ frame rather
      than the iframe itself. The bucket bar and scrolling logic in the client
      don't support this. The result is that:
      
       - Bucket bar buckets are in the wrong location and don't scroll as the
         user scrolls the parent frame
       - Clicking on an annotation / bucket tries to scroll only the iframe,
         not the parent frame.
      
      To resolve this we need to do at least one of:
      
      1. Support these tall iframes in the client generally
      2. Forcibly change the height of the iframe and enable the iframe to scroll
      3. Persuade VitalSource to change the iframe layout so that the content frame
         scrolls, rather than the parent frame. They previously did this for EPUBs
         already.
      
      This commit implements a version of (2). If VS later apply (3) then we can
      remove this workaround.
      bfe0e9a7
    • Robert Knight's avatar
      Add missing parameter and variable types in src/annotator/ · 24b65649
      Robert Knight authored
      Add missing types found while trying to typecheck src/annotator with
      `noImplicitAny` enabled.
      24b65649
    • Lyza Danger Gardner's avatar
    • Robert Knight's avatar
      Reduce nesting of some tests and revise descriptions · 1c76a6d4
      Robert Knight authored
       - Use "contains" rather than "returns" to describe tests of objects or
         object properties
      
       - Avoid deeply nested `describe` blocks that only contain a single test. This
         is just a preference not to have too many levels of nesting unless
         there are tests that benefit from grouping.
      
       - Revise description of tests for link properties (`link`,
         `documentFingerprint`, `favicon`) since these cover properties other
         than just `link`.
      1c76a6d4
    • Eduardo Sanz García's avatar
      Rearrange tests in `html-metadata.js` · 295a8886
      Eduardo Sanz García authored
      I have created a few additional `describe` sub-sections and re-grouped
      tests by the resulting metadata property. This allow for a more atomic
      testing.
      295a8886
  5. 28 Feb, 2022 17 commits