diff --git a/CHANGELOG.md b/CHANGELOG.md index 82b2c8675..98f259e2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,8 @@ The release run heads these entries with the version and opens a fresh - **Fix**: selecting text in a pdf view showed the invisible layer that carries it, as a second set of glyphs over the drawn ones. That layer now stays - transparent under `::selection`. + transparent under `::selection`, and states the highlight background, which + an author `::selection` otherwise drops. - A tap opens a sheet cell's editor where the pointer is coarse, so a phone needs one tap rather than a double tap. A mouse keeps the double click. diff --git a/src/odr/internal/html/pdf_file.cpp b/src/odr/internal/html/pdf_file.cpp index ba3330e15..13d358f95 100644 --- a/src/odr/internal/html/pdf_file.cpp +++ b/src/odr/internal/html/pdf_file.cpp @@ -1818,8 +1818,10 @@ class HtmlServiceImpl final : public HtmlService { // Transparent text for the selection layer line blocks. out.out() << ".i{color:transparent;font-family:sf,sans-serif}"; // A selection paints text in the highlight's own colour, which beats - // `transparent` and shows this layer over the glyph layer it stands for. - out.out() << ".i::selection,.i *::selection{color:transparent}"; + // `transparent` and shows this layer over the glyphs it stands for. An + // author `::selection` drops the UA background, so state that too. + out.out() << ".i::selection,.i *::selection" + "{color:transparent;background-color:Highlight}"; // Selection-layer run span. `overflow:hidden` clips a wider system font; // `.t`'s inherited `pre` blocks wrapping while preserving a run's own // leading/trailing space, which is real PDF content. @@ -2290,11 +2292,12 @@ class HtmlServiceImpl final : public HtmlService { // height, while clipping nothing (the space is transparent). out.out() << ".sp{display:inline-block;" "color:transparent;vertical-align:baseline}"; - // A selection paints text in the highlight's own colour, which beats - // `transparent`. `*` reaches a run's own span and a search `mark`. + // As `.i` in the dual layer above, with `*` reaching a run's own span + // and a search `mark`. out.out() << ".i::selection,.i *::selection," ".ov::selection,.ov *::selection," - ".sp::selection,.sp *::selection{color:transparent}"; + ".sp::selection,.sp *::selection" + "{color:transparent;background-color:Highlight}"; // A hit in the overlay is clipped away with it, so the glyphs it belongs // to carry the highlight instead - the whole run of them, which is as // narrow as the overlay can say. @@ -2870,7 +2873,8 @@ class HtmlServiceImpl final : public HtmlService { // The same guard for a line the embedded font makes invisible; the dual // layer's `fnN` rides a `user-select:none` run and needs none. font_styles += ".fn" + n + "::selection,.fn" + n + - " *::selection{color:transparent}"; + " *::selection" + "{color:transparent;background-color:Highlight}"; } }