From ae1c2724e9f730b01ebdecfb8491edf9ea0f9334 Mon Sep 17 00:00:00 2001
From: Matt Garrish MUST treat any [=OCF ZIP container=] that splits the content into
- segments [[zip]] as in error. MUST treat any [=OCF ZIP container=] that
+ splits the content into segments [[zip]] as in error. MUST treat any OCF ZIP container that uses compression techniques other
@@ -821,13 +821,14 @@ OCF ZIP container
Metadata
NOT skip processing the metadata expressed in the package document (i.e., use only the
information expressed in the record). Reading systems MAY compile metadata from multiple
linked records.
When resolving discrepancies and conflicts between metadata
- expressed in the package document and in linked metadata records, reading systems MUST use
- the document order of [^link^] elements [[epub-33]] in the
- package document to establish precedence (i.e., metadata in the first linked record has the
- highest precedence and metadata in the package document the lowest, regardless of whether
- the link
elements occur before, within, or after the package metadata
- elements).
When resolving
+ discrepancies and conflicts between metadata expressed in the package document and in linked
+ metadata records, reading systems MUST use the document order of [^link^] elements [[epub-33]] in the package document to establish precedence
+ (i.e., metadata in the first linked record has the highest precedence and metadata in the
+ package document the lowest, regardless of whether the link
elements occur
+ before, within, or after the package metadata elements).
Reading systems MUST ignore any instructions contained in linked resources related to the layout and rendering of the EPUB publication.
@@ -1133,16 +1134,16 @@If a reading system has a - [=viewport=], it MUST support the visual rendering of XHTML content - documents via CSS [[epub-33]].
+If a reading system has a [=viewport=], it MUST support the + visual rendering of XHTML content documents via CSS + [[epub-33]].
To support CSS, a reading system:
MUST support the official - definition of CSS as described in the [[csssnapshot]].
+MUST support the official definition of CSS as described in the + [[csssnapshot]].
SHOULD support all applicable modules in [[csssnapshot]] that @@ -1556,13 +1557,13 @@
rendition:page-spread-*
propertiesrendition:page-spread-*
property value.
Reading systems MUST honor
- rendition:page-spread-*
properties on both reflowable and pre-paginated spine items (e.g., by
- inserting a blank page).
rendition:page-spread-*
properties on both reflowable and pre-paginated
+ spine items (e.g., by inserting a blank page).
- When a
- pre-paginated spine item follows a reflowable one, the pre-paginated one SHOULD start on the
- next page (as defined by the page-progression-direction
attribute) when it
- lacks a rendition:page-spread-*
property value.
When a pre-paginated
+ spine item follows a reflowable one, the pre-paginated one SHOULD start on the next page (as
+ defined by the page-progression-direction
attribute) when it lacks a
+ rendition:page-spread-*
property value.
When a reading system encounters two spine items that represent a true spread (i.e., two adjacent spine items with @@ -1583,13 +1584,13 @@
viewport
meta
tag for [=XHTML content documents=], as defined in Expressing in HTML [[epub-33]].
- They
- MUST clip content positioned outside of the ICB.
+ They MUST clip content positioned outside of the ICB.
If the width or height values in the viewport
meta
tag contain a non-numeric character but start with a number (e.g., the
- value includes a unit of length declaration such as "500px"), the number prefix SHOULD be used
- as the pixel value, otherwise the value MUST be treated as invalid.
If the viewport
meta
does not contain a width or a height value, or if these values are
invalid, reading systems SHOULD consider these as having the values
@@ -2074,85 +2075,112 @@
- Reading systems MUST resolve all reserved prefixes [[epub-33]] used in
- [=package documents=] using their predefined URLs unless the [=EPUB creator=] declares a
- local prefix.
- Reading systems MUST use the URLs defined for locally
- overridden prefixes (using the prefix
attribute) when encountered.
-
As changes to the reserved prefixes and updates to reading systems are not always going happen in
- synchrony, reading systems MUST NOT fail when encountering unrecognized prefixes (i.e., not
- reserved and not declared using the prefix
attribute).
prefix
attributeIf the prefix
attribute includes a declaration for
- a predefined prefix, reading systems MUST use the
- URL mapping defined in the prefix
attribute, regardless of whether it maps to the
- same URL as the predefined prefix.
Default vocabularies are defined for package document attributes that accept property
data types [[EPUB-33]].
- When unprefixed terms are encountered in these attributes, the URL of the applicable default
- vocabulary URL is used to expand the values.
The default vocabulary URLs for these attributes are as follows:
-property
attribute
- [[epub-33]]: http://idpf.org/epub/vocab/package/meta/#
rel
and properties
[[epub-33]]
- attributes: http://idpf.org/epub/vocab/package/link/#
properties
- attribute: http://idpf.org/epub/vocab/package/item/#
properties
attribute
- [[epub-33]]: http://idpf.org/epub/vocab/package/itemref/#
This section defines an algorithm for obtaining an expanded URL from a property
data type
+ value using the [[epub-33]] vocabulary association mechanisms.
property
data typesReading systems MUST expand property
- values [[epub-33]] as follows:
The algorithm describes the process using the terminology and data types defined in [[infra]], and, if + successful, results in [=string=] value with the expanded URL being returned. A null value is returned for invalid properties.
+ +This algorithm takes the following arguments:
+ +property
value to process.To obtain an expanded property
URL, apply the following steps:
Obtain the values of propertyPrefix and propertyValue
as follows:
If the property consists only of a reference, - concatenate the prefix URL associated with the default - vocabulary to the reference.
+If value does not contain a colon, set propertyValue to + value and continue processing at the next step.
- If the property consists of a prefix and - reference, concatenate the URL defined for the prefix to the reference. - If the EPUB creator has not defined - a matching prefix, and it is not a reserved prefix [[epub-33]], the property is invalid and reading systems - MUST ignore it. -
+Otherwise, if value contains a single colon:
+If value begins or ends with a colon, the value is invalid. Return null.
+Otherwise, if value contains a single colon, split value on + the colon and set propertyPrefix to the string before the colon and + set propertyValue to the string after.
+If the property consists only of a prefix - (i.e., there is no reference after the colon), the property is invalid and reading - systems MUST ignore it.
+Otherwise, the value is invalid. Return null.
If the process does not result in a [=valid URL - string=], reading systems MUST ignore the property.
-Reading systems do not have to [=url parser | parse the resulting URL=] [[url]] or attempt to - dereference the resource.
-Obtain the value of baseURL as follows:
+If propertyPrefix is an empty string:
+http://idpf.org/epub/vocab/structure/#
http://idpf.org/epub/vocab/package/meta/#
http://idpf.org/epub/vocab/package/link/#
http://idpf.org/epub/vocab/package/item/#
http://idpf.org/epub/vocab/package/itemref/#
Otherwise:
+If a prefix
attribute is declared on the document element of
+ doc, and the attribute contains a prefix that matches
+ propertyPrefix, set baseURL to the URL associated with
+ the prefix declaration.
Otherwise, if propertyPrefix matches a reserved prefixe [[epub-33]] + for doc, set baseURL to the URL associated with the + reserved prefix.
+If baseURL is an empty string, the property value is invalid. Return null.
+If expandedURL is not a [=valid URL string=], the value is invalid. Return null.
+Otherwise, return expandedURL.
+Reading systems do not have to [=url parser | parse the resulting URL=] [[url]] or attempt to dereference + the resource.
+ +As changes to the reserved prefixes and updates to reading systems are not always going happen in
+ synchrony, reading systems MUST NOT fail when encountering unrecognized prefixes (i.e., not reserved and
+ not declared using the prefix
attribute).
This specification used to define the name
, version
, and the layoutStyle
properties,
- but these are now deprecated [[epub-33]]. For more information refer
- to their definitions in [[epubcontentdocs-32]] (for name
and version
)
- and in [[epubcontentdocs-301]] (for layoutStyle
).
This specification used to define the name
, version
, and the
+ layoutStyle
properties, but these are now deprecated [[epub-33]]. For more information refer to their definitions
+ in [[epubcontentdocs-32]] (for name
and version
) and in [[epubcontentdocs-301]] (for layoutStyle
).
name
and version
properties of the
+ epubReadingSystem
object have been deprecated. See issue 1872.hreflang
value for
processing purposes. See pull request
2343.Reading systems do not have to [=url parser | parse the resulting URL=] [[url]] or attempt to dereference the resource.
- -As changes to the reserved prefixes and updates to reading systems are not always going happen in
- synchrony, reading systems MUST NOT fail when encountering unrecognized prefixes (i.e., not reserved and
- not declared using the prefix
attribute).
All algorithm explanations are non-normative.
+When processing the [^/epub:type^] attribute, a reading system:
MAY obtain an expanded URL for each value.
+MAY associate behaviors with none, some, or all of the terms defined in the default vocabulary [[epub-33]].
@@ -2068,41 +2073,70 @@property
values[=Reading systems=] MAY support vocabulary association mechanisms [[epub-33]] in [=EPUB - content documents=].
+[=Reading systems=] MAY support the vocabulary association mechanisms for processing property
data type values
+ [[epub-33]].
This section defines an algorithm for obtaining an expanded URL from a property
data type
- value using the [[epub-33]] vocabulary association mechanisms.
Reading systems that do not support the [[epub-33]] vocabulary association mechanisms MAY process
+ property
values as plain [=string=] values [[infra]]. It is not required to support the
+ expansion of these values to URLs to add reading system behaviors based on their presence.
The algorithm describes the process using the terminology and data types defined in [[infra]], and, if - successful, results in [=string=] value with the expanded URL being returned. A null value is returned for invalid properties.
This algorithm takes the following arguments:
property
value to process.To obtain an expanded property
URL, apply the following steps:
To obtain an expanded URL, apply the following steps:
Obtain the values of propertyPrefix and propertyValue
as follows:
Let baseURL, expandedURL, propertyPrefix, and + propertyName be empty [=strings=].
+In this algorithm:
+Obtain the values of propertyPrefix and propertyName as follows:
If value does not contain a colon, set propertyValue to +
If value does not contain a colon, set propertyName to value and continue processing at the next step.
+If a property
value does not have a colon, it does not have a prefix. In
+ this case, the value is drawn from the default vocabulary.
Otherwise, if value contains a single colon:
@@ -2112,14 +2146,26 @@Otherwise, if value contains a single colon, split value on - the colon and set propertyPrefix to the string before the colon and - set propertyValue to the string after.
+Otherwise, let tokens be the result of [=strictly split a + string|splitting=] value using a colon (U+003A) as the delimiter. Set + propertyPrefix to tokens[0] and set + propertyName to tokens[1].
If a property
value has a single colon, it has a prefix.
A colon at the beginning of the value is invalid, however, as it indicates the prefix + is not set. Likewise, a colon at the end of the value indicates that there is only a + prefix and no value.
+Otherwise, the value is invalid. Return null.
+A property
value cannot have more than one colon.
http://idpf.org/epub/vocab/package/itemref/#
+ If the property
value does not have a prefix, then this step assigns the
+ default vocabulary URL to use based on the attribute or element to which it belongs.
+ When an element in the package document has more than one attribute that takes a
+ property
data type, those attributes share the same default
+ vocabulary. For this reason, it is not necessary to check both the element and
+ attribute to determine what URL to assign.
Otherwise:
@@ -2156,27 +2211,55 @@Otherwise, if propertyPrefix matches a reserved prefixe [[epub-33]] + data-cite="epub-33#sec-reserved-prefixes">reserved prefix [[epub-33]] for doc, set baseURL to the URL associated with the reserved prefix.
When a property
value has a prefix, the first place to check for its
+ base URL is in a prefix
attribute declaration on the document
+ element.
If the author has not assigned a URL for the prefix, the next step is to check if the + prefix matches one of the reserved prefixes.
+Note that author-assigned prefix URLs override the reserved prefix URLs.
+If baseURL is an empty string, the property value is invalid. Return null.
+If the base URL is empty at the end of this processing step, then either the prefix is not
+ mapped or reserved, or the element or attribute being processed does not accept
+ property
data types as defined in [[epub-33]].
Without a base URL, it is impossible to generate an expanded URL, so the value is + invalid.
+If expandedURL is not a [=valid URL string=], the value is invalid. Return null.
Otherwise, return expandedURL.
+Although an expanded value may be obtained, it is not necessarily the case that it is a valid + URL. This is only likely to occur when the EPUB creator assigns an invalid base URL to a + prefix.
+Reading systems do not have to [=url parser | parse the resulting URL=] [[url]] or attempt to dereference - the resource.
+Reading systems do not have to [=url parser | parse the resulting URL=] [[url]] or attempt to
+ dereference the resulting expanded URL. Expanding a property
data type value to a full
+ URL only ensures a reading system has encountered the value it expects (i.e., because different EPUB
+ creators can assign the same prefix to different URLs, two values may appear the same until
+ expanded).
property
valuesIf a property
value does not have a colon, it does not have a prefix. In
- this case, the value is drawn from the default vocabulary.
property
valuesObtain the values of propertyPrefix and propertyName as follows:
If value does not contain a colon, set propertyName to +
If value does not contain a colon (U+003A), set propertyName to value and continue processing at the next step.
property
valuesOtherwise, if value contains a single colon:
-If value begins or ends with a colon, the value is invalid. Return null.
-Otherwise, let tokens be the result of [=strictly split a - string|splitting=] value using a colon (U+003A) as the delimiter. Set - propertyPrefix to tokens[0] and set - propertyName to tokens[1].
-Otherwise, if value begins with a colon, the value is invalid. Return null.
If a property
value has a single colon, it has a prefix.
A colon at the beginning of the value is invalid, however, as it indicates the prefix - is not set. Likewise, a colon at the end of the value indicates that there is only a - prefix and no value.
+A colon at the beginning of the value is invalid as it indicates the prefix is not + set.
Otherwise, the value is invalid. Return null.
+Otherwise, if value does not contain a slash (U+002F) and value + ends with a colon or has more than one colon, the value is invalid. Return null.
A property
value cannot have more than one colon.
If a property
does not contain any slashes, then the colon represents
+ the prefix delimiter. It is not valid for the value to end with a colon, as that
+ would indicate there is only a prefix and no name.
Likewise, there cannot be more than one colon, as the name must be a + [=path-relative-scheme-less-URL string=] (i.e., any colons must be after the first + [=URL-path-segment string=]).
+For example, the following is a valid property
value as the second colon
+ follows a slash: foo:bar/ba:z
. This example shows an invalid value, as
+ the second colon could represent a scheme: foo:bar:baz/qux
.
Otherwise, split value on the first colon and set propertyPrefix to + the string before the colon and set propertyName to the string after the + colon.
+If propertyName contains a colon, and that colon occurs before a slash character, the + value is invalid. Return null.
+If a propertyName has a colon at this stage, then there were multiple colons in + the original value. The first delimited the prefix. Any subsequent ones left in the name + must occur after a slash, otherwise the name is not a valid [=path-relative-scheme-less-URL + string=]. (Refer to the explanation for substep 3 + for additional explanation about valid path-relative-scheme-less-URL strings.)
+Obtain the value of baseURL as follows:
From 97b33fb2c151f932ef608a0f9af781a7654e837c Mon Sep 17 00:00:00 2001 From: Matt Garrishproperty
valuesLet baseURL, expandedURL, propertyPrefix, and - propertyName be empty [=strings=].
+ propertyReference be empty [=strings=].In this algorithm:
@@ -2117,25 +2117,28 @@property
valuesObtain the values of propertyPrefix and propertyName as follows:
+Obtain the values of propertyPrefix and propertyReference as follows:
If value does not contain a colon (U+003A), set propertyName to - value and continue processing at the next step.
+If value does not contain a colon (U+003A), set propertyReference + to value.
If a property
value does not have a colon, it does not have a prefix. In
- this case, the value is drawn from the default vocabulary as described in the next step of the algorithm.
property
valuesOtherwise, if value does not contain a slash (U+002F) and value - ends with a colon or has more than one colon, the value is invalid. Return null.
-If a property
does not contain any slashes, then the colon represents
- the prefix delimiter. It is not valid for the value to end with a colon, as that
- would indicate there is only a prefix and no name.
Likewise, there cannot be more than one colon, as the name must be a - [=path-relative-scheme-less-URL string=] (i.e., any colons must be after the first - [=URL-path-segment string=]).
-For example, the following is a valid property
value as the second colon
- follows a slash: foo:bar/ba:z
. This example shows an invalid value, as
- the second colon could represent a scheme: foo:bar:baz/qux
.
Otherwise, split value on the first colon and set propertyPrefix to - the string before the colon and set propertyName to the string after the + the string before the colon and set propertyReference to the string after the colon.
If propertyName contains a colon, and that colon occurs before a slash character, the - value is invalid. Return null.
+If propertyReference is an empty string or is not a valid
+ [=path-relative-scheme-less-URL string=], as required by the property
data type definition
+ [[epub-33]], the value is invalid. Return null.
If a propertyName has a colon at this stage, then there were multiple colons in - the original value. The first delimited the prefix. Any subsequent ones left in the name - must occur after a slash, otherwise the name is not a valid [=path-relative-scheme-less-URL - string=]. (Refer to the explanation for substep 3 - for additional explanation about valid path-relative-scheme-less-URL strings.)
+If the reference is an empty string, the colon separating the prefix from the reference must + have been at the end of value. A prefix without a reference is invalid.
+The path-relative-scheme-less-URL string definition has a number of restrictions that apply + to the reference whether it has a prefix or not.
+For example, the reference must not begin with a [=URL-scheme string=] followed by a colon.
+ This restriction means that the following is not a valid property
value as the
+ second colon could represent a scheme: foo:bar:baz/qux
.
There are also restrictions on what characters must be percent encoded.
property
valuesIf expandedURL is not a [=valid URL string=], the value is invalid. Return null.
From 261af245bac486b608752ae4191946d2e82bac6e Mon Sep 17 00:00:00 2001 From: Matt Garrishproperty
valuesIf propertyReference is an empty string or is not a valid
- [=path-relative-scheme-less-URL string=], as required by the property
data type definition
- [[epub-33]], the value is invalid. Return null.
If propertyReference is not a valid [=path-relative-scheme-less-URL string=], as
+ required by the property
data type
+ definition [[epub-33]], the value is invalid. Return null.
If the reference is an empty string, the colon separating the prefix from the reference must - have been at the end of value. A prefix without a reference is invalid.
The path-relative-scheme-less-URL string definition has a number of restrictions that apply to the reference whether it has a prefix or not.
For example, the reference must not begin with a [=URL-scheme string=] followed by a colon.
From 7b07d2b72d8a316299d6cb10b5c773328dfd56dd Mon Sep 17 00:00:00 2001
From: Matt Garrish Processing
property
values
http://idpf.org/epub/vocab/structure/#
scheme
, the property value is invalid. Return null.http://idpf.org/epub/vocab/package/meta/#
Processing
property
valuesproperty
data type, those attributes share the same default
vocabulary. For this reason, it is not necessary to check both the element and
attribute to determine what URL to assign.
The one attribute in EPUB 3 that does not have a default vocabulary is the scheme
attribute
+ [[epub-33]]. A scheme value without a prefix is invalid.
meta
elementThe scheme
attribute identifies the system or scheme the EPUB
creator obtained the element's [=value=] from. The value of the attribute MUST be a property data type value that resolves to the
- resource that defines the scheme.
scheme
attribute does not have a default vocabulary (i.e., all values require a prefix).
epub:type
may be used has been
+ made explicit. See issue 2377.meta
element for specifying the initial containing
boundary in fixed-layout documents is now formally defined. See issue 2292. An empty string does not represent a valid property value, even though it is valid to - the definition above.
+ the definition above. Aproperty
value that consists only of a prefix and colon is
+ valid, however (i.e., the reference can be an empty string when a prefix is defined).