Giter VIP home page Giter VIP logo

Comments (11)

JayPanoz avatar JayPanoz commented on June 11, 2024

I may have found a way to handle both

<span id="page001" title="1" epub:type="pagebreak"/>

and

<span epub:type="pagebreak" id="page001" class="whatever">1</span>

using some weird selectors e.g. [epub|type="pagebreak"]:not(:empty) and [epub|type="pagebreak"][title]:empty. If there is whitespace though, :empty won’t work..

from readium-css.

JayPanoz avatar JayPanoz commented on June 11, 2024

high page numbers → there is a possibility the margin could not be large enough to accommodate 3+ numbers very well

capture d ecran 2018-05-01 a 16 50 02

One possibility there, as 2+ digits can already be an issue on small and narrow screens, and 3+ digits on desktop would be to lay out page numbers with a writing-mode of vertical-lr (or a rotate transform).

capture d ecran 2018-05-01 a 16 49 38

That could also solve

kind of an edge case but we should also probably take into account that numbers in margins can also be used to number lines or paragraphs in some publications (plays, STEM, etc.).

Now,

should the font-size increase with the content’s?

Probably not, given the issue illustrated above.

from readium-css.

llemeurfr avatar llemeurfr commented on June 11, 2024

I must say I like this vertical solution, as it also avoid confusion with synthetic page numbers in the footer and may accomodate other (longer) strings included as "page-breaks".

from readium-css.

danielweck avatar danielweck commented on June 11, 2024

In reply to @JayPanoz :

If there is whitespace though, :empty won’t work.

Yes, until perhaps when CSS text-space-collapse: discard is supported? https://drafts.csswg.org/css-text-4/#white-space-collapsing

from readium-css.

JayPanoz avatar JayPanoz commented on June 11, 2024

To be honest, I was more focused on the :blank pseudo class, which builds upon :empty (cf. css-tricks), longer-term, but that could be another option.

from readium-css.

JayPanoz avatar JayPanoz commented on June 11, 2024

Quick question though: wouldn’t this (using pseudo elements) mess with the DOM Range?

from readium-css.

JayPanoz avatar JayPanoz commented on June 11, 2024

For further reference, here is the whitespace we get @ 1 and 0.5 (page margin setting) on a smartphone…

screenshot_20180516-100224

screenshot_20180516-100252

A factor of 1 (default) will already be quite difficult to deal with, 0.5 seems quite frankly impossible.

from readium-css.

JayPanoz avatar JayPanoz commented on June 11, 2024

From page numbering best practices

go to page functionality is a must, but announcement of page numbers while reading is optional.

This will at the very least require we alter the DOM at runtime depending on the user pref, e.g. announcement on:

<span epub:type="pagebreak" id="page001" class="whatever">1</span>

Announcement off:

<span epub:type="pagebreak" id="page001" class="whatever" aria-hidden="true">1</span>

There’s no way we can manage that using speak: none in CSS given its support.

Please note we shouldn’t even try using aria-label on the other markup, as it generally won’t work across all browser/assistive technology combinations with a span

Of course if we feed the speech API via JS for TTS, we can ignore/include epub:type="pagebreak" but for app developers willing to rely entirely on the native TTS, we need a solution.

from readium-css.

danielweck avatar danielweck commented on June 11, 2024

Note that the notion of "skipping" elements during linear reading order / audio playback progression is documented in EPUB3 Media Overlays: http://www.idpf.org/epub/31/spec/epub-mediaoverlays.html#sec-skippability
This concept ; as Avneesh Singh alluded to in the aforementioned discussion thread ( w3c/publ-cg#43 (comment) ) ; actually originates from the DAISY specification for Digital Talking Books, which in fact provides content creators finer "skippability" control, compared with EPUB3 MO (in other words, the EPUB3 "read aloud" functionality is slightly less capable, due to simplification necessities).

As @JayPanoz said, a general-purpose screen reader (e.g. NVDA, Jaws, Narrator, etc.) will usually not be capable of inferring the "skippable" nature of DOM elements, unlike the dedicated TTS sub-system of a reading app which would typically associate epub:type="pagebreak" with skippability semantics ... thus why aria-hidden + CSS display: none might well be the only true "portable" solution.

from readium-css.

garconvacher avatar garconvacher commented on June 11, 2024

(Off topic about aria-label in span with screen readers)
We needed to use this technique for a particular case a year ago and we adopted it after some positive tests:

  • NVDA / Readium Chrome's extension (fresh test: Readium Desktop is fine too)
  • VoiceOver / Lisa Reader (iBooks is buggy, read the 'alt' span sometimes but didn't most of time)
  • Talkback / several readers.

from readium-css.

JayPanoz avatar JayPanoz commented on June 11, 2024

As discussed during the Readium Engineering Call on June 3rd, we think it’s better to let Reading Systems handle these styles as implementations may vary. Daniel summed the situation up in his comment above, so we’re closing this issue.

from readium-css.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.