diff --git a/source b/source index babca609fcb..bb2d3d9daeb 100644 --- a/source +++ b/source @@ -3450,6 +3450,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
The CSS specification also defines the following border properties:
@@ -3544,6 +3545,10 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute dThe term block-level is defined in + the CSS Display specification.
+The following features are defined in the CSS Fonts specification:
@@ -3581,13 +3586,18 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute dThe following features are defined in the CSS Text specification:
innerText
IDL attributeinnerText
[ = value ]Returns the element's text content "as rendered".
+ +Can be set, to replace the element's children with the given value, but with linebreaks
+ converted to br
elements.
On getting, the innerText
attribute must follow
+ these steps:
If the element is not being rendered, return the same value as the
+ textContent
IDL attribute on the element.
Compute a list of items each of which is a string or a "required line break count", a + positive integer, by applying the following recursive procedure to each child node + node of the element in tree order and concatenating the results. + (Intuitively, a "required line break count" item means that a certain number of line breaks must + appear at that point, but they can be collapsed with the line breaks induced by adjacent + "required line break count" items, reminiscient to CSS margin-collapsing.)
+ +Let items be the result of recursively applying this procedure to each child + of node and concatenating the results (producing a list of items).
If node's computed value of 'visibility' is not + 'visible', return items.
If node is a Text
node child of an rp
element, return
+ a single string item containing the text of node.
+
+
The rp
element is normally 'display:none' but we want to include
+ its text.
If node has no associated CSS box, return items.
+ +items can be non-empty due to 'display:contents'.
+If node is a Text
node, then for each CSS text box produced by
+ node, in content order, compute the text of the box after application of the CSS
+ 'white-space' processing rules and 'text-transform' rules, and return
+ a list of the resulting strings. The CSS 'white-space' processing rules are
+ slightly modified: collapsible spaces at the end of lines are always collapsed, but they are
+ only removed if the line is the last line of the block, or it ends with a br
+ element. Soft hyphens should be preserved.
If node is a br
element, append a string containing a single
+ U+000A LINE FEED (LF) character to items.
+
+
If node's computed value of 'display' is + 'table-cell', and node's CSS box is not the last + 'table-cell' box of its enclosing 'table-row' box, append a string containing a + single U+0009 CHARACTER TABULATION (tab) character to items.
If node's computed value of 'display' is + 'table-row', and node's CSS box is not the last + 'table-row' box of the nearest ancestor 'table' box, append a string + containing a single U+000A LINE FEED (LF) character to items.
If node is a p
element, add a "required line break count of 2"
+ item at the beginning and end of items.
If node's used value of 'display' is + block-level or 'table-caption', add a "required line break count of + 1" item at the beginning and end of items.
+ +Floats and absolutely-positioned elements fall into this category.
+Return items.
Delete any string items whose strings are empty.
Delete any runs of consecutive "required line break count" items at the start or end of + the list.
Replace each remaining run of consecutive "required line break count" items with a string + consisting of as many U+000A LINE FEED (LF) characters as the maximum of the values in the + "required line break count" items.
Return the concatenation of the string items.
Note that descendant nodes of most replaced elements (e.g. textarea
,
+ select
, and video
— but not button
) are not rendered
+ by CSS, strictly speaking, and therefore have no CSS boxes for the purposes of this algorithm.
This algorithm is amenable to being generalized to work on a ranges. Then we can use it as the basis for Selection
's
+ stringifier and maybe expose it directly on ranges. See Bugzilla bug 10583.
On setting, the innerText
attribute must replace the child
+ nodes of the element with new child nodes created as follows, processing the string in order:
For each run of text not including U+000D CARRIAGE RETURN (CR) or U+000A LINE FEED (LF),
+ create a Text
node containing that text.
For each U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pair, create a
+ br
element.
For each U+000D CARRIAGE RETURN (CR) or U+000A LINE FEED (LF) character not part of a
+ U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pair, create a br
+ element.
Part of the revision history of the innerText
IDL attribute can be found in the rocallahan/innerText-spec
+ repository, which is available under the Creative Commons Attribution 3.0
+ License.
For about ten years starting in 2003, this specification was almost entirely written by Ian Hickson (Google, ian@hixie.ch). More recently, Simon Pieters (Opera, simonp@opera.com), Anne van Kesteren (Mozilla, annevk@annevk.nl), Philip Jägenstedt (Google, philip@foolip.org), and