Movatterモバイル変換


[0]ホーム

URL:


W3CW3C Member Submission

EPUB Content Documents 3.1

W3C Member Submission

This version:
https://www.w3.org/submissions/2017/SUBM-epub-contentdocs-20170125/
Latest published version:
https://www.w3.org/submissions/epub-contentdocs/
Editors:
Markus Gylling,International Digital Publishing Forum (IDPF)
William McCoy,International Digital Publishing Forum (IDPF)
Dave Cramer,Hachette Book Group
Elika J. Etemad, Invited Expert
Matt Garrish, Invited Expert

Copyright © 2017. This document is available under theW3C Document License. See theW3C Intellectual Rights Notice and Legal Disclaimers for additional information.


Abstract

EPUB Content Documents 3.1 specifies a usage of HTML, SVG and CSS optimized for representation of structured, composable, and accessible documents.

Status of This Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of currentW3C publications can be found in theW3C technical reports index at https://www.w3.org/TR/.

By publishing this document,W3C acknowledges that theSubmitting Members have made a formal Submission request toW3C for discussion. Publication of this document byW3C indicates no endorsement of its content byW3C, nor thatW3C has, is, or will be allocating any resources to the issues addressed by it. This document is not the product of a charteredW3C group, but is published as potential input to theW3C Process. AW3C Team Comment has been published in conjunction with this Member Submission. Publication of acknowledged Member Submissions at theW3C site is one of the benefits ofW3C Membership. Please consult the requirements associated with Member Submissions ofsection 3.3 of theW3C Patent Policy. Please consult the completelist of acknowledgedW3C Member Submissions.

1.  Overview

1.1  Purpose and Scope

This section is non-normative.

This specification, EPUB Content Documents 3.1, defines profiles of HTML, SVG, and CSS for use in the context ofEPUB® Publications.

This specification is one of afamily of specifications that compose[EPUB 3.1], an interchange and delivery format for digital publications based on XML and Web Standards. It is meant to be read and understood in concert with the other specifications that make up EPUB 3.1.

Refer to[EPUB3 Changes] for more information on the differences between this specification and its predecessor.

1.2  Relationship to Other Specifications

This section is non-normative.

1.2.1  Relationship to HTML

This specification does not reference a specific version ofW3C[HTML], but instead uses an undated reference that will always point to the latest recommendation. This approach ensures that EPUB will always keep pace with changes to the HTML standard. Authors and Reading System developers will need to keep track of changes to HTML, and ensure that their processes and systems are kept up to date.

Caution

As HTML evolves, it is possible that features that were valid in previous versions could become obsolete or be removed. IDPF anticipates that theW3C will make any such changes carefully to ensure minimal disruption for Authors, but in the case of a backwards-incompatible revision the use of an undated reference could be revisited.

TheXHTML profile defined by this specification inherits all definitions of semantics, structure and processing behaviors from[HTML] unless otherwise specified.

In addition, this specificationdefines a set of extensions to theW3C HTML document model thatAuthors can include inXHTML Content Documents.

This specification does not requireEPUB Reading Systems to support scripting, HTML forms or the HTML DOM. Reading Systems conformant with this specification are only expected to be able to process a conformingEPUB Content Document. Assupport for scripting and HTML forms is not compulsory, a conformant Reading System might not be a fully-conformant HTML user agent.

1.2.2  Relationship to SVG

This specification does not reference a specific version of[SVG], but instead uses an undated reference that will always point to the latest recommendation. This approach ensures that EPUB will always keep pace with changes to the SVG standard. Authors and Reading System developers will need to keep track of changes to the SVG standard, and ensure that their processes and systems are kept up to date.

Caution

As SVG evolves, it is possible that features that were valid in previous versions could become obsolete or be removed. IDPF anticipates that theW3C will make any such changes carefully to ensure minimal disruption for Authors, but in the case of a backwards-incompatible revision the use of an undated reference could be revisited.

1.2.3  Relationship to CSS

EPUB 3.1 supports CSS as defined by the CSS Working Group Snapshot[CSS Snapshot]. EPUB 3.1 also maintains some prefixed CSS properties, to ensure consistent support for global languages.

1.3  Terminology

Terms with meanings specific to EPUB 3.1 are capitalized in this document (e.g., "Author", "Reading System"). A complete list of theseterms and definitions is provided in[EPUB 3.1].

Only the first instance of a term in a section is linked to its definition.

1.4  Conformance Statements

The keywordsMUST,MUST NOT,REQUIRED,SHALL,SHALL NOT,SHOULD,SHOULD NOT,RECOMMENDED,MAY, andOPTIONAL in this document are to be interpreted as described in[RFC2119].

All sections and appendixes of this specification are normative except where identified by the informative status label "This section is informative". The application of informative status to sections and appendixes applies to all child content and subsections they contain.

All examples in this specification are informative.

1.5  Namespace prefix mapping

For convenience, the following namespace prefixes[XMLNS] are used in this specification without explicitly being declared. To use any of these prefixes in anEPUB Content Document, a declaration isREQUIRED.

prefixURI
epubhttp://www.idpf.org/2007/ops
plshttps://www.w3.org/2005/01/pronunciation-lexicon
ssmlhttps://www.w3.org/2001/10/synthesis

2.  XHTML Content Documents

2.1  Introduction

This section defines a profile of[HTML] for creating XHTML Content Documents. An instance of an XML document that conforms to this profile is aCore Media Type Resource and is referred to in this specification as anXHTML Content Document.

Unless otherwise specified, this specification inherits all definitions of semantics, structure and processing behaviors from the[HTML] specification.

2.2  Content Conformance

AnXHTML Content DocumentMUST meet all of the following criteria:

Document Properties

ItMUST be an[HTML] document that conforms to theXHTML syntax.

ItMUST meet the conformance constraints for XML documents defined inXML Conformance[EPUB 3.1].

For all document constructs used that are defined by[HTML], itMUST conform to the conformance criteria defined for those constructs in that specification, unless explicitly overridden inHTML Deviations and Constraints.

ItMAY include extensions to the[HTML] grammar as defined inHTML Extensions, andMUST conform to all content conformance constraints defined therein.

Note

The recommendation that EPUB Publications follow the accessibility requirements in[EPUB Accessibility] applies to XHTML Content Documents. SeeAccessibility[EPUB 3.1].

File Properties

The XHTML Content Document filenameSHOULD use the file extension.xhtml

2.3  Reading System Conformance

A conformantEPUB Reading SystemMUST meet all of the following criteria for processingXHTML Content Documents:

2.4  HTML Extensions

This section defines EPUB 3.1XHTML Content Document extensions to the underlying[HTML] document model.

Note

Although[HTML] allows user agents to supportvendor-neutral extensions, unless such extensions are listed in this section they are not supported features of EPUB 3.1.

2.4.1  Semantic Inflection

2.4.1.1  Introduction

This section is non-normative.

Semantic inflection is the process of attaching additional meaning about the specific purpose and/or nature an element plays in anXHTML Content Document. Theepub:type attribute is used to express domain-specific semantics in XHTML Content Documents, with the inflection(s) it carries complementing the underlying[HTML] vocabulary.

The applied semantics are intended to refine the meaning of their containing elements; they are not provided to override their nature (e.g., the attribute can be used to indicate asection is a chapter in a work, but is not designed to turnp elements into list items to avoid proper list structures).

Semantic metadata is not intended for direct human consumption; it instead provides a controlled way for Reading Systems to learn more about the structure and content of a document, providing them the opportunity to enhance the reading experience for users.

This specification defines a method for semantic inflection usingthe attribute axis: instead of adding new elements, theepub:type attribute can be appended to existing elements to inflect the desired semantics. A mechanism to identify external vocabularies that provide controlled values for the attributes is also defined.

2.4.1.2  The epub:type Attribute
Attribute Name

type

Namespace

http://www.idpf.org/2007/ops

Usage

Global attribute.MAY be specified on all elements.

Value

A white space-separated list ofproperty[Packages 3.1] values, with restrictions as defined inVocabulary Association.

White space is the set of characters as defined in[XML].

Theepub:type attribute inflects semantics on the element on which it appears. Its value is one or more white space-separated terms stemming from external vocabularies associated with the document instance, as defined inVocabulary Association.

The inflected semanticMUST express a subclass of the semantic of the carrying element. In the case of semantically neutral elements, such as the[HTML]div andspan elements, the inflected semanticMUST NOT attach a meaning that is already conveyed by an existing element (e.g., that adiv represents a paragraph or section). Reading SystemsMUSTignore inflected semantics that conflict with the carrying element.

As the[HTML]head element contains metadata for the document, structural semantics expressed on this element or any descendant of it have no meaning. Reading SystemsMUST ignore such semantics.

Examples

The following example shows how a preamble could be marked up with theepub:type attribute on its containing[HTML]section element.

<htmlxmlns:epub="http://www.idpf.org/2007/ops"><sectionepub:type="preamble"></section></html>

The following example shows theepub:type attribute used to add glossary semantics on an[HTML] definition list.

<htmlxmlns:epub="http://www.idpf.org/2007/ops"><dlepub:type="glossary"></dl></html>

The following example shows theepub:type attribute used to add pagebreak semantics.

<htmlxmlns:epub="http://www.idpf.org/2007/ops"><p><spanepub:type="pagebreak"title="234"id="p234"/></p></html>
2.4.1.3  Vocabulary Association

This specification adopts the vocabulary association mechanisms defined inVocabulary Association Mechanisms[Packages 3.1], with the following modifications:

Default Vocabulary

The default vocabulary for Content Documents is defined to be theEPUB 3 Structural Semantics Vocabulary.

Reserved Prefixes

The reserved prefixes that AuthorsMAY use in theepub:type attribute without having to declare are defined in[Reserved Prefixes].

The prefix Attribute

Theprefix attribute definition is unchanged, but the attribute is defined to be in the namespacehttp://www.idpf.org/2007/ops when used in EPUB Content Documents.

Theprefix attribute is only valid on the[HTML] roothtml element.

2.4.1.4  Processing Requirements

A Reading SystemMUST process theepub:type attribute as follows:

  • ItMAY associate behaviors with none, some or all of the terms defined in thedefault vocabulary.

  • ItMAY associate behaviors with terms from other vocabularies.

  • ItMUST ignore terms that it does not recognize.

When Reading System behavior associated with a givenepub:type value conflicts with an element's native behavior, the behavior associated with the elementMUST be given precedence.

2.4.2  Semantic Enrichment

2.4.2.1  Introduction

This section is non-normative.

Unlikesemantic inflection, which is about refining the structures within the markup, semantic enrichment enables the layering of meaning into the content in order to facilitate machine processing.

The[Microdata] and[RDFa 1.1] specifications both define sets of attributes that can be used inXHTML Content Documents to semantically enrich the content.

2.4.2.2  RDFa

The use of[RDFa 1.1] attributes is allowed inXHTML Content Documents, but any usageMUST conform to the requirements defined in[HTML+RDFa11].

The[RDFa 1.1] specification defines changes to the[HTML] content model when RDFa attributes are used. This modified content model is valid in XHTML Content Documents.

EPUB Reading System support for theattribute processing model[RDFa 1.1] isOPTIONAL.

2.4.2.3  Microdata

The use of[Microdata] attributes is allowed inXHTML Content Documents, but any usageMUST conform to the requirements defined in that specification.

The[Microdata] specification defines changes to the[HTML] content model when Microdata attributes are used. This modified content model is valid in XHTML Content Documents.

EPUB Reading System support for theattribute processing model isOPTIONAL, as is theconversion to JSON[Microdata]. Furthermore, theDOM API[Microdata] is alsoOPTIONAL, even if the attribute processing model is supported.

2.4.3  SSML Attributes

2.4.3.1  Introduction

TheW3C Speech Synthesis Markup Language[SSML] is a language used for assistingText-to-Speech (TTS) engines in generating synthetic speech. Although SSML is designed as a standalone document type, it also defines semantics suitable for use within other markup languages.

This specification recasts the[SSML]phoneme element as two attributes —ssml:ph andssml:alphabet — and makes them available within XHTML Content Documents.

Reading Systems withText-to-Speech (TTS) capabilitiesSHOULD support the SSML Attributes as defined below.

Note

For more information on EPUB 3.1 features related to synthetic speech, refer toText-to-speech[EPUB3 Overview].

2.4.3.2  The ssml:ph attribute

Thessml:ph attribute specifies a phonemic/phonetic pronunciation of the text represented by the element to which the attribute is attached.

Attribute Name

ph

Namespace

https://www.w3.org/2001/10/synthesis

Usage

Global attribute.MAY be specified on all elements with which a phonetic equivalent can logically be associated (e.g., elements that contain textual information).

MUST NOT be specified on a descendant of an element that already carries this attribute.

Value

A phonemic/phonetic expression, syntactically valid with respect tothe phonemic/phonetic alphabet being used.

This attribute inherits all the semantics of the[SSML]phoneme elementph attribute, with the following addition:

  • When thessml:ph attribute appears on an element that has text node descendants, the corresponding document text to which the pronunciation applies is the string that results from concatenating the descendant text nodes, in document order. The specified phonetic pronunciationMUST therefore logically match the element's textual data in its entirety (i.e., not just an isolated part of its content).

Reading Systems that support the SSML Attributes andPLS DocumentsMUST honor the definedprecedence rules for these two constructs.

2.4.3.3  The ssml:alphabet attribute

Thessml:alphabet attribute specifies which phonemic/phonetic pronunciation alphabet is used in the value of thessml:ph attribute.

Attribute Name

alphabet

Namespace

https://www.w3.org/2001/10/synthesis

Usage

Global attribute.MAY be specified on any element.

Value

The name of the pronunciation alphabet used in the value ofssml:ph (inherited).

This attribute inherits all the semantics of the[SSML]phoneme elementalphabet attribute, with the following addition:

  • The value of thessml:alphabet attribute is inherited in the document tree. The pronunciation alphabet used in a givenssml:ph attribute value is determined by locating the first occurrence of thessml:alphabet attribute starting with the element on which thessml:ph attribute appears, followed by the nearest ancestor element.

Note

Reading Systems that support theSSML Attributes feature of this specificationSHOULD support the IPA alphabet[IPA], as expressed by the value "ipa".

2.4.4  Alternate Style Tags

In accordance with[Alt Style Tags] , thelink elementclass attributeMAY include any of the following values:horizontal,vertical,day andnight. These values inherit the semantics defined by that specification for their use.

Reading SystemsSHOULD select and utilize such tagged style sets as appropriate, and as described in that specification.

2.4.5  Custom Attributes

Reading SystemsMAY introduce functionality not defined in this specification to enhance the rendering ofEPUB Publications. To facilitate this experimentation, vendorsMAY define custom attributes for use inXHTML Content Documents.

Custom attributesMAY be included on any element in an XHTML Content Document provided such attributes are from a foreign namespace, which is defined as a namespace[XMLNS] that does not map to either of the following URIs:

  • http://www.w3.org/1999/xhtml

  • http://www.idpf.org/2007/ops

Custom attributes, and the behaviors associated with them,MUST NOT alter the integrity of an EPUB Publication. The contentMUST remain consumable by a user without any information loss or other significant deterioration, regardless of the Reading System it is rendered on.

Note

To facilitate interoperability of custom attributes across Reading Systems, vendors are strongly encouraged to document any extensions they implement in[Attribute Extensions].

2.5  HTML Deviations and Constraints

This section defines deviations from, and constraints on, the underlying[HTML] document model applicable to EPUB 3.1XHTML Content Documents.

2.5.1  Embedded MathML

2.5.1.1  Introduction

This section is non-normative.

XHTML Content Documents support embedded[MATHML] but limit its usage to a restricted subset of the full MathML markup language.

This subset is designed to ease the implementation burden on Reading Systems and to promote accessibility, while retaining compatibility with[HTML] user agents.

Note

Themathml property[Manifest Vocab] of themanifestitem element indicates that an XHTML Content Document contains embedded MathML.

2.5.1.2  Content Conformance

Any occurrence of MathML markup in XHTML Content DocumentsMUST conform to the constraints expressed in the MathML specification[MATHML], with the following additional restrictions:

Presentation MathML

Themath elementMUST contain onlyPresentation MathML, with the exception of theannotation-xml element as defined below.

Content MathML

Content MathMLMAY be included within MathML markup in XHTML Content Documents, and, when present,MUST occur within anannotation-xml child element of ansemantics element.

When Content MathML is included as per the previous condition, the givenannotation-xml element'sencoding attributeMUST be set to either of the functionally-equivalent valuesMathML-Content orapplication/mathml-content+xml, and itsname attributeMUST be set tocontentequiv.

Deprecated MathML

Elements and attributes marked as deprecated in[MATHML]MUST NOT be included within MathML markup in XHTML Content Documents.

XHTML Content Document fragments

XHTML Content Document fragmentsMAY be included within MathML markup in XHTML Content Documents, and, when present,MUST occur within anannotation-xml child element of ansemantics element.

When an XHTML Content Document fragment is included as per the above paragraph, the givenannotation-xml element'sencoding attributeMUST be set toapplication/xhtml+xml and itsname attributeMUST be set toalternate-representation.

Any included XHTML Content Document fragmentsMUST NOT themselves contain MathML markup.

Any included XHTML Content Document fragmentsMUST conform to the content model in which the ancestormath element occurs, such that if themath element is replaced by the given XHTML Content Document fragment the document remains valid.

2.5.1.3  Reading System Conformance

A conformantEPUB Reading SystemMUST meet all of the following criteria for processing MathML embedded in XHTML Content Documents:

2.5.1.4  Fallback Content

As Reading System support for MathML rendering is inconsistent,Authors are encouraged to provide a fallback image using thealtimg attribute on themath element. It isRECOMMENDED that the dimension and alignment attributes (altimg-width,altimg-height andaltimg-valign) be used in conjunction with thealtimg attribute.

Note

Fallback images have conform to the constraints for Publication Resources defined inEPUB Publication Conformance[EPUB 3.1].

2.5.2  Embedded SVG

XHTML Content Documents support the embedding ofSVG document fragmentsby reference (embedding via reference, for example, from animg orobject element) andby inclusion (embedding via direct inclusion of thesvg element in the XHTML Content Document)[SVG].

The content conformance constraints for SVG embedded in XHTML Content Documents are the same as defined forSVG Content Documents inRestrictions on SVG.

Reading SystemsMUST process SVG embedded in XHTML Content Documents as defined inSVG Content Documents — Reading System Conformance.

Note

Thesvg property[Manifest Vocab] of themanifestitem element indicates that an XHTML Content Document contains embedded SVG.

2.5.2.1  Embedded SVG and CSS

For the purposes of styling SVG embedded in XHTML Content Documentsby reference, Reading SystemsMUST NOT apply CSS style rules of the containing document to the referenced SVG document.

For the purposes of styling SVG embedded in XHTML Content Documentsby inclusion, Reading SystemsMUST apply applicable CSS rules of the containing document to the included SVG elements.

Note

SVG includedby reference is processed as a separate document, and can include its own CSS style rules just like anSVG Content Document would. Note that this is consistent with situations where an[HTML]object element references an external[HTML] element.

2.5.3  Unicode Restrictions

This section lists restrictions on the Unicode character repertoire.

Private Use Characters and Embedded Fonts

Any included characters that map to a code point within one of the Private Use Area (PUA) ranges as defined in[Unicode]MUST occur within a string that is styled or attributed in a manner that includes a reference to an embedded font[CSS3 Fonts] that contains an appropriate glyph for that code point.

2.5.4  Discouraged Constructs

This section is non-normative.

2.5.4.1  The rp Element

The[HTML]rp element is intended to provide a fallback for older versionReading Systems that do not recognize ruby markup (i.e., a parenthesis display aroundruby markup). As EPUB 3.1 Reading Systems are ruby-aware, and can provide fallbacks, the use ofrp elements is discouraged.

2.5.4.2  The embed Element

Since the[HTML]embed element does not include intrinsic facilities to providefallbacks for Reading Systems that do not support scripting,Authors are discouraged from using the element when the referenced resource includes scripting. Theobject element can be used instead, as it includes intrinsic fallback capabilities.

2.5.5  Foreign Resource Restrictions

Foreign ResourcesMAY be referenced from elements that have intrinsic fallback mechanisms, where an intrinsic fallback method is the capability to offer an alternative presentation if the foreign resource is not supported. For example, most[HTML]embedded content elements provide options for alternative rendering, such as allowing multiple sources to be specified or allowing embedded HTML content for when a resource cannot be rendered. ACore Media Type Resource or embedded HTML contentMUST be provided via the given element's intrinsic fallback mechanism when a Foreign Resource is referenced.

Flow contentMAY be embedded within the[HTML]audio andvideo elements for rendering in older Reading Systems that do not recognize these elements (e.g., EPUB 2 Reading Systems), but it does not represent a Core Media Type fallback.

The following[HTML] elements are exempt fromCore Media Type requirements[EPUB 3.1]:

Foreign ResourcesMAY be referenced from the above elements without the provision of a Core Media Type fallback.

Note

Refer tomanifest fallbacks[Packages 3.1] for the provision of fallbacks for elements without intrinsic mechanisms, such as the[HTML]iframe andimg elements.

3.  SVG Content Documents

Caution

Some features of[SVG] are not fully supported inReading Systems, or supported across all platforms on which Reading Systems run. When utilizing such features,Authors need to consider the inherent risks in terms of the potential impact on interoperability and document longevity.

3.1  Introduction

This section is non-normative.

The Scalable Vector Graphics (SVG) specification[SVG] defines a format for representing final-form vector graphics and text.

Although an EPUB Publication typically usesXHTML Content Documents as thetop-level document type, the use ofSVG Content Documents is also permitted. SVGs are typically only used in certain special circumstances, such as when final-form page images are the only suitable representation of the content (e.g., in the context of manga or comic books).

This section defines a profile for[SVG] documents. An instance of an XML document that conforms to this profile is aCore Media Type Resource and is referred to in this specification as anSVG Content Document.

Note

This section defines conformance requirements forSVG Content Documents. Refer toEmbedded SVG for conformance requirements for SVG embedded in XHTML Content Documents.

3.2  Content Conformance

AnSVG Content DocumentMUST meet all of the following criteria:

Document Properties

ItMUST meet the conformance constraints for XML documents defined inXML Conformance[EPUB 3.1].

ItMAY include references toForeign Resources provided a fallback to aCore Media Type Resource is included.

ItMUST be anSVG document fragment[SVG], and conform to all content conformance constraints expressed inRestrictions on SVG.

Note

The recommendation that EPUB Publications follow the accessibility requirements in[EPUB Accessibility] applies to SVG Content Documents. SeeAccessibility[EPUB 3.1].

File Properties

The SVG Content Document filenameSHOULD use the file extension.svg.

3.3  Restrictions on SVG

This specification restricts the content model ofSVG Content Documents andSVG embedded in XHTML Content Documents as follows:

3.4  Reading System Conformance

A conformantEPUB Reading SystemMUST meet all of the following criteria for processing SVG Content Documents and SVGembedded in XHTML Content Documents:

  • Unless explicitly defined by this specification as overridden, itMUST process SVG Content Documents using semantics defined by the[SVG] specification and honor any applicable user agent conformance constraints expressed therein.

  • ItMUST meet the Reading System conformance criteria defined inScripted Content Documents — Reading System Conformance.

  • If it has aViewport, itMUST support the visual rendering of SVG using CSS as defined inStyling[SVG], and itSHOULD support all properties defined inProperty Index[SVG]. In the case of embedded SVG, itMUST also conform to the constraints defined inEmbedded SVG and CSS.

  • ItSHOULD support user selection and searching of text within SVG elements.

  • ItMUST recognize the value "http://www.idpf.org/2007/ops" of therequiredExtensions attribute as representing the occurrence of XHTML Content Document fragments (e.g., when the attribute is included on theforeignObject element or children of theswitch element).

3.5  Semantic Inflection

The syntax and semantics defined inXHTML Semantic Inflection are inherited for use of theepub:type andepub:prefix attributes inSVG Content Documents.

The use of theepub:prefix attribute is only valid on the rootsvg element in SVG Content Documents. Prefixes used inembedded SVGMUST be declared on the[HTML] roothtml element, as defined inXHTML Semantic Inflection.

4.  CSS Style Sheets

4.1  Introduction

This section is non-normative.

CSS has been an integral part of the Open Web Platform for nearly two decades — readers, publishers, and document authors expect CSS to "just work," as they expect HTML to just work.

In the past, EPUB defined a profile of CSS that mandated support for certain properties and provided prefixed versions of numerous other properties. Although the CSS Working Group no longer recommends the use of prefixed properties, this specification has to maintain some prefixed properties to avoid breaking existing content. But with the minor exceptions defined in this section, EPUB defers to theW3C to define CSS.

4.2  Content Conformance

A conformant CSS style sheetMUST meet all of the following criteria:

Note

Keep in mind that someReading Systems will not support all desired features of CSS. In particular, the following are known to be problematic:

  • Reading System-induced pagination can interact poorly with style sheets. Pagination is sometimes done using columns, which can result in incorrect values for viewport sizes. Fixed and absolute positioning are particularly problematic.

  • Some types of screens will render animations and transitions poorly (e.g., those with high latency).

4.3  Reading System Conformance

A conformantEPUB Reading SystemMUST meet all of the following criteria for processing CSS Style Sheets:

Reading System developers are encouraged to implement CSS support at the level of major browsers.

4.4  Prefixed Properties

Caution

Authors are strongly encouraged to use unprefixed properties, andReading Systems to support current CSS specifications. The widely-used prefixed properties from[Content Docs 3.0.1] have been retained, but support for the other properties has been removed. Authors are advised to use CSS-native solutions for the removed properties where and when they are available.

Authors currently using these prefixed properties are advised to move to unprefixed versions as soon as support allows, as these properties are not anticipated to be supported in the next major version of EPUB.

4.4.1  CSS Writing Modes

The following table lists the-epub- prefixed properties for[CSS3 Writing Modes]. The Value column indicates the value the property accepts. The Prior EPUB Mapping column indicates values/properties that were used in previous versions of EPUB 3. An asterisk (*) denotes that the older property or value is now deprecated. The final column describes how to implement the prefixed property based on[CSS3 Writing Modes-20151215].

PropertyValuePrior EPUB MappingMapping to[CSS3 Writing Modes-20151215]
-epub-text-orientationuprightuprightupright
-epub-text-orientationmixedvertical-right*mixed
-epub-text-orientationsideways-rightsideways-rightsideways
-epub-text-orientationsideways-rightrotate-right*sideways
-epub-text-orientationsidewaysrotate-normal*sideways
-epub-text-orientationsidewayssidewayssideways
-epub-text-orientationmixedmixedmixed
-epub-writing-modehorizontal-tbhorizontal-tbhorizontal-tb
-epub-writing-modevertical-rlvertical-rlvertical-rl
-epub-writing-modevertical-lrvertical-lrvertical-lr
-epub-text-combine*-epub-text-combine-horizontal: nonenonetext-combine-upright: none
-epub-text-combine*-epub-text-combine-horizontal: allhorizontaltext-combine-upright: all
-epub-text-combine*Errorhorizontal <number>text-combine-upright: digits <number>

4.4.2  CSS Text Level 3

PropertyValueMapping to[CSS3 Text-20160119]
-epub-hyphensnone | manual | autoNo Change
-epub-hyphensallNot Supported
-epub-line-breakauto | loose | normal | strictNo Change
-epub-text-align-lastauto | start | end | left | right | center | justifyNo Change
-epub-word-breaknormal | keep-all | break-allNo Change
text-transform-epub-fullwidthtext-transform: full-width

4.4.3  CSS Text Decoration Level 3

PropertyValueMapping to[CSS3 Text Decoration]
-epub-text-emphasis-color<color>No Change
-epub-text-emphasis-position[ over | under ] && [ right | left ]No Change
-epub-text-emphasis-stylenone | [ [ filled | open ] || [ dot | circle | double-circle | triangle | sesame ] ] | <string>No Change
-epub-text-underline-positionauto | [ under || [ left | right ] ]No Change
-epub-text-underline-positionalphabetictext-underline-position: auto

Property value syntax defined inComponent value combinators[CSS3 Values and Units].

4.5  Reading System Overrides

EPUB Reading SystemsSHOULD applyAuthor style sheets as written toEPUB Content Documents. If a Reading System allows, usersSHOULD be able to override Author style sheets as desired. EPUB Reading SystemsSHOULD NOT override Author style sheets unless strictly necessary.

If a Reading System has to override an Author style sheet, itSHOULD do so in a way that preserves the Cascade: through a user agent style sheet, thegetOverrideStyle method[DOM2 Style], or[HTML]style attributes.

Developers of Reading Systems are strongly encouraged to publicly document their user agent style sheets and how they interact with Author style sheets.

5.  Scripting

5.1  Scripting Contexts

EPUB Content DocumentsMAY contain scripting using the facilities defined for this in the respective underlying specifications ([HTML] and[SVG]). When an EPUB Content Document contains scripting, it is referred to in this specification as aScripted Content Document. This label also applies toXHTML Content Documents when they contain instances of[HTML]forms.

This specification defines two contexts in which scriptsMAY appear:

spine-level

An instance of the[HTML]script or[SVG]script element included in aTop-level Content Document.

container-constrained

Either of the following:

In both of the above-defined contexts, whether the JavaScript code is embedded directly in thescript element or referenced via itssrc attribute makes no difference to the executing context.

Which context a script is used in determines the rights and restrictions that a Reading System places on it. Refer toContent Conformance andReading System Conformance for some specific requirements that have to be adhered to (not all Reading Systems will provide the same scripting functionality).

Example

Consider the following example Package Document:

<package …><manifest><itemid="chap01"href="scripted01.xhtml"media-type="application/xhtml+xml"properties="scripted"/><itemid="inset01"href="scripted02.xhtml"media-type="application/xhtml+xml"properties="scripted"/><itemid="slideshowjs"href="slideshow.js"media-type="text/javascript"/></manifest><spine …><itemrefidref="chap01"/></spine></package>

and the following filescripted01.xhtml:

<html …><head><scripttype="text/javascript">            alert("Reading System name: " + navigator.epubReadingSystem.name);</script></head><body><iframesrc="scripted02.xhtml" … /></body></html>

and the following filescripted02.xhtml:

<html …><head><scripttype="text/javascript"href="slideshow.js"></script></head><body></body></html>

From these examples, it is true that:

5.2  Content Conformance

Container-constrained scripts

A container-constrained scriptMUST NOT contain instructions for modifying the DOM of the parent Content Document or other contents in the EPUB Publication, andMUST NOT contain instructions for manipulating the size of its containing rectangle.

Spine-level scripts

EPUB Content Documents that includespine-level scriptingMUST utilize theprogressive enhancement technique, which for the purposes of this specification has the following definition: when the document is rendered by a Reading System without scripting support or with scripting support disabled, thetop-level document contentMUST retain its integrity, remaining consumable by the user without any information loss or other significant deterioration.

Accessibility

EPUB Content Documents thatinclude scriptingSHOULD employ relevant[WAI-ARIA] accessibility techniques to ensure that the content remains consumable by all users.

Fallbacks

EPUB Content Documents thatinclude scriptingMAY provide fallbacks for such content, either by using intrinsic fallback mechanisms (such as those available for the[HTML]object andcanvas elements) or, when an intrinsic fallback is not applicable, by using amanifest-level[Packages 3.1] fallback.

AuthorsMUST ensure that any output scripts generate meetsCore Media Type requirements[EPUB 3.1].

Note

Thescripted property[Manifest Vocab] of themanifestitem element indicates that an EPUB Content Document is aScripted Content Document.

5.3  Reading System Conformance

A Reading System that supports scriptingMUST meet the following criteria:

A Reading System that does not support scriptingMUST meet the following criteria:

Note

Reading Systems might render Scripted Content Documents in a manner that disables other EPUB capabilities and/or provides a different rendering and user experience (e.g., by disabling pagination).

Authors choosing to restrict the usage of scripting to thecontainer-constrained model will ensure a more consistent user experience between scripted and non-scripted content (e.g., consistent pagination behavior).

Authors are advised to use declarative techniques whenever practical to increase the interoperability, longevity and accessibility of their EPUB Publications, and avoid the inclusion of scripting whenever practical.

5.4  Security Considerations

This section is non-normative.

All EPUBAuthors andEPUB Reading System developers have to be aware of the security issues that arise when scripted content is executed by a Reading System. As the underlying scripting model employed by Reading Systems and browsers is the same, the same kinds of issues encountered in Web contexts have to be taken into consideration.

Each Reading System has to establish if the scripts in a particular document are to be trusted or not. It is advised that all scripts be treated as untrusted (and potentially malicious), and that all vectors of attack be examined and protected against. In particular, the following need to be considered:

The following recommendations are provided as a guide to handling untrusted scripts:

Note that compliance with these recommendations does not guarantee protection from the possible attacks listed above; developers have to examine each potential vulnerability within the context of their Reading System.

5.5  Event Model Considerations

This section is non-normative.

Reading Systems need to follow the DOM Event model as per[HTML] and pass UI events to the scripting environment before performing any default action associated with these events. Reading System implementers need to ensure that scripts cannot disable critical functionality (such as navigation) to constrain the extent to which apotentially malicious script could impact their Reading Systems. As a result, although the scripting environment needs to be able to cancel the default action of any event, some events either might not be passed through or might not be cancelable.

Authors need to take into account the wide variety of possible Reading System implementations when adding scripting functionality to their EPUB Publications (e.g., not all devices have physical keyboards, and in many cases a soft keyboard is activated only for text input elements). Consequently, relying on keyboard events alone is not advised; alternative ways to trigger a desired action always need to be provided.

6.  Fixed Layouts

6.1  Introduction

This section is non-normative.

This section defines rules for the expression and interpretation of dimensional properties ofEPUB Content Documents marked aspre-paginated in thePackage Document.

This specification does not define how theinitial containing block[CSS Snapshot] will be placed within the Reading SystemContent Display Area.

Note

Refer toFixed-Layout Properties[Packages 3.1] for information on how to designate that aRendition, or its individual spine items, are to be rendered in a pre-paginated manner (i.e., with fixed width and height dimensions).

6.2  Content Conformance

A conformantFixed-Layout DocumentMUST meet all of the following criteria:

6.3  Reading System Conformance

A conformantEPUB Reading SystemMUST meet all of the following criteria for processingFixed-Layout Documents:

6.4  Viewport Rendering

When renderingFixed-Layout Documents, the default intent is that theContent Display AreaSHOULD occupy as much of the availableViewport area as possible.Reading SystemsSHOULD NOT inject additional content such as border, margins, headers or footers into the Viewport or the application area surrounding the Viewport.

Note

The exposure of Reading System control widgets to the user is implementation-specific and not included in the above behavioral expectations.

6.5  Initial Containing Block Dimensions

6.5.1  Expressing in HTML

ForXHTML Content Documents, theinitial containing block[CSS Snapshot] dimensionsMUST be expressed in aviewportmeta tag using the syntax defined in[CSS Device Adaptation]. In this version of this specification, only the width and height expressionsMUST be recognized byReading Systems.

The following example shows aviewportmeta tag.

<head><metaname="viewport"content="width=1200, height=600"/></head>

Reading SystemsMUST clip XHTML content to the initial containing block (ICB) dimensions declared in theviewportmeta tag — content positioned outside of the initial containing block will not be visible. When the ICB aspect ratio does not match the aspect ratio of the Reading SystemContent Display Area, Reading SystemsMAY position the ICB inside the area to accommodate the user interface; in other words, added letter-boxing spaceMAY appear on either side (or both) of the content.

6.5.2  Expressing in SVG

ForSVG Content Documents, the rootsvg elementMUST include one or both of:

It isRECOMMENDED to use only theviewBox attribute to ensure proper rescaling of the SVG Content Document, as needed.

The following example shows aviewBox attribute declaration for an SVG Content Document with an aspect ratio of 844 pixels wide by 1200 pixels high.

<svgxmlns="http://www.w3.org/2000/svg"version="1.1"viewBox="0 0 844 1200"></svg>

If only the[SVG]viewBox attribute is present, the coordinate system it defines is mapped to theViewport, keeping the aspect ratio, thereby establishing theinitial containing block (ICB) in pixels[CSS Snapshot]. The result of this mapping is typically the bounds of the Viewport.

If only thex,y,height andwidth attributes are present, theySHOULD be defined in pixel values (establishing the ICB). Note that if the pixel values defined byx,y,height andwidth attributes exceed the Viewport's pixel values, the graphic will be clipped on the Viewport boundaries (i.e., the graphics will not be rescaled).

If the coordinate system is defined by theviewBox and thewidth/height values, the coordinate system defined by theviewBox is mapped on the boundaries as described in the previous item.

Note

See[SVG] for more details on the interplay betweenviewBox and thewidth/height values.

7.  Pronunciation Lexicons

7.1  Introduction

This section is non-normative.

TheW3C Pronunciation Lexicon Specification[PLS] defines syntax and semantics for XML-based pronunciation lexicons to be used by Automatic Speech Recognition andText-to-Speech (TTS) engines.

The following sections define conformance criteria for PLS documents when included inEPUB Publications, and rules for associating PLS Documents withXHTML Content Documents.

Note

For more information on EPUB 3.1 features related to synthetic speech, refer toText-to-speech[EPUB3 Overview].

7.2  EPUB Publication Conformance

A conformantRendition of anEPUB PublicationMUST meet all of the following criteria for inclusion of PLS Documents:

Examples

The following example shows two PLS Documents (one for Chinese and one for Mongolian) associated with an XHTML Content Document.

<html … ><head><linkrel="pronunciation"type="application/pls+xml"hreflang="zh"href="../speech/zh.pls"/><linkrel="pronunciation"type="application/pls+xml"hreflang="mn"href="../speech/mn.pls"/></head></html>

7.3  Content Conformance

A PLS DocumentMUST meet all of the following criteria:

Document Properties

ItMUST meet the conformance constraints for XML documents defined inXML Conformance[EPUB 3.1].

ItMUST be valid to the RELAX NG schema for PLS documents available at the URIhttps://www.w3.org/TR/2008/REC-pronunciation-lexicon-20081014/[PLS].

File Properties

The PLS Document filenameSHOULD use the file extension.pls.

7.4  Reading System Conformance

A conformantEPUB Reading SystemMUST meet all of the following criteria for processing PLS Documents:

  • Reading Systems withText-to-Speech (TTS) capabilitiesSHOULD support PLS.

    Reading Systems that support PLSMUST process PLS documents as defined in[PLS].

    Reading Systems that support PLSMUST apply the supplied pronunciation instructions to all text nodes in the current XHTML Content Document whoselanguage[HTML] matchesthe language for which the pronunciation lexicon is relevant[PLS]. The algorithm for matching language tags is defined inBCP47.

    When a pronunciation rule is specified more than once for a given string target in a given language, the last occurrence of the rule takes precedence, in such a way that any previously-defined pronunciation rule gets overridden.

    Reading Systems that support PLS and theSSML AttributesMUST let any pronunciation instructions provided via thessml:ph attribute take precedence in cases where apls:grapheme matches a text node of an element that carries thessml:ph attribute.

A.  Appendix A. JavaScript epubReadingSystem Object

A.1  Interface Definition

This specification extends the[HTML] Navigator object as follows.

[Exposed=(Window)]interfaceEpubReadingSystem {    [Unforgeable]    readonly attributeDOMStringname;    [Unforgeable]    readonly attributeDOMStringversion;    [Unforgeable]booleanhasFeature(DOMStringfeature,optionalDOMStringversion);};partial interfaceNavigator {    [Unforgeable,SameObject]    readonly attributeEpubReadingSystemepubReadingSystem;};

[WEB IDL] notation.

Note

This specification does not define anepubReadingSystem property extension for theWorkerNavigator object[Web Workers]. Reading Systems therefore do not have to expose theepubReadingSystem object in the scripting context of Workers, and Authors cannot rely on its presence.

A.2  Description

TheepubReadingSystem object provides an interface through which aScripted Content Document can query information about a user'sReading System.

The object exposesproperties of the Reading System (its name and version), and provides thehasFeature method which can be invoked to determine the features it supports.

Example JavaScript function that displays the name of the current Reading System.

alert("ReadingSystemname: " +navigator.epubReadingSystem.name);

Reading SystemsMUST expose theepubReadingSystem object on thenavigator object of all loaded Scripted Content Documents, including any nestedcontainer-constrained scripting contexts. Reading SystemsMUST ensure that theepubReadingSystem object is available no later than when theDOMContentLoaded event is triggered[HTML].

Note

Reading systems implementations might create cloned instances of theepubReadingSystem object in Scripted Content Documents for technical feasibility reasons. In such cases, the Reading System has to ensure that the object’s state — as reflected by the values of its properties and methods — is consistently maintained across all copied instances.

A.3  Properties

The following propertiesMUST be made available for retrieving information about the Reading System.

NameDescription
nameReturns aString value representing the name of the Reading System (e.g., "iBooks", "Kindle").
versionReturns aString value representing the version of the Reading System (e.g., "1.0", "2.1.1").

A.4  Methods

A.4.1  hasFeature

A.4.1.1  Description

ThehasFeature method returns a boolean value indicating whether any version of the specified feature is supported, orundefined if the specified feature is not recognized.

TheOPTIONALversion parameter is included for querying custom features that could change in incompatible ways over time. The return value indicates support only for the specified version of the feature.

AuthorsSHOULD NOT include theversion parameter when queryingfeatures defined in this specification — these features are considered versionless. If a Reading System supports a feature defined in this specification, itMUST ignore any suppliedversion parameter and return atrue value.

Example JavaScript function that displays whether the current Reading System supports scripted manipulation of the DOM.

var feature ="dom-manipulation";var conformTest = navigator.epubReadingSystem.hasFeature(feature);alert("Feature " + feature +" supported?: " + conformTest);
A.4.1.2  Features

The following table lists the set of features that Reading Systems that support theepubReadingSystem objectMUST recognize (i.e., provide a return value for). Support for these features isOPTIONAL.

NameDescription
dom-manipulationScriptsMAY make structural changes to the document’s DOM (applies tospine-level scripting only).
layout-changesScriptsMAY modify attributes and CSS styles that affect content layout (applies tospine-level scripting only).
touch-eventsThe device supports touch events and the Reading System passes touch events to the content.
mouse-eventsThe device supports mouse events and the Reading System passes mouse events to the content.
keyboard-eventsThe device supports keyboard events and the Reading System passes keyboard events to the content.
spine-scriptingIndicates whether the Reading System supportsspine-level scripting (e.g., so acontainer-constrained script can determine whether any actions that depend on scripting support in aTop-level Content Document have any chance of success before attempting them).

Additional featuresMAY be added by Reading System developers, but future versions of this specification might append to this list in ways that could conflict or be incompatible with any such custom additions.

B.  Appendix B. Obsolete Features

This appendix listsdeprecated and superseded[EPUB 3.1] features of this specification.

B.1  Deprecated Features

B.1.1  The rendition:viewport Property for ICB Dimensions

Use of therendition:viewport property[Packages 3.1] is nowdeprecated. As this feature has always beenOPTIONAL, Reading System support is not changed. Developers are advised that the feature will be removed in a future version.

B.1.2  The epubReadingSystem Object layoutStyle property

Use of thelayoutStyle property isdeprecated.

For more information about this property, refer to its definition in[Content Docs 3.0.1].

C.  Acknowledgements and Contributors

This section is non-normative.

EPUB has been developed by the International Digital Publishing Forum in a cooperative effort, bringing together publishers, vendors, software developers, and experts in the relevant standards.

The EPUB 3.1 specifications were prepared by the International Digital Publishing Forum’s EPUB Maintenance Working Group, operating under a charter approved by the membership in July 2015, under the leadership of:

Active members of the working group included:

IDPF Members

Invited Experts/Observers

For more detailed acknowledgements and information about contributors to each version of EPUB, refer toAcknowledgements and Contributors[EPUB3 Overview].

D.  References

D.1Normative References

[Alt Style Tags]Alternate Style Tags.Elika J. Etemad.

[BCP 47]Tags for Identifying Languages; Matching of Language Tags.A. Phillips, et al.September 2009.

[CSS Snapshot]CSS Snapshot.

[CSS3 Fonts]CSS Fonts Module Level 3.John Daggett.

[CSS3 Text Decoration]CSS Text Decoration Module Level 3.Elika J. Etemad, et al.

[CSS3 Text-20160119]CSS Text Level 3 (20160119).Elika J. Etemad, et al.

[CSS3 Values and Units]CSS Values and Units Module Level 3.Tab Atkins et al.

[CSS3 Writing Modes]CSS Writing Modes Module Level 3.Elika J. Etemad, et al.

[CSS3 Writing Modes-20151215]CSS Writing Modes Module Level 3 (20151215).Elika J. Etemad, et al.15 December 2015.

[Content Docs 3.0.1]EPUB Content Documents 3.0.1.

[DOM2 Style]Document Object Model (DOM) Level 2 Style Specification, Version 1.0.Chris Wilson, et al.13 November 2000.

[EPUB 3.1]EPUB 3.1.

[EPUB Accessibility]EPUB Accessibility.

[HTML]HTML.

[HTML+RDFa11]HTML+RDFa 1.1.Support for RDFa in HTML4 and HTML5.Manu Sporny.22 August 2013.

[MATHML]Mathematical Markup Language (MathML) Version 3.0.David Carlisle, et al.21 October 2010.

[Manifest Vocab]EPUB Manifest Properties Vocabulary.

[Microdata]HTML Microdata (20121025).Ian Hickson.25 October 2012.

[PLS]Pronunciation Lexicon Specification 1.0 (PLS).Paolo Baggia.14 October 2008.

[Packages 3.1]EPUB Packages 3.1.

[RDFa 1.1]RDFa Core 1.1 - Second Edition.Syntax and processing rules for embedding RDF through attributes.Ben Adida, et al.22 August 2013.

[RFC2119]Key words for use in RFCs to Indicate Requirement Levels (RFC 2119).March 1997.

[Reserved Prefixes]EPUB Content Documents Reserved Prefixes.

[SSML]Speech Synthesis Markup Language (SSML) Version 1.1.Daniel C. Burnett, et al.7 September 2010.

[SVG]Scalable Vector Graphics (SVG).

[Structure Vocab]EPUB 3 Structural Semantics Vocabulary.

[Unicode] The Unicode Consortium.The Unicode Standard..

[W3C Process]World Wide Web Consortium Process Document.Charles McCathie-Nevile.1 September 2015.

[WAI-ARIA]Accessible Rich Internet Applications (WAI-ARIA) 1.0.James Craig, et al.20 March 2014.

[WEB IDL]WebIDL Level 1 (20160308).

[XML]Extensible Markup Language (XML) 1.0 (Fifth Edition).T. Bray, et al.26 November 2008.

[XMLNS]Namespaces in XML (Third Edition).T. Bray, et al.8 December 2009.

D.2Informative References

[Attribute Extensions]EPUB Custom Attribute Extensions for Content Documents.

[CSS Device Adaptation]CSS Device Adaptation Module Level 1.

[EPUB3 Changes]EPUB 3.1 Differences from EPUB 3.0.1.

[EPUB3 Overview]EPUB 3.1 Overview.

[IPA]IPA Chart.International Phonetic Association.2005.

[Web Workers]Web Workers.


[8]ページ先頭

©2009-2025 Movatter.jp