1. 22 Mar, 2022 2 commits
    • Robert Knight's avatar
      Reset callback before checking for absence of call · d5ace953
      Robert Knight authored
      This pattern makes it clearer that we are testing for a callback not
      being invoked after a sequence of events.
      d5ace953
    • Robert Knight's avatar
      Fix issues that could cause unexpected `onDocumentReady` firing · f7ab8ac0
      Robert Knight authored
      Fix various issues that could cause the callback to `onDocumentReady` to
      fire after the subscription had been canceled.
      
       - `pollOnUnload` was called twice for the initial document, once at the
         top level of the function and once by the first call to
         `checkForDocumentChange`. This resulted into "unload" listeners being
         added for the same window.
      
       - The initial async `checkForDocumentChange` call would still fire if
         the subscription was immediately canceled
      
       - If the current window's "unload" event fired after the subscription
         was canceled, polling would be restarted, effectively re-subscribing
         to document changes.
      f7ab8ac0
  2. 21 Mar, 2022 16 commits
  3. 17 Mar, 2022 12 commits
  4. 15 Mar, 2022 10 commits
    • Robert Knight's avatar
      Revert mousedown propagation change · 342ca159
      Robert Knight authored
      Revert the mousedown propagation change from e70287cf.
      In order to prevent VitalSource's own text selection highlight from
      appearing, it is necessary to stop propagation of both mouseup and
      mousedown events.
      342ca159
    • Robert Knight's avatar
      Make JSTOR logo open link in a new tab · 3efc33d2
      Robert Knight authored
      In the context of our LMS app, this banner is displayed inside a nested
      iframe, so it is important to open the link in a new tab.
      3efc33d2
    • Robert Knight's avatar
    • Robert Knight's avatar
      Rename `chars` => `charBoxes` · a2afcd77
      Robert Knight authored
      Use the term `charBoxes` consistently within the file and to avoid
      confusion with the `text` parameter.
      a2afcd77
    • Robert Knight's avatar
      Remove unused `glyphs` field of WordBox · df1290f0
      Robert Knight authored
      The name was out of place in this module and it was unused.
      df1290f0
    • Robert Knight's avatar
      Add tests for new geometry utilities · b4e8df7e
      Robert Knight authored
      b4e8df7e
    • Robert Knight's avatar
      Improve text selection behavior in VitalSource PDFs · 00763a2d
      Robert Knight authored
      Previously the text layer in VitalSource PDFs consisted of a set of
      absolutely positioned elements, one per word. When the user was making a
      text selection and the cursor was between words, the browser could not
      determine an appropriate caret position in the text. As a result text
      selection was tricky.
      
      Improve this by re-implementing ImageTextLayer to produce a more
      structured DOM tree. Group the characters into words, lines and columns.
      Words are laid out using inline layout into `<hypothesis-text-line>`
      elements, which are then arranged using block layouts into
      `<hypothesis-text-column>` elements. Columns are absolutely positioned.
      Within lines and columns the gaps between words and lines are fine-tuned
      using margins. This use of inline and block layouts allows the browser
      to set the selection correctly when the cursor is between words or
      lines. The visual gap between selected words has also been eliminated by
      adding inter-word spaces to the previous word.
      
       - Separate page layout analysis from DOM construction. This makes these
         elements easier to understand and improve.
      
       - Change DOM structure generated by `ImageTextLayer` to a hierarchical
         structure of words, lines and columns.
      
       - Change ImageTextLayer to use DOMRect and DOMPoint as the types for
         rect and point structs. This allows sharing of geometry utilities
         with other code.
      
       - Simplify rescaling of text layer when image size changes by
         expressing all margins, sizes and scales in the text layer in terms
         of CSS variables (`--x-scale` and `--y-scale`) defined on the root
         `<hypothesis-text-layer>` element. When the image is resized, these
         variables are simply updated to reflect the new image size.
      00763a2d
    • Lyza Danger Gardner's avatar
    • Robert Knight's avatar
      Add test page for JSTOR content banner · 01cf0efe
      Robert Knight authored
      Add a test page at http://localhost:3000/pdf/jstor that shows the JSTOR
      content banner.
      01cf0efe
    • Robert Knight's avatar
      Add facility to customize client configuration in PDF test pages · 897dcf6d
      Robert Knight authored
      Add the ability to specify custom configuration for a PDF test case by
      putting the configuration in a `<basename>.config.json` file alongside
      the PDF, where `<basename>` is the name of the PDF file minus the '.pdf'
      extension.
      897dcf6d