1. 03 May, 2021 24 commits
  2. 29 Apr, 2021 5 commits
  3. 28 Apr, 2021 1 commit
    • Robert Knight's avatar
      Ignore zero-height highlights when creating bucket bar buckets · e1eaca4a
      Robert Knight authored
      When a PDF page transitions from a rendered to non-rendered state the
      text layer element is removed and existing highlights in that layer
      briefly become disconnected from the document. As a result they have an
      empty/zero client rect as returned by `element.getBoundingClientRect()`.
      This caused the bucket-building logic to think that the anchor
      had moved to the top of the screen as the `top` and `bottom` coordinates
      of the anchor box became zero. This could lead to anchors which should
      be in the "below screen" bucket briefly jumping to the "above screen"
      bucket. Once re-anchoring completes and the highlight is anchored into a
      placeholder element for the non-rendered page, its anchor box becomes
      non-empty again and the anchor "jumps back" to the "below screen" box.
      
      This commit adds logic to ignore any highlights which have zero height,
      including highlight elements that are disconnected from the document.
      e1eaca4a
  4. 27 Apr, 2021 7 commits
  5. 26 Apr, 2021 3 commits
    • Robert Knight's avatar
    • Robert Knight's avatar
    • Robert Knight's avatar
      Move scroll-to-highlight logic into integrations · 9bec434d
      Robert Knight authored
      Move the logic for scrolling the content to the highlights associated
      with an anchor from `Guest` to the content-type specific integration
      (`HTMLIntegration`, `PDFIntegration`). The implementations of this logic
      in `HTMLIntegration` and `PDFIntegration` are currently the same as
      before, but in future this will allow adapting the scrolling logic to
      the content type.
      
      In the case of PDFs the logic will need to allow for the fact that an
      annotation may be re-anchored to a different element as the document is
      scrolled due to the page containing the annotation changing between an
      un-rendered and rendered state.
      
       - Add `scrollToAnchor` method to `Integration` interface and implement
         it for `HTMLIntegration`, `PDFIntegration`
       - Replace `scrollIntoView` call in guest with a call to the active
         integration's `scrollToAnchor` method
      9bec434d