diff --git a/sections/acknowledgements.include b/sections/acknowledgements.include
index 1690391480..fcf73dc652 100644
--- a/sections/acknowledgements.include
+++ b/sections/acknowledgements.include
@@ -1,21 +1,21 @@
Acknowledgements
- Thanks to Tim Berners-Lee for inventing HTML, without which none of this would exist, Dan Connolly,
- the many who worked to standardise HTML over the last couple of decades or so, and the many more who
- worked on ideas subsequently incorporated into HTML.
+ Thanks to Tim Berners-Lee for inventing HTML, without which none of this would exist, Dan
+ Connolly, the many who worked to standardise HTML over the last couple of decades or so, and the
+ many more who worked on ideas subsequently incorporated into HTML.
- For inestimable work, and the drive to keep HTML up to date, particular thanks are due to Ian Hickson,
- and the other editors of the WHATWG: Anne van Kesteren, Domenic Denicola, Philip Jägenstedt,
- Simon Pieters.
+ For inestimable work, and the drive to keep HTML up to date, particular thanks are due to Ian
+ Hickson, and the other editors of the WHATWG: Anne van Kesteren, Domenic Denicola, Philip
+ Jägenstedt, Simon Pieters.
Thanks to the participants of the
Responsive Images Community Group
- and the WHATWG for helping to develop the <{picture}> element, the <{img/srcset}> attribute,
- and the <{source/sizes}> attribute. Special thanks to Bruce Lawson for originally suggesting,
- Edward O'Connor and Ian Hickson for writing the original srcset specification, and Adrian Bateman
- for providing the group with guidance. Contributions also from: David Newton, Ilya Grigorik,
- John Schoenick, and Leon de Rijke.
+ and the WHATWG for helping to develop the <{picture}> element, the <{img/srcset}> attribute, and
+ the <{source/sizes}> attribute. Special thanks to Bruce Lawson for originally suggesting, Edward
+ O'Connor and Ian Hickson for writing the original srcset specification, and Adrian Bateman for
+ providing the group with guidance. Contributions also from: David Newton, Ilya Grigorik, John
+ Schoenick, and Leon de Rijke.
With apologies to people who have undeservedly not been named, thanks to
@@ -24,7 +24,6 @@
People who have contributed to previous versions of HTML
-
Aankhen,
Aaron Boodman,
Aaron Leventhal,
@@ -345,6 +344,9 @@
Ian Kilpatrick,
Ido Green,
Ignacio Javier,
+ Igor Oliveira,
+ Ingvar Stepanyan,
+ Iurii Kucherov,
Ivan Enderlin,
Ivo Emanuel Gonçalves,
J. King,
@@ -833,13 +835,13 @@
Thanks also to everyone who has ever posted about HTML to their blogs, public mailing lists, or
forums, including all the contributors to the various
- W3C HTML WG lists and the various WHATWG
- lists.
+ W3C HTML WG lists and the
+ various WHATWG lists.
The image of two cute kittens in a basket used in the context menu example is based on
- a photo
- by Alex G.
+ a photo by
+ Alex G.
(CC BY 2.0)
The Blue Robot Player sprite used in the canvas demo is based on
@@ -847,15 +849,18 @@
JohnColburn.
(CC BY-SA 3.0)
- The photograph of robot 148 climbing the tower at the FIRST Robotics Competition 2013 Silicon Valley Regional is based on
+ The photograph of robot 148 climbing the tower at the FIRST Robotics Competition 2013 Silicon
+ Valley Regional is based on
a work by
Lenore Edman.
(CC BY 2.0)
- The fancy image of the letter O with a child sitting in it reading a book is by Jessie Wilcox Smith and is in the Public Domain.
+ The fancy image of the letter O with a child sitting in it reading a book is
+ by Jessie Wilcox Smith and is in the Public
+ Domain.
- Parts of this specification are © Copyright 2004-2014 Apple Inc., Mozilla Foundation, and
- Opera Software ASA. You are granted a license to use, reproduce and create derivative works of
- this document.
+ Parts of this specification are © Copyright 2004-2014 Apple Inc., Mozilla Foundation, and Opera
+ Software ASA. You are granted a license to use, reproduce and create derivative works of this
+ document.
Document
D, then P is
+ If the browsing context container element E is in the Document
D, then P is
said to be the parent browsing context of C and C is said to be a child browsing context of P.
Otherwise, the nested browsing context C has no parent
browsing context.
@@ -126,8 +126,8 @@
Document
d, in the tree
- order of the elements nesting those browsing
+ For each child browsing context of d that is nested through an element
+ that is in the Document
d, in the tree order of the elements nesting those browsing
contexts, run these substeps:
It returns the Unicode rather than the ASCII serialization for compatibility with
- MessageEvent
.
+ MessageEvent
.
protocol
attribute's getter must run these
steps:
@@ -4596,7 +4594,7 @@
hashchange
at the browsing
- context's Window
object, using the HashChangeEvent
interface,
+ contextoldURL
attribute initialized to old URL and the newURL
attribute
initialized to new URL. This event must bubble but not be cancelable and
has no default action.dictionary PopStateEventInit : EventInit { - any state; + any state = null; };
state
pushState()
or replaceState()
.
-
+ Returns a copy of the information that was provided to pushState()
or
+ replaceState()
.
state
attribute must return the
- value it was initialized to. When the object is created, this attribute must be initialized to
- null. It represents the context information for the event, or null, if the state represented is
- the initial state of the {{Document}}.
+ The state
attribute must return the value it
+ was initialized to. It represents the context information for the event, or null, if the state
+ represented is the initial state of the {{Document}}.
[Constructor(DOMString type, optional HashChangeEventInit eventInitDict), Exposed=(Window,Worker)] interface HashChangeEvent : Event { - readonly attribute DOMString oldURL; - readonly attribute DOMString newURL; + readonly attribute USVString oldURL; + readonly attribute USVString newURL; };
dictionary HashChangeEventInit : EventInit { - DOMString oldURL; - DOMString newURL; + USVString oldURL = ""; + USVString newURL = ""; };
oldURL
newURL
oldURL
attribute must return the
- value it was initialized to. When the object is created, this attribute must be initialized to
- null. It represents context information for the event, specifically the URL of the session
- history entry that was traversed from.
+ value it was initialized to. It represents context information for the event, specifically the URL
+ of the session history entry that was traversed from.
The newURL
attribute must return the
- value it was initialized to. When the object is created, this attribute must be initialized to
- null. It represents context information for the event, specifically the URL of the session
- history entry that was traversed to.
-
- PageTransitionEvent
interfacedictionary PageTransitionEventInit : EventInit { - boolean persisted; + boolean persisted = false; };
persisted
pageshow
event, returns false if the page is newly being loaded (and the
+ load
event will fire). Otherwise, returns true.
- For the pageshow
event, returns false if the page is
- newly being loaded (and the load
event will fire). Otherwise,
- returns true.
-
- For the pagehide
event, returns false if the page is
- going away for the last time. Otherwise, returns true, meaning that (if nothing conspires to
- make the page unsalvageable) the page might be reused if the user navigates back to this
- page.
+ For the pagehide
event, returns false if the page is going away for the last
+ time. Otherwise, returns true, meaning that (if nothing conspires to make the page
+ unsalvageable) the page might be reused if the user navigates back to this page.
- Things that can cause the page to be unsalvageable include:
-
- document.open()
- beforeunload
events
- unload
events
- iframe
s that are not salvageable
- WebSocket
objects
- Document
- document.open()
+ beforeunload
events
+ unload
events
+ iframe
s that are not salvageable
+ WebSocket
objects
+ Document
+ persisted
attribute must
- return the value it was initialized to. When the object is created, this attribute must be
- initialized to false. It represents the context information for the event.
-
- persisted
attribute must return
+ the value it was initialized to. It represents the context information for the event.
pagehide
events in a row without an intervening
pageshow
, or vice versa).
- Event loops have a termination nesting level
- counter, which must initially be zero.
+ Event loops have a termination nesting level counter, which must initially be
+ zero.
- When a user agent is to prompt to unload a document, it must run the following
- steps.
+ When a user agent is to
+ prompt to unload a document, it must
+ run the following steps.
BeforeUnloadEvent
interfacediff --git a/sections/dom.include b/sections/dom.include index 74f87800eb..af0880e968 100644 --- a/sections/dom.include +++ b/sections/dom.include @@ -75,6 +75,8 @@enum DocumentReadyState { "loading", "interactive", "complete" }; + typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement; + [OverrideBuiltins] partial /*sealed*/ interface Document { // resource metadata management @@ -98,7 +100,7 @@ [SameObject] readonly attribute HTMLCollection forms; [SameObject] readonly attribute HTMLCollection scripts; NodeList getElementsByName(DOMString elementName); - readonly attribute HTMLScriptElement? currentScript; + readonly attribute HTMLOrSVGScriptElement? currentScript; // dynamic markup insertion Document open(optional DOMString type = "text/html", optional DOMString replace = ""); @@ -266,27 +268,23 @@ -- Each document has a current document readiness. When a {{Document}} object - is created, it must have its current document readiness set to the string - "+ Each document has a current document readiness. When a {{Document}} object is created, + it must have its current document readiness set to the string "loading
" if the document is associated with an HTML parser, an - XML parser, or an XSLT processor, and to the string "complete
" - otherwise. Various algorithms during page loading affect this value. When the value is set, the - user agent must fire a simple event namedreadystatechange
at the - {{Document}} object. - - A {{Document}} is said to have an active parser if it is associated with an - HTML parser or an XML parser that has not yet been stopped or - aborted. - - ThereadyState
IDL attribute must, on getting, return the current - document readiness. -loading
" if the + document is associated with an HTML parser, an XML parser, or an XSLT processor, and + to the string "complete
" otherwise. Various algorithms during page loading affect + this value. When the value is set, the user agent must fire a simple event named +readystatechange
at the {{Document}} object. + + A {{Document}} is said to have an active parser if it is associated with an + HTML parser or an XML parser that has not yet been stopped or aborted. + + ThereadyState
IDL attribute must, on getting, + return the current document readiness.DOM tree accessors
- The <{html}> element of a document is the document's root element, if there is - one and it's an <{html}> element, or null otherwise. + The <{html}> element of a document is it's document element, if it's an an + <{html}> element, and null otherwise.
@@ -298,10 +296,8 @@ The <{head}> element of a document is the first <{head}> element that is a child of the <{html}> element, if there is one, or null otherwise. -- The+ Thehead
attribute, on getting, must return - the <{head}> element of the document (a <{head}> element or null). -head
attribute, on getting, must return + the <{head}> element of the document (a <{head}> element or null).
@@ -309,63 +305,52 @@
title
[ = value ]title
element for HTML and
- as given by the SVG title
element for SVG.
+ as given by the SVG title
element for SVG.
Can be set, to update the document's title. If there is no appropriate element to update, the
new value is ignored.
title
element of a document is the first title
element
- in the document (in tree order), if there is one, or null otherwise.
-
- title
attribute must, on getting, run the following algorithm:
-
- 1. If the root element is an <{svg}> element in the SVG namespace, then let
- value be the child text content of the first
- title
element in the SVG namespace that is a
- child of the root element. [[!SVG]]
- 2. Otherwise, let value be the child text content of the
- title
element, in tree order, or
- the empty string if the title
element is null.
- 3. Strip and collapse whitespace in value.
- 4. Return value.
-
- On setting, the steps corresponding to the first matching condition in the following list must
- be run:
-
- title
element in the
- SVG namespace that is a child of the root element, if any. If there isn't
- one, create a title
element in the SVG namespace, insert it as the
- first child of the root element, and let element be that element.
- [[!SVG]]
- 2. Act as if the {{Node/textContent}} IDL attribute of element was set to the
- new value being assigned.
- title
element is null and the <{head}> element
- is null, then abort these steps.
- 2. If the title
element is null, then create a new title
- element and append it to the <{head}> element, and let
- element be the newly created element; otherwise, let element be
- the title
element.
- 3. Act as if the {{Node/textContent}} IDL attribute of element was set to the
- new value being assigned.
- title
element of a document is the first
+ title
element in the document (in tree order), if
+ there is one, or null otherwise.
+
+ The title
attribute must, on getting, run the
+ following algorithm:
+
+ 1. If the document element is an SVG svg element, then let
+ value be the child text content of the first
+ SVG title
element that is a child of the document element. [[!SVG]]
+ 2. Otherwise, let value be the child text content of the
+ title
element, in tree order, or
+ the empty string if the title
element is null.
+ 3. Strip and collapse whitespace in value.
+ 4. Return value.
+
+ On setting, the steps corresponding to the first matching condition in the following list must
+ be run:
+
+ : If the document element is an SVG svg element [[!SVG]]
+ :: 1. Let element be the first SVG title
element that is a child
+ of the document element, if any. If there isn't one, create a
+ SVG title
element, insert it as the first child of the
+ document element, and let element be that element. [[!SVG]]
+ 2. Act as if the {{Node/textContent}} IDL attribute of element was set to the new
+ value being assigned.
+
+ : If the document element is in the HTML namespace
+ :: 1. If the title
element is null and the <{head}> element
+ is null, then abort these steps.
+ 2. If the title
element is null, then create a new
+ title
element and append it to the <{head}>
+ element, and let element be the newly created element; otherwise, let
+ element be the title
element.
+ 3. Act as if the {{Node/textContent}} IDL attribute of element was set to the
+ new value being assigned.
+
+ : Otherwise
+ :: Do nothing.
body
attribute, on getting, must return the <{body}> element of
- the document (either a <{body}> element, a <{frameset}> element, or null). On
- setting, the following algorithm must be run:
+ The body
attribute, on getting, must return the
+ <{body}> element of the document (either a <{body}> element, a <{frameset}> element, or null). On
+ setting, the following algorithm must be run:
- 1. If the new value is not a <{body}> or <{frameset}> element, then throw a
- HierarchyRequestError
exception and abort these steps.
- 2. Otherwise, if the new value is the same as the <{body}> element, do nothing. Abort these
- steps.
- 3. Otherwise, if the <{body}> element is not null, then replace that element with the new
- value in the DOM, as if the root element's replaceChild()
method had been
- called with the new value and the incumbent <{body}> element as its two arguments
- respectively, then abort these steps.
- 4. Otherwise, if there is no root element, throw a HierarchyRequestError
exception
- and abort these steps.
- 5. Otherwise, the <{body}> element is null, but there's a root element. Append the new value
- to the root element.
- images
attribute must return an HTMLCollection
rooted
- at the {{Document}} node, whose filter matches only <{img}> elements.
+ The images
attribute must return an HTMLCollection
rooted
+ at the {{Document}} node, whose filter matches only <{img}> elements.
- The embeds
attribute must return an HTMLCollection
rooted
- at the {{Document}} node, whose filter matches only <{embed}> elements.
+ The embeds
attribute must return an HTMLCollection
rooted
+ at the {{Document}} node, whose filter matches only <{embed}> elements.
- The plugins
attribute must return the same object as that returned by
- the embeds
attribute.
+ The plugins
attribute must return the same object as that returned by
+ the embeds
attribute.
- The links
attribute must return an HTMLCollection
rooted at
- the {{Document}} node, whose filter matches only <{a}> elements with
- <{links/href}> attributes and <{area}> elements with <{links/href}> attributes.
+ The links
attribute must return an HTMLCollection
rooted at
+ the {{Document}} node, whose filter matches only <{a}> elements with
+ <{links/href}> attributes and <{area}> elements with <{links/href}> attributes.
- The forms
attribute must return an HTMLCollection
rooted at
- the {{Document}} node, whose filter matches only <{form}> elements.
+ The forms
attribute must return an HTMLCollection
rooted at
+ the {{Document}} node, whose filter matches only <{form}> elements.
- The scripts
attribute must return an HTMLCollection
rooted
- at the {{Document}} node, whose filter matches only <{script}> elements.
+ The scripts
attribute must return an HTMLCollection
rooted
+ at the {{Document}} node, whose filter matches only <{script}> elements.
- currentScript
script
execution, returns the one that most recently started executing amongst
- those that have not yet finished executing.
+ Returns the <{script}> element, or the SVG script
element, that is
+ currently executing. In the case of reentrant script execution, returns the one that most
+ recently started executing amongst those that have not yet finished executing.
Returns null if the {{Document}} is not currently executing a script
- element (e.g., because the running script is an event handler, or a timeout).
+ element or SVG script
element (e.g., because the running script is an
+ event handler, or a timeout).
math
math
math
svg
math
type
attribute is in the toolbar state)svg
math
).
A paragraph is also formed explicitly by <{p}> elements.
@@ -1712,8 +1690,8 @@
The id
attribute specifies its element's unique identifier (ID). [[!DOM]]
- The value must be unique amongst all the IDs in the element's home subtree and must
- contain at least one character. The value must not contain any space characters.
+ The value must be unique amongst all the IDs in the element's tree and must contain
+ at least one character. The value must not contain any space characters.
There are no other restrictions on what form an ID can take; in particular, IDs can consist of @@ -1837,88 +1815,84 @@ to indicate a change in language). It provides an explicit indication to user agents about the language of content, so an appropriate language dictionary can be used and, in the case of screen readers and similar assistive technologies with voice output, the content is pronounced using the - correct voice / language library (where available). The lang attribute is also used for font - selection where different alphabets are mixed.
- -Incorrect or absent <{global/lang}> attributes can produce unexpected results in other circumstances, - as they are also used to determine quotation marks for <{q}> elements, and for styling such + correct voice / language library (where available). The lang attribute is also used for font + selection where different alphabets are mixed.
+ +Incorrect or absent <{global/lang}> attributes can produce unexpected results in other circumstances, + as they are also used to determine quotation marks for <{q}> elements, and for styling such as hyphenation, case conversion, and line-breaking, as well as for spell-checking in some editors, etc.
- -Setting of a language using the <{global/lang}> attribute which does not match the
- language of the document or document parts will result in some users being unable to understand
+
+ Setting of a language using the <{global/lang}> attribute which does not match the
+ language of the document or document parts will result in some users being unable to understand
the content.
- For example, if a document is delivered over HTTP and the
+ For example, if a document is delivered over HTTP and the
- Thus, for instance, an element with
+ Thus, for instance, an element with
This algorithm will only get invoked by the Web IDL specification for names that are given
- by the earlier algorithm for getting the list of name-value pairs. [[!WEBIDL]]
+ by the earlier algorithm for getting the list of name-value pairs. [[!WEBIDL]]
This requirement is a willful violation of the XSLT 1.0 specification, required because
@@ -3675,22 +3731,14 @@
if the content attribute's value is the empty string; and on setting, if the content attribute
is not present, it must first be added.
- If a reflecting IDL attribute is a
- All
- Setting
- The
- The
- For example, attributes in end tags are currently invalid and ignored. A future change to
- the language may make use of this syntax feature and can do so without conflicting with
+ For example, attributes in end tags are ignored currently, but they are invalid, in case a
+ future change to the language makes use of that syntax feature without conflicting with
already-deployed (and valid!) content.
- For example, <{div}> elements are rendered as block boxes, and <{span}> elements as
- inline boxes. Putting a block box in an inline box is unnecessarily confusing;
- since either nesting just <{div}> elements, or nesting just <{span}> elements, or nesting
- <{span}> elements inside <{div}> elements all serve the same purpose as nesting a <{div}>
- element in a <{span}> element, but only the latter involves a block box in an
+ For example, <{div}> elements are rendered as block boxes, and <{span}> elements as
+ inline boxes. Putting a block box in an inline box is unnecessarily confusing;
+ since either nesting just <{div}> elements, or nesting just <{span}> elements, or nesting
+ <{span}> elements inside <{div}> elements all serve the same purpose as nesting a <{div}>
+ element in a <{span}> element, but only the latter involves a block box in an
inline box, the latter combination is disallowed.
The requirements above imply that images can be static bitmaps (e.g., PNGs, GIFs, JPEGs),
- single-page vector documents (single-page PDFs, XML files with an SVG root element), animated
- bitmaps (APNGs, animated GIFs), animated vector graphics (XML files with an SVG root element
+ single-page vector documents (single-page PDFs, XML files with an SVG document element), animated
+ bitmaps (APNGs, animated GIFs), animated vector graphics (XML files with an SVG document element
that use declarative SMIL animation), and so forth. However, these definitions preclude SVG
files with script, multipage PDF files, interactive MNG files, HTML documents, plain text
documents, and so forth. [[!PNG]] [[!GIF]] [[!JPEG]] [[!PDF]] [[!XML]] [[!APNG]] [[!SVG]] [[!MNG]]
@@ -1344,12 +1344,13 @@
This allows servers to return images with error responses, and have them displayed.
- A
+
- To determine the language of a node, user agents must look at the nearest ancestor
- element (including the element itself if the node is an element) that has a
- <{global/lang}> attribute in the XML namespace set or is an HTML element
- and has a <{global/lang}> in no namespace attribute set. That attribute specifies the language
- of the node (regardless of its value).
-
- If both the <{global/lang}> attribute in no namespace and the
- <{global/lang}> attribute in the XML namespace are set on an element, user
- agents must use the <{global/lang}> attribute in the XML namespace, and the
- <{global/lang}> attribute in no namespace must be ignored for the purposes of
- determining the element's language.
-
- If neither the node nor any of the node's ancestors, including the root element,
- have either attribute set, but there is a pragma-set default language set, then that
- is the language of the node. If there is no pragma-set default language set, then
- language information from a higher-level protocol (such as HTTP), if any, must be used as the
- final fallback language instead. In the absence of any such language information, and in cases
- where the higher-level protocol reports multiple languages, the language of the node is unknown,
- and the corresponding language tag is the empty string.
-
- Content-Language
HTTP
- header is specified with a value "en
", then for any element in the document
- that does not itself have a <{global/lang}> attribute nor any ancestor of that element, the
- fallback language for the element will be English. If the value of the
- Content-Language
header was "de, fr, it
" then the language of the
- node is unknown. This
- article provides some additional guidance on the use of HTTP headers, and <{meta}>
- elements for providing language information.
- Content-Language
HTTP
+ header is specified with a value "en
", then for any element in the document that
+ does not itself have a <{global/lang}> attribute nor any ancestor of that element, the fallback
+ language for the element will be English. If the value of the Content-Language
+ header was "de, fr, it
" then the language of the node is unknown.
+ This article provides
+ some additional guidance on the use of HTTP headers, and <{meta}> elements for providing
+ language information.
+ lang="xyzzy"
would be matched by the selector
- :lang(xyzzy)
(e.g., in CSS), but it would not be matched by
- :lang(abcde)
, even though both are equally invalid. Similarly, if a Web browser
- and screen reader working in unison communicated about the language of the element, the
- browser would tell the screen reader that the language was "xyzzy", even if it knew it was
- invalid, just in case the screen reader actually supported a language with that tag after all.
- Even if the screen reader supported both BCP 47 and another syntax for encoding language
- names, and in that other syntax the string "xyzzy" was a way to denote the Belarusian
- language, it would be incorrect for the screen reader to then start treating text as
- Belarusian, because "xyzzy" is not how Belarusian is described in BCP 47 codes (BCP 47 uses
- the code "be" for Belarusian).
- lang="xyzzy"
would be matched by the selector
+ :lang(xyzzy)
(e.g., in CSS), but it would not be matched by
+ :lang(abcde)
, even though both are equally invalid. Similarly, if a Web browser and
+ screen reader working in unison communicated about the language of the element, the browser
+ would tell the screen reader that the language was "xyzzy", even if it knew it was invalid,
+ just in case the screen reader actually supported a language with that tag after all. Even if
+ the screen reader supported both BCP 47 and another syntax for encoding language names, and in
+ that other syntax the string "xyzzy" was a way to denote the Belarusian language, it would be
+ incorrect for the screen reader to then start treating text as Belarusian, because
+ "xyzzy" is not how Belarusian is described in BCP 47 codes (BCP 47 uses the code "be" for
+ Belarusian).
+
+
- User agents may use the element's language to determine proper processing or rendering (e.g., in
- the selection of appropriate fonts or pronunciations, for dictionary selection, or for the user
- interfaces of form controls such as date pickers).
+ User agents may use the element's language to determine proper processing or rendering (e.g., in
+ the selection of appropriate fonts or pronunciations, for dictionary selection, or for the user
+ interfaces of form controls such as date pickers).
-
+
- The lang
IDL attribute must reflect the <{global/lang}> content
- attribute in no namespace.
- lang
IDL attribute must reflect the
+ <{global/lang}> content attribute in no namespace.
The <{global/translate}> attribute
@@ -1940,7 +1914,7 @@
translate
attribute is in the inherit state, or the element is not an
HTML element and thus does not have a translate
attribute; in either case, the
element's translation mode is in the same state as its parent element's, if any, or in the
- translate-enabled state, if the element is a root element.
+ translate-enabled state, if the element is a document element.
When an element is in the translate-enabled state, the element's
translatable attributes and the values of its Text
node children are to be
@@ -1984,7 +1958,7 @@
<!DOCTYPE HTML>
- <html> <!-- default on the root element is translate=yes -->
+ <html> <!-- default on the document element is translate=yes -->
<head>
<title>The Bee Game</title> <!-- implied translate=yes inherited from ancestors -->
</head>
@@ -2046,7 +2020,7 @@
DOMStringMap
object, associated with the following algorithms, which expose these
attributes on their element:
- : The algorithm for getting the list of name-value pairs
+ : The algorithm for getting the list of name-value pairs
:: 1. Let list be an empty list of name-value pairs.
2. For each content attribute on the element whose first five characters are the string
"<{global/data-}>" and whose remaining characters (if any) do not include any
@@ -2407,7 +2381,7 @@
converted to ASCII uppercase.
4. Return list.
- : The algorithm for setting names to certain values
+ : The algorithm for setting names to certain values
:: 1. Let name be the name passed to the algorithm.
2. Let value be the value passed to the algorithm.
3. If name contains a U+002D HYPHEN-MINUS character (-) followed by a
@@ -2422,7 +2396,7 @@
setAttribute()
would have thrown an exception when setting an attribute
with the name name, then this must throw the same exception.
- : The algorithm for deleting names
+ : The algorithm for deleting names
:: 1. Let name be the name passed to the algorithm.
2. For each uppercase ASCII letter in name, insert a U+002D HYPHEN-MINUS
character (-) before the character and replace the character with the same character
@@ -2433,7 +2407,7 @@
-
+ math
MathML
math
Content that represents a mathematical expression.
none
diff --git a/sections/editing.include b/sections/editing.include
index 75f1628166..8161c435bf 100644
--- a/sections/editing.include
+++ b/sections/editing.include
@@ -159,8 +159,7 @@
{{Document}}, must be marked as inert.
An entire Document
can be marked as blocked by a modal dialog
- subject. While a Document
is so marked, every node that is in the
- Document
, with the exception of the subject element and its
+ subject. While a Document
is so marked, every node that is in the Document
, with the exception of the subject element and its
descendants, must be marked inert. (The elements excepted by this paragraph can
additionally be marked inert through other means; being part of a modal dialog does not
"protect" a node from being marked inert.)
@@ -834,7 +833,7 @@
- Document
Document
that has a <{body}> element, then let target node be the body
element of that {{Document}}.
+ If target node is a Document
that has a <{body}> element, then let target node be the <{body}> element of that {{Document}}.
- Otherwise, if target node is a Document
that has a
- root element, then let target node be the root
- element of that {{Document}}.
+ Otherwise, if target node is a {{Document}} object that has a non-null
+ document element, then let target node be that document element.
focus()
method on the Document
's root element.
+ viewport, call the focus()
method on the Document
's document element.
Do not use this method to hide the focus ring if you find the focus ring unsightly. Instead,
use a CSS rule to override the 'outline' property, and provide a different way to show what
@@ -1556,12 +1553,13 @@
Document
that has a <{body}> element, then let candidate be the body
element of that {{Document}}.
-
- Otherwise, if candidate is a Document
that has a root
- element, then let candidate be the root element of that
+ If candidate is a Document
that has a <{body}> element, then let
+ candidate be the <{body}> element of that
{{Document}}.
+ Otherwise, if candidate is a {{Document}} with a non-null document element, then
+ let candidate be that document element.
+
Otherwise, if candidate is a {{Document}}, then let candidate be null.
contentEditable
IDL attribute, on
- getting, must return the string "true
" if the content attribute is set to
+ The contentEditable
IDL attribute,
+ on getting, must return the string "true
" if the content attribute is set to
the true state, "false
" if the content attribute is set to the false state,
- and "inherit
" otherwise. On setting, if the new value is an ASCII
- case-insensitive match for the string "inherit
" then the content
+ and "inherit
" otherwise. On setting, if the new value is an
+ ASCII case-insensitive match for the string "inherit
" then the content
attribute must be removed, if the new value is an ASCII case-insensitive match for
the string "true
" then the content attribute must be set to the string
"true
", if the new value is an ASCII case-insensitive match for
@@ -1821,11 +1819,11 @@
The designMode
IDL attribute on the
- Document
object takes two values, "on
" and "off
". On setting, the new value must be compared in an ASCII
- case-insensitive manner to these two values; if it matches the "on
"
- value, then designMode
must be enabled, and if it
- matches the "off
" value, then designMode
must be disabled. Other values must be
- ignored.
+ Document
object takes two values, "on
" and "off
". On
+ setting, the new value must be compared in an ASCII case-insensitive manner to these two
+ values; if it matches the "on
" value, then designMode
must be enabled,
+ and if it matches the "off
" value, then designMode
must be disabled.
+ Other values must be ignored.
On getting, if designMode
is enabled, the IDL
attribute must return the value "on
"; otherwise it is disabled, and the
@@ -1838,7 +1836,7 @@
When the designMode
changes from being disabled to
being enabled, the user agent must immediately reset the document's active range's
start and end boundary points to be at the start of the Document
and then run the
- focusing steps for the root element of the {{Document}}, if any.
+ focusing steps for the document element of the {{Document}}, if non-null.
Best practices for in-page editors
@@ -2517,8 +2515,7 @@
the protected mode, return the empty string and abort these
steps.
- application/xml
[[!RFC7303]]
: Published specification:
:: Labeling a resource with the application/xhtml+xml
type asserts that the resource
- is an XML document that likely has a root element from the HTML namespace. Thus, the
- relevant specifications are the XML specification, the Namespaces in XML specification, and
- this specification. [[!XML]] [[!XPTR-XMLNS]]
+ is an XML document that likely has a document element from the HTML namespace.
+ Thus, the relevant specifications are the XML specification, the Namespaces in XML
+ specification, and this specification. [[!XML]] [[!XPTR-XMLNS]]
: Applications that use this media type:
:: Same as for application/xml
[[!RFC7303]]
: Additional information:
@@ -176,9 +176,8 @@
: Magic number(s):
:: Same as for application/xml
[[!RFC7303]]
: File extension(s):
- :: "xhtml
" and "xht
"
- are sometimes used as extensions for XML resources that have a root element from the
- HTML namespace.
+ :: "xhtml
" and "xht
" are sometimes used as extensions for XML
+ resources that have a document element from the HTML namespace.
: Macintosh file type code(s):
:: TEXT
: Person & email address to contact for further information:
diff --git a/sections/infrastructure.include b/sections/infrastructure.include
index 8ea6ca6551..7dd7c83c75 100644
--- a/sections/infrastructure.include
+++ b/sections/infrastructure.include
@@ -15,40 +15,43 @@
This specification refers to both HTML and XML attributes and IDL attributes, often in the same
context. When it is not clear which is being referred to, they are referred to as
- content attributes for HTML and XML attributes, and IDL attributes for those
- defined on IDL interfaces. Similarly, the term "properties" is used for both JavaScript object
- properties and CSS properties. When these are ambiguous they are qualified as
- object properties and CSS properties respectively.
-
- Generally, when the specification states that a feature applies to the HTML syntax or
- the XHTML syntax, it also includes the other. When a feature specifically only applies to
- one of the two languages, it is called out by explicitly stating that it does not apply to the
- other format, as in "for HTML, ... (this does not apply to XHTML)".
-
- This specification uses the term document to refer to any use of HTML, ranging from
- short static documents to long essays or reports with rich multimedia, as well as to fully-fledged
- interactive applications. The term is used to refer both to {{Document}} objects and
- their descendant DOM trees, and to serialized byte streams using the HTML syntax or
- XHTML syntax, depending on context.
-
- In the context of the DOM structures, the terms HTML document and XML document are
- used as defined in the DOM specification, and refer specifically to two different modes that
- {{Document}} objects can find themselves in. [[!DOM]] (Such uses are always hyperlinked
- to their definition.)
+ content attributes for HTML and XML attributes, and
+ IDL attributes for those defined on IDL interfaces.
+ Similarly, the term "properties" is used for both JavaScript object properties and CSS properties.
+ When these are ambiguous they are qualified as
+ object properties and
+ CSS properties respectively.
+
+ Generally, when the specification states that a feature applies to
+ the HTML syntax or the XHTML syntax, it also includes
+ the other. When a feature specifically only applies to one of the two languages, it is called out
+ by explicitly stating that it does not apply to the other format, as in "for HTML, ... (this does
+ not apply to XHTML)".
+
+ This specification uses the term document to refer to any use
+ of HTML, ranging from short static documents to long essays or reports with rich multimedia, as
+ well as to fully-fledged interactive applications. The term is used to refer both to {{Document}}
+ objects and their descendant DOM trees, and to serialized byte streams using the
+ HTML syntax or XHTML syntax, depending on context.
+
+ In the context of the DOM structures, the terms HTML document and XML document
+ are used as defined in the DOM specification, and refer specifically to two different modes that
+ {{Document}} objects can find themselves in. [[!DOM]] (Such uses are always hyperlinked to their
+ definition.)
In the context of byte streams, the term HTML document refers to resources labeled as
- text/html
, and the term XML document refers to resources labeled with an
- XML MIME type.
+ text/html
, and the term XML document refers to
+ resources labeled with an XML MIME type.
- The term XHTML document is used to refer to both documents in the
- XML document mode that contain element nodes in the HTML namespace, and byte
- streams labeled with an XML MIME type that contain elements from the HTML namespace,
- depending on context.
+ The term XHTML document is used to refer to both
+ Documents in the XML document mode that contains element nodes in the
+ HTML namespace, and byte streams labeled with an XML MIME type that contain elements
+ from the HTML namespace, depending on context.
- For simplicity, terms such as shown, displayed, and visible are
- used (sometimes) when referring to the way a document is rendered to the user. These terms are
+ For simplicity, terms such as shown, displayed, and visible might
+ sometimes be used when referring to the way a document is rendered to the user. These terms are
not meant to imply a visual medium; they must be considered to apply to other media in equivalent
ways.
@@ -86,37 +89,37 @@
What some specifications, in particular the HTTP specification, refer to as a
- representation is referred to in this specification as a resource. [[!HTTP]]
+ representation is referred to in this specification as a resource.
+ [[!HTTP]]
- The term MIME type is used to refer to what is sometimes called an Internet media
- type in protocol literature. The term media type in this specification is used to refer
- to the type of media intended for presentation, as used by the CSS specifications. [[!RFC2046]]
+ The term MIME type is used to refer to what is sometimes
+ called an Internet media type in protocol literature. The term
+ media type in this specification is used to refer to the
+ type of media intended for presentation, as used by the CSS specifications. [[!RFC2046]]
[[!MEDIAQ]]
- A string is a valid MIME type if it matches the media-type
rule. In particular, a valid mime type may include
- MIME type parameters. [[!HTTP]]
+ A string is a valid MIME type if it matches the media-type
rule. In
+ particular, a valid MIME type may include MIME type parameters. [[!HTTP]]
- A string is a valid MIME type with no parameters if it matches the
- media-type
rule, but does not
- contain any U+003B SEMICOLON characters (;). In other words, if it consists only of a type and
- subtype, with no MIME Type parameters. [[!HTTP]]
+ A string is a valid MIME type with no parameters if it matches the
+ media-type
rule, but does not contain any U+003B SEMICOLON characters (;). In
+ other words, if it consists only of a type and subtype, with no MIME Type parameters. [[!HTTP]]
The term HTML MIME type is used to refer to the MIME type
text/html
.
- A resource's critical subresources are those that the resource needs to have available
- to be correctly processed. Which resources are considered critical or not is defined by the
- specification that defines the resource's format.
-
- The term data:
URL refers to URLs that use the data:
- scheme. [[!RFC2397]]
+ A resource's critical subresources are
+ those that the resource needs to have available to be correctly processed. Which resources are
+ considered critical or not is defined by the specification that defines the resource's format.
XML
- To ease migration from HTML to XHTML, user agents conforming to this specification will place elements in
- HTML in the http://www.w3.org/1999/xhtml
namespace, at least for the purposes of the
- DOM and CSS. The term "HTML elements", when used in this specification, refers to any
- element in that namespace, and thus refers to both HTML and XHTML elements.
+ To ease migration from HTML to XHTML, user agents conforming to this specification will place
+ elements in HTML in the http://www.w3.org/1999/xhtml
namespace, at least for the
+ purposes of the DOM and CSS. The term "HTML elements",
+ when used in this specification, refers to any element in that namespace, and thus refers to both
+ HTML and XHTML elements.
Except where otherwise stated, all elements defined or mentioned in this specification are in the
HTML namespace ("http://www.w3.org/1999/xhtml
"), and all attributes defined or
@@ -128,8 +131,8 @@
defined above) the HTML namespace.
Attribute names are said to be XML-compatible if they match the
- Name
production defined in XML and they contain no U+003A COLON characters
- (:). [[!XML]]
+ Name
production defined in XML and they contain no U+003A COLON
+ characters (:). [[!XML]]
The term XML MIME type is used to refer to the MIME types text/xml
,
application/xml
, and any MIME type whose subtype ends with the four characters
@@ -137,38 +140,6 @@
DOM trees
- The root element of a {{Document}} object is that {{Document}}'s
- first element child, if any. If it does not have one then the {{Document}} has no root
- element.
-
- The term root element, when not referring to a {{Document}} object's root
- element, means the furthest ancestor element node of whatever node is being discussed, or the node
- itself if it has no ancestors. When the node is a part of the document, then the node's
- root element is indeed the document's root element; however, if the node is not currently
- part of the document tree, the root element will be an orphaned node.
-
- When an element's root element is the root element of a Document
object,
- it is said to be in a {{Document}}. An element is said to have been
- inserted into a document when its root element changes and is now the document's
- root element. Analogously, an element is said to have been
- removed from a document when its root element changes from being the document's
- root element to being another element.
-
- A node's home subtree is the subtree rooted at that node's root element. When a
- node is in a Document
, its home subtree is that {{Document}}'s tree.
-
- The {{Document}} of a {{Node}} (such as an element) is the {{Document}}
- that the {{Node}}'s {{Node/ownerDocument}} IDL attribute returns. When a
- {{Node}} is in a Document
then that {{Document}} is
- always the {{Node}}'s {{Document}}, and the {{Node}}'s
- {{Node/ownerDocument}} IDL attribute thus always returns that {{Document}}.
-
- The {{Document}} of a content attribute is the {{Document}} of the attribute's
- element.
-
- The term tree order means a pre-order, depth-first traversal of DOM nodes involved
- (through the {{Node/parentNode}}/{{Node/childNodes}} relationship).
-
When it is stated that some element or attribute is ignored, or treated as some other
value, or handled as if it was something else, this refers only to the processing of the node
after it is in the DOM. A user agent must not mutate the DOM in such situations.
@@ -176,19 +147,25 @@
A content attribute is said to change value only if its new value is different than its
previous value; setting an attribute to a value it already has does not change it.
- When an attribute value, {{Text}} node, or string is described as empty, it means that the length of the text is zero (i.e., not even containing spaces or
- control characters).
+ The term empty, when used for an attribute value, {{Text}} node, or string means that
+ the length of the text is zero (i.e., not even containing spaces or control characters).
+
+ An element's child text content is the concatenation of the data of all the
+ {{Text}} nodes that are children of the element (ignoring any other nodes such as comments or
+ elements), in tree order.
- A node A is
- inserted into a node B when the
+ A node A is inserted into a node B when the
insertion steps are invoked with A as the argument and A's new parent
is B. Similarly, a node A is removed from a node B
when the removing steps are invoked with A as the removedNode
argument and B as the oldParent argument.
- An element's child text content is the concatenation of the data of all the
- {{Text}} nodes that are children of the element (ignoring any other nodes such as comments or
- elements), in tree order.
+ A node is inserted into a document
+ when the insertion steps are invoked with it as the argument and it is now
+ in a document tree. Analogously, a
+ node is removed from a document
+ when the removing steps are invoked with it as the argument and it is now no longer in a
+ document tree.
Scripting
@@ -640,7 +617,6 @@
* Percent decode
* set the username
* set the password
- * The domain to ASCII algorithm
* The domain to Unicode algorithm
* non-relative flag
* Parse errors from the URL parser
@@ -929,21 +905,23 @@
* {{createElementNS()}} method
* {{getElementById()}} method
* {{Element/getElementsByClassName()}} method
- * {{insertBefore()}} method
* {{appendChild()}} method
* {{cloneNode()}} method
* {{importNode()}} method
- * {{childNodes}} attribute
- * {{Element/localName}} attribute
- * {{parentNode}} attribute
- * {{Element/namespaceURI}} attribute
- * {{tagName}} attribute
* {{Element/id}} attribute
* {{Node/textContent}} attribute
- * The insert, append, remove, replace, and
- adopt algorithms for nodes
- * The insertion steps, removing steps, and adopting steps
- hooks
+ * The tree concept
+ * The tree order concept
+ * The root concept
+ * The inclusive ancestor concept
+ * The document element concept
+ * The in a document concept
+ * The pre-insert, insert, append,
+ remove, replace, and adopt algorithms
+ for nodes
+ * The insertion steps,
+ removing steps, and
+ adopting steps hooks
* The attribute list concept.
* The data of a text node.
* {{Event}} interface
@@ -1083,13 +1061,13 @@
: Media Source Extensions
:: The following terms are defined in the Media Source Extensions specification: [[!MEDIA-SOURCE]]
+ * {{MediaSource}} interface
* Detaching from a media element
- * {{MediaSource}} [[!MEDIA-SOURCE]]
: Media Capture and Streams
:: The following term is defined in the Media Capture and Streams specification: [[!MEDIACAPTURE-STREAMS]]
- * {{MediaStream}} [[!MEDIACAPTURE-STREAMS]]
+ * {{MediaStream}} interface
: XMLHttpRequest
:: This specification references the XMLHttpRequest specification to describe how the two
@@ -1369,7 +1347,84 @@
: Service Workers
:: The following terms are defined in Service Workers: [[!SERVICE-WORKERS]]
+ * client message queue
* match service worker registration
+ * ServiceWorkerContainer
+
+ : Secure Contexts
+ :: The following term is defined in Secure Contexts: [[!SECURE-CONTEXTS]]
+
+ * Is environment settings object a secure context?
+
+ : MathML
+ :: While support for MathML as a whole is not required by this specification (though it is
+ encouraged, at least for Web browsers), certain features depend upon small parts of MathML
+ being implemented. [[!MATHML]]
+
+ The following features are defined in the MathML specification:
+
+ * MathML annotation-xml
element
+ * MathML math
element
+ * MathML merror
element
+ * MathML mi
element
+ * MathML mn
element
+ * MathML mo
element
+ * MathML ms
element
+ * MathML mtext
element
+
+ : SVG
+ :: While support for SVG as a whole is not required by this specification (though it is
+ encouraged, at least for Web browsers), certain features depend upon parts of SVG being
+ implemented.
+
+ Also, the SVG specifications do not reflect implementation reality. Implementations implement
+ subsets of SVG 1.1 and SVG Tiny 1.2. Although it is hoped that the in-progress SVG 2
+ specification is a more realistic target for implementations, until that specification is
+ ready, user agents that implement SVG must do so with the following willful violations
+ and additions. [[!SVG11]] [[!SVGTINY12]] [[!SVG2]]
+
+ User agents that implement SVG must not implement the following features from SVG 1.1:
+
+ * The tref
element
+ * The cursor
element (use CSS's cursor
property instead)
+ * The font-defining SVG elements: font
, glyph
,
+ missing-glyph
, hkern
, vkern
,
+ font-face
, font-face-src
, font-face-uri
,
+ font-face-format
, and font-face-name
(use CSS's
+ @font-face
instead)
+ * The externalResourcesRequired
attribute
+ * The enable-background
property
+ * The contentScriptType
and contentStyleType
attributes (use the
+ type
attribute on the SVG script
and
+ style
elements instead)
+
+ User agents that implement SVG must implement the following features from SVG Tiny 1.2:
+
+ * The non-scaling-stroke
value for the vector-effect
property
+ * The class
attribute is allowed on all SVG elements
+ * The tabindex
attribute is allowed on visible SVG elements
+ * The ARIA accessibility attributes are allowed on all SVG elements
+
+ The following features are defined in the SVG specifications:
+
+ * SVGImageElement
interface
+ * SVGScriptElement
interface
+ * SVGSVGElement
interface
+ * SVG desc
element
+ * SVG foreignObject
element
+ * SVG image
element
+ * SVG script
element
+ * SVG svg
element
+ * SVG title
element
+ * SVG use
element
+
+ : Filter Effects
+ :: The following feature is defined in the Filter Effects specification:
+
+ * <filter-function-list>
+
+
+
This specification does not require support of any particular network protocol, style
sheet language, scripting language, or any of the DOM specifications beyond those required in the
@@ -1580,8 +1635,9 @@
If the transformation program outputs an element in no namespace, the processor must, prior to
constructing the corresponding DOM element node, change the namespace of the element to the
- HTML namespace, ASCII-lowercase the element's local name, and ASCII-lowercase
- the names of any non-namespaced attributes on the element.
+ HTML namespace, ASCII-lowercase the
+ element's local name, and ASCII-lowercase the
+ names of any non-namespaced attributes on the element.
DOMString
attribute whose content attribute is
- defined to contain a URL, then on getting, the IDL attribute must parse the
- value of the content attribute relative to the element and return the resulting
- absolute URL if that was successful, or the empty string otherwise; and on setting, must
- set the content attribute to the specified literal value. If the content attribute is absent,
- the IDL attribute must return the default value, if the content attribute has one, or else the
- empty string.
-
- If a reflecting IDL attribute is a DOMString
attribute whose content attribute is
- defined to contain one or more URLs, then on getting, the IDL attribute must split the
- content attribute on spaces and return the concatenation of parsing each token URL
- to an absolute URL relative to the element, with a single U+0020 SPACE character between
- each URL, ignoring any tokens that did not resolve successfully. If the content attribute is
- absent, the IDL attribute must return the default value, if the content attribute has one, or
- else the empty string. On setting, the IDL attribute must set the content attribute to the
- specified literal value.
+ If a reflecting IDL attribute is a USVString
attribute whose content attribute
+ is defined to contain a URLs, then on getting, if the content attribute is
+ absent, the IDL attribute must return the empty string. Otherwise, the IDL attribute must
+ parse the value of the content attribute relative to the element's node document and
+ if that is successful, return the resulting URL string. If parsing fails, then the value of
+ the content attribute must be returned instead, converted to a
+ USVString
. On setting, the content attribute must be set to the specified new
+ value.
If a reflecting IDL attribute is a DOMString
attribute whose content attribute is
an enumerated attribute, and the IDL attribute is limited to only known values,
@@ -3708,9 +3756,9 @@
attribute must be removed, and otherwise, the content attribute must be set to the specified new
value.
- If a reflecting IDL attribute is a DOMString
attribute but doesn't fall into any
- of the above categories, then the getting and setting must be done in a transparent,
- case-preserving manner.
+ If a reflecting IDL attribute is a DOMString
or USVString
+ attribute but doesn't fall into any of the above categories, then the getting and setting must be
+ done in a transparent, case-preserving manner.
If a reflecting IDL attribute is a boolean
attribute, then on getting the IDL
attribute must return true if the content attribute is set, and false if it is absent. On
@@ -3805,10 +3853,10 @@
the IDL attribute must return null.
4. Otherwise, it must return candidate.
- On setting, if the given element has an id
attribute, and has the same
- home subtree as the element of the attribute being set, and the given element is the
- first element in that home subtree whose ID is the value of that id
- attribute, then the content attribute must be set to the value of that id
+ On setting, if the given element has an <{global/id}> attribute, and has the same
+ tree as the element of the attribute being set, and the given element is the
+ first element in that tree whose ID is the value of that <{global/id}>
+ attribute, then the content attribute must be set to the value of that <{global/id}>
attribute. Otherwise, the content attribute must be set to the empty string.
Collections
@@ -3826,7 +3874,7 @@
function (legacycaller
).
HTMLAllCollection
objects are rooted at a {{Document}} and have a filter that
+ All {{HTMLAllCollection}} objects are rooted at a {{Document}} and have a filter that
matches all elements, so the elements represented by the collection of an
{{HTMLAllCollection}} object consist of all the descendant elements of the root {{Document}}.
HTMLCollection
objects.
- On getting, the length
attribute must return the number of nodes
- represented by the collection.
+ On getting, the length
attribute
+ must return the number of nodes represented by the collection.
On setting, the behavior depends on whether the new value is equal to, greater than, or less than
the number of nodes represented by the collection at that time. If the number is the same,
@@ -4136,8 +4184,8 @@
the two numbers (old value minus new value).
length
never removes or adds any <{optgroup}> elements, and never
- adds new children to existing <{optgroup}> elements (though it can remove children from
+ Setting {{HTMLOptionsCollection/length}} never removes or adds any <{optgroup}> elements, and
+ never adds new children to existing <{optgroup}> elements (though it can remove children from
them).
HTMLOptionsCollection
is rooted.
- 6. Act as if the DOM insertBefore()
method was invoked on the parent node,
- with element as the first argument and reference as the second argument.
+ 6. Pre-insert element into parent node before reference.
- The remove(index)
method must act according to the following
- algorithm:
+ The remove(index)
method
+ must act according to the following algorithm:
1. If the number of nodes represented by the collection is zero, abort these steps.
2. If index is not a number greater than or equal to 0 and less than the number of
@@ -4194,18 +4241,18 @@
3. Let element be the indexth element in the collection.
4. Remove element from its parent node.
- The selectedIndex
IDL attribute must act like the identically named
- attribute on the <{select}> element on which the HTMLOptionsCollection
is
- rooted
+ The selectedIndex
IDL attribute must
+ act like the identically named attribute on the <{select}> element on which the
+ {{HTMLOptionsCollection}} is rooted
-The
+DOMStringMap
interfaceThe {{DOMStringMap}} interface
- The DOMStringMap
interface represents a set of name-value pairs. It exposes these
- using the scripting language's native mechanisms for property access.
+ The DOMStringMap
interface represents a set of name-value pairs. It exposes
+ these using the scripting language's native mechanisms for property access.
- When a DOMStringMap
object is instantiated, it is associated with three algorithms,
- one for getting the list of name-value pairs, one for setting names to certain values, and one for
- deleting names.
+ When a {{DOMStringMap}} object is instantiated, it is associated with three algorithms,
+ one for getting the list of name-value pairs, one for
+ setting names to certain values, and one for deleting names.
[OverrideBuiltins]
@@ -4216,66 +4263,60 @@
};
- The supported property names on a DOMStringMap
object at any instant are the
- names of each pair returned from the algorithm for getting the list of name-value pairs at that
- instant, in the order returned.
+ The supported property names on a {{DOMStringMap}} object at any
+ instant are the names of each pair returned from the algorithm for
+ getting the list of name-value pairs at that instant, in the order returned.
To determine the value of a named property name in a
{{DOMStringMap}}, the user agent must return the value component of the name-value pair
- whose name component is name in the list returned by the algorithm for getting the list
- of name-value pairs.
+ whose name component is name in the list returned by the algorithm for
+ getting the list of name-value pairs.
- To set the value of a named property name to value value, the
- algorithm for setting names to certain values must be run, passing name as the name and
- value as the value.
+ To set the value of a named property name to value
+ value, the algorithm for setting names to certain values must be run, passing
+ name as the name and value as the value.
- To delete an existing named property name, the algorithm for deleting names
- must be run, passing name as the name.
+ To delete an existing named property name, the algorithm for
+ deleting names must be run, passing name as the name.
- DOMStringMap
interface definition here is only intended for JavaScript
- environments. Other language bindings will need to define how DOMStringMap
is to be
- implemented for those languages.
- dataset
attribute on elements exposes the data-*
attributes on the
- element.
-
- Given the following fragment and elements with similar constructions:
-
- <img class="tower" id="tower5" data-x="12" data-y="5" data-ai="robotarget" data-hp="46" data-ability="flames" src="towers/rocket.png" alt="Rocket Tower">
-
- ...one could imagine a function splashDamage()
that takes some arguments, the first
- of which is the element to process:
-
-
- function splashDamage(node, x, y, damage) {
- if (node.classList.contains('tower') && // checking the 'class' attribute
- node.dataset.x == x && // reading the 'data-x' attribute
- node.dataset.y == y) { // reading the 'data-y' attribute
- var hp = parseInt(node.dataset.hp); // reading the 'data-hp' attribute
- hp = hp - damage;
- if (hp < 0) {
- hp = 0;
- node.dataset.ai = 'dead'; // setting the 'data-ai' attribute
- delete node.dataset.ability; // removing the 'data-ability' attribute
+
+ dataset
attribute on elements exposes the data-*
attributes on the
+ element.
+
+ Given the following fragment and elements with similar constructions:
+
+ <img class="tower" id="tower5" data-x="12" data-y="5" data-ai="robotarget" data-hp="46" data-ability="flames" src="towers/rocket.png" alt="Rocket Tower">
+
+ ...one could imagine a function splashDamage()
that takes some arguments, the first
+ of which is the element to process:
+
+
+ function splashDamage(node, x, y, damage) {
+ if (node.classList.contains('tower') && // checking the 'class' attribute
+ node.dataset.x == x && // reading the 'data-x' attribute
+ node.dataset.y == y) { // reading the 'data-y' attribute
+ var hp = parseInt(node.dataset.hp); // reading the 'data-hp' attribute
+ hp = hp - damage;
+ if (hp < 0) {
+ hp = 0;
+ node.dataset.ai = 'dead'; // setting the 'data-ai' attribute
+ delete node.dataset.ability; // removing the 'data-ability' attribute
+ }
+ node.dataset.hp = hp; // setting the 'data-hp' attribute
}
- node.dataset.hp = hp; // setting the 'data-hp' attribute
}
- }
-
-The
+DOMElementMap
interfaceThe {{DOMElementMap}} interface
- The DOMElementMap
interface represents a set of name-element mappings. It exposes
- these using the scripting language's native mechanisms for property access.
+ The DOMElementMap
interface represents a set of name-element
+ mappings. It exposes these using the scripting language's native mechanisms for property access.
- When a DOMElementMap
object is instantiated, it is associated with three algorithms,
- one for getting the list of name-element mappings, one for mapping a name to a certain element,
- and one for deleting mappings by name.
+ When a {{DOMElementMap}} object is instantiated, it is associated with three algorithms, one for
+ getting the list of name-element mappings, one for mapping a name to a certain element, and one
+ for deleting mappings by name.
interface DOMElementMap {
@@ -4285,12 +4326,12 @@
};
- The supported property names on a DOMElementMap
object at any instant are the
- names for each mapping returned from the algorithm for getting the list of name-element mappings
- at that instant, in the order returned.
+ The supported property names on a {{DOMElementMap}} object at any instant are
+ the names for each mapping returned from the algorithm for getting the list of name-element
+ mappings at that instant, in the order returned.
To determine the value of a named property name in a
- DOMElementMap
, the user agent must return the element component of the name-element
+ {{DOMElementMap}}, the user agent must return the element component of the name-element
mapping whose name component is name in the list returned by the algorithm for getting
the list of name-element mappings.
@@ -4302,9 +4343,9 @@
mappings must be run, passing name as the name component of the mapping to be deleted.
DOMElementMap
interface definition here is only intended for JavaScript
- environments. Other language bindings will need to define how DOMElementMap
is to
- be implemented for those languages.
+ The {{DOMElementMap}} interface definition here is only intended for JavaScript environments.
+ Other language bindings will need to define how {{DOMElementMap}} is to be implemented for those
+ languages.
Garbage collection
@@ -4313,7 +4354,7 @@
object to that object.
window.document
attribute on the {{Window}} object means that there is a strong reference
+ For example, the {{Window/document|window.document}} attribute on the {{Window}} object means that there is a strong reference
from a {{Window}} object to its {{Document}} object. Similarly, there is
always a strong reference from a {{Document}} to any descendant nodes, and from any
node to its owner node document.
diff --git a/sections/introduction.include b/sections/introduction.include
index 200efc8c8e..373e6f85d6 100644
--- a/sections/introduction.include
+++ b/sections/introduction.include
@@ -229,7 +229,7 @@
It is compatible with most legacy Web browsers. If a document is transmitted with the
text/html
MIME type, then it will be processed as an
HTML document by Web browsers. This specification defines the latest version of the HTML syntax,
- known as "HTML [LEVEL]".
+ known simply as "HTML".
The second concrete syntax is the XHTML syntax, which is an application of XML. When a document
is transmitted with an XML MIME type, such as
@@ -237,8 +237,8 @@
XML document by Web browsers, to be parsed by an XML processor. Authors are reminded that the
processing for XML and HTML differs; in particular, even minor syntax errors will prevent a
document labeled as XML from being rendered fully, whereas they would be ignored in the HTML
- syntax. This specification defines the latest version of the XHTML syntax, known as "XHTML
- [LEVEL]".
+ syntax. This specification defines the latest version of the XHTML syntax, known simply as
+ "XHTML".
The DOM, the HTML syntax, and the XHTML syntax cannot all represent the same content. For
example, namespaces cannot be represented using the HTML syntax, but they are supported in the
@@ -559,8 +559,8 @@
- The root element of this tree is the <{html}> element, which is the element always found at
- the root of HTML documents. It contains two elements, <{head}> and <{body}>, as well as a
+ The {{document}} element of this tree is the <{html}> element, which is the element always found
+ in that position in HTML documents. It contains two elements, <{head}> and <{body}>, as well as a
{{Text!!interface}} node between them.
There are many more {{Text!!interface}} nodes in the DOM tree than one would initially expect,
@@ -598,7 +598,7 @@
var a = document.links[0]; // obtain the first link in the document
a.href = 'sample.html'; // change the destination URL of the link
a.protocol = 'https'; // change just the scheme part of the URL
- a.setAttribute('href', 'https://example.com/'); // change the content attribute directly
+ a.setAttribute('href', 'http://example.com/'); // change the content attribute directly
Since DOM trees are used as the way to represent HTML documents when they are processed and
@@ -682,7 +682,7 @@
If the message was just displayed to the user without escaping, a hostile attacker could
then craft a URL that contained a script element:
- https://example.com/message.cgi?say=%3Cscript%3Ealert%28%27Oh%20no%21%27%29%3C/script%3E
+ http://example.com/message.cgi?say=%3Cscript%3Ealert%28%27Oh%20no%21%27%29%3C/script%3E
If the attacker then convinced a victim user to visit this page, a script of the
attacker's choosing would run on the page. Such a script could do any number of hostile
@@ -696,11 +696,10 @@
There are many constructs that can be used to try to trick a site into executing code. Here
are some that authors are encouraged to consider when writing safelist filters:
- * When allowing harmless-seeming elements like <{img}>, exercise the principle of
- least-privilege and limit the element's attributes to only those that are needed (e.g., via
- a safelist). If one allowed all attributes then an attacker could, for instance, use the
- onload
attribute to run arbitrary
- script.
+ * When allowing harmless-seeming elements like <{img}>, it is important to safelist any
+ provided attributes as well. If one allowed all attributes then an attacker could, for
+ instance, use the onload
attribute
+ to run arbitrary script.
* When allowing URLs to be provided (e.g., for links), the scheme of each URL also needs to be
explicitly safelisted, as there are many schemes that can be abused. The most prominent
example is "javascript:
", but user agents can implement (and indeed, have
@@ -732,7 +731,7 @@
To avoid this, sites that do not expect to be used in frames are encouraged to only enable
their interface if they detect that they are not in a frame (e.g., by comparing the
- {{Window}} object to the value of the {{Window/top}} attribute).
+ {{window}} object to the value of the {{Window/top}} attribute).
Common pitfalls to avoid when using the scripting APIs
@@ -744,10 +743,9 @@
the script uninterrupted before doing anything else, such as firing further events or continuing
to parse the document.
- On the other hand, parsing of HTML files happens in parallel and incrementally, meaning
- that the parser can pause at any point to let scripts run. This is generally a good thing, but it
- does mean that authors need to be careful to avoid hooking event handlers after the events could
- have possibly fired.
+ On the other hand, parsing of HTML files happens incrementally, meaning that the parser can pause
+ at any point to let scripts run. This is generally a good thing, but it does mean that authors
+ need to be careful to avoid hooking event handlers after the events could have possibly fired.
There are two techniques for doing this reliably: use event handler content attributes, or
create the element and add the event handlers in the same script. The latter is safe because, as
@@ -827,8 +825,8 @@
:: While it is possible to use presentational markup in a way that provides users of assistive
technologies (ATs) with an acceptable experience (e.g., using ARIA), doing so is significantly
more difficult than doing so when using semantically-appropriate markup. Furthermore,
- presentational markup does not guarantee accessibility for users of non-AT, non-graphical user
- agents (such as text-mode browsers).
+ even using such techniques doesn't help make pages accessible for non-AT, non-graphical users,
+ such as users of text-mode browsers.
Using media-independent markup, on the other hand, provides an easy way for documents to be
authored in such a way that they are "accessible" for more users (e.g., users of text
@@ -852,7 +850,7 @@
production environments, but it can be useful for rapid prototyping (where its rules can be
directly moved into a separate style sheet later) and for providing specific styles in unusual
cases where a separate style sheet would be inconvenient. Similarly, the <{style}> element can
- be useful for grouping or for page-specific styles, but in general an external style sheet
+ be useful in syndication or for page-specific styles, but in general an external style sheet
is likely to be more convenient when the styles apply to multiple pages.
It is also worth noting that some elements that were previously presentational have been
@@ -886,10 +884,11 @@
user agents, any syntax resulting in such behavior is considered invalid.
: Errors that can result in infoset coercion
:: When a user agent based on XML is connected to an HTML parser, it is possible that certain
- invariants that XML enforces, such as comments never containing two consecutive hyphens, will
- be violated by an HTML file. Handling this can require that the parser coerce the HTML DOM
- into an XML-compatible infoset. Most syntax constructs that require such handling are
- considered invalid.
+ invariants that XML enforces, such as element or attribute names never contain multiple
+ colons, will be violated by an HTML file. Handling this can require that the parser coerce the
+ HTML DOM into an XML-compatible infoset. Most syntax constructs that require such handling are
+ considered invalid. (Comments containing two consecutive hyphens, or ending with a hyphen, are
+ exceptions that are allowed in the HTML syntax.)
: Errors that result in disproportionately poor performance
:: Certain syntax constructs can result in disproportionately poor performance. To discourage the
use of such constructs, they are typically made non-conforming.
@@ -1065,8 +1064,8 @@
harmless features are disallowed.
about:blank
".
-
- Otherwise, parse the value of the <{frame/src}> attribute, relative to the
- <{frame}> element's node document.
-
- If that is not successful, then let url be the string
- "about:blank
". Otherwise, let url be the
- resulting URL record.
- 2. Navigate the element's child browsing contextto url.
-
-
summary {
display: list-item;
- list-style: disclosure-closed;
+ list-style: disclosure-closed inside;
}
details[open] > summary {
- list-style: disclosure-open;
+ list-style-type: disclosure-open;
}
diff --git a/sections/semantics-common-idioms.include b/sections/semantics-common-idioms.include
index eac1dcfadd..9f881d6bdc 100644
--- a/sections/semantics-common-idioms.include
+++ b/sections/semantics-common-idioms.include
@@ -338,7 +338,7 @@ closing for lunch</span>.
For example, the following CSS places a dashed line below elements that have a title
attribute.
-[title] { border-bottom: thin dashed; }
+ [title] { border-bottom: thin dashed; }
-
-
+ If that is not successful, then let url be the URL
+ "src
attribute specified, or its value is the empty string,
- let url be the string "about:blank
".
-
- Otherwise, parse the value of the src
attribute, relative to the <{iframe}> element.
-
- If that is not successful, then let url be the string
- "about:blank
". Otherwise, let url be the resulting URL string.
-
- src
attribute specified, or its
+ value is the empty string, let url be the URL "about:blank
".
- src
attribute, relative to the element's
+ node document.
- about:blank
". Otherwise, let url be the resulting URL record.
+ 2. If there exists an ancestor browsing context whose active document's
+ address, ignoring fragments, is equal to url, then abort these steps.
+ 3. Navigate the element's child browsing context to url.
- iframe
attributes
- algorithm was invoked, and that was the about:blank
{{Document}} created
- when the child browsing context was created, then any navigation required of the user agent in that algorithm must be completed
- with replacement enabled.
+ Similarly, if the child browsing context's session history contained only one
+ {{Document}} when the process the iframe
attributes algorithm was invoked, and
+ that was the about:blank
{{Document}} created when the child browsing context
+ was created, then any navigation required of the user agent in that algorithm must be
+ completed with replacement enabled.
- When a {{Document}} in an iframe
is marked as completely
- loaded, the user agent must run the iframe load event steps in parallel.
+ When a {{Document}} in an iframe
is marked as completely loaded, the user
+ agent must run the iframe load event steps in parallel.
load
event is also fired at the
- <{iframe}> element when it is created if no other data is loaded in it.
+ A load
event is also fired at the <{iframe}> element when it is created if no other
+ data is loaded in it.
MediaSource
object, then detach
- it.
+ is a MediaSource
object, then detach it.
mousedown
events and so forth would not simultaneously be fired at
- elements on the page.)
+ interface. (For example, if the user clicks on a video's playback control, mousedown
+ events and so forth would not simultaneously be fired at elements on the page.)
Where possible (specifically, for starting, stopping, pausing, and unpausing playback, for
seeking, for changing the rate of playback, for fast-forwarding or rewinding, for listing,
@@ -10804,9 +10782,9 @@ red:89
interface features exposed by the user agent must be implemented in terms of the DOM API described
above, so that, e.g., all the same events fire.
- For the purposes of listing chapters in the media resource, only text tracks in the media element's list of text tracks
- that are showing and whose text track kind is
- chapters
should be used. Such tracks must be
+ For the purposes of listing chapters in the media resource, only text tracks in the
+ media element's list of text tracks that are showing and
+ whose text track kind is chapters
should be used. Such tracks must be
interpreted according to the rules for constructing the chapter tree from a text
track. When seeking in response to a user manipulating a chapter selection interface, user
agents should not use the approximate-for-speed flag.
@@ -11023,37 +11001,28 @@ red:89
};
dictionary TrackEventInit : EventInit {
- (VideoTrack or AudioTrack or TextTrack)? track;
+ (VideoTrack or AudioTrack or TextTrack)? track = null;
};
-
- track
AudioTrack
, or
- VideoTrack
) to which the event relates.
-
+ Returns the track object ({{TextTrack}}, {{AudioTrack}}, or {{VideoTrack}}) to which the event
+ relates.
track
attribute must return the value
- it was initialized to. When the object is created, this attribute must be initialized to null. It
+ The track
attribute must return the value it
+ was initialized to. When the object is created, this attribute must be initialized to null. It
represents the context information for the event.
- Event summary
This section is non-normative.
- The following events fire on media elements as part of the
- processing model described above:
+ The following events fire on media elements as part of the processing model described
+ above: