1. 22 Feb, 2021 11 commits
  2. 19 Feb, 2021 1 commit
    • Robert Knight's avatar
      Replace custom DOM element names in `AdderToolbar` component · ef4a0594
      Robert Knight authored
      These custom names were a method of reducing the likelihood of these
      elements being affected by the page's CSS. Since Shadow DOM support is
      now much more ubiquitous this is not an issue, so switch back to
      ordinary `<div>`s.
      
      Note that the shadow hosts still use custom element names to prevent
      them being impacted by page styles.  The elements being changed here are
      inside the shadow DOM.
      ef4a0594
  3. 18 Feb, 2021 1 commit
  4. 16 Feb, 2021 17 commits
  5. 15 Feb, 2021 7 commits
  6. 12 Feb, 2021 3 commits
    • Robert Knight's avatar
      Switch to using `<link>` elements for stylesheets in shadow DOM · 1d2eaf68
      Robert Knight authored
      When Shadow DOM was first considered for use in the client `<link
      rel="stylesheet">` was not widely supported as a way to load external styles into
      shadow roots. This was resolved in the spec in https://github.com/whatwg/html/pull/1572
      and has now long been supported by all browsers.
      
      Using `<link>` simplifies the code and also avoids a possible problem with sites
      that have a strict CSP policy that disallows inline styles. In the
      browser extension context a `<link>` can still work in that scenario as long as the
      stylesheet is loaded from a `chrome-extension://` URL.
      1d2eaf68
    • Robert Knight's avatar
      Move notebook container into shadow DOM · ff5918d6
      Robert Knight authored
      Follow the example of the `<hypothesis-sidebar>` element by making the
      `<hypothesis-notebook>` element an unstyled shadow-host which serves as
      the root container for the notebook, isolating it from the page's
      styles. Inside this is a styled element which serves as the visual
      container.
      
      As well as isolating the notebook from the host page's styles, this will
      also make it possible to avoid loading annotator styles into the host
      page. See https://github.com/hypothesis/client/issues/2979.
      
      To reduce resource usage a little when the notebook is not used, only
      the notebook's shadow host is created initially. The styled inner
      container is created when the notebook is shown for the first time.
      ff5918d6
    • Lyza Danger Gardner's avatar
      66cf493a