Specification
Contents
Previous
Next

8.1 Specifying the language of content: the lang attribute

8.1.2 Inheritance of Language Codes

In the nested divs below, Browser should display the languages as described (though not all browsers provide a way to check what language a specific piece of text is).

This text is in the Default Language.
This text should be considered Spanish.
This text should be considered Portuguese.
This text should be considered Greek.
This text should inherit the language and be considered Greek.
This text should inherit the language and be considered Portuguese.
This text should inherit the language and be considered Spanish.
This text should inherit the Default Language.

8.2 Specifying the Direction of Text and Tables: the dir Attribute

8.2.3 Setting the Direction of embedded text

Except for the "Source order" column, all of the PRE elements below should show digits in the same order as the "Control" line.

Control:

0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9

Single span - the span to reverse is highlighted in yellow, and should be reversed in place without affecting the rest of the PRE element.

Source order Implicit text directions for remainder Explicit text directions for remainder
0 1 2 3 4 5 6 7 8 9 9 8 7 6 5 4 3 2 1 0
0 1 2 3 4 5 6 7 8 9 9 8 7 6 5 4 3 2 1 0
0 1 2 3 4 5 6 7 8 9 9 8 7 6 5 4 3 2 1 0
0 1 2 3 4 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5
0 1 2 3 4 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5
0 1 2 3 4 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5
9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9
9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9
9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9
4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 5 6 7 8 9
4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 5 6 7 8 9
4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 5 6 7 8 9

Two spans, not nested - the spans to reverse are highlighted in yellow, and should be reversed in place without affecting the rest of the PRE element.

Source order Implicit text directions for remainder Explicit text directions for remainder
0 1 2 3 4 9 8 7 6 5 0 1 2 3 4 9 8 7 6 5
0 1 2 3 4 9 8 7 6 5 0 1 2 3 4 9 8 7 6 5
0 1 2 3 4 9 8 7 6 5 0 1 2 3 4 9 8 7 6 5
0 1 2 7 6 5 4 3 8 9 0 1 2 3 4 5 9 8 7 6
0 1 2 7 6 5 4 3 8 9 0 1 2 3 4 5 9 8 7 6
0 1 2 7 6 5 4 3 8 9 0 1 2 3 4 5 9 8 7 6
0 1 3 2 4 5 7 6 8 9 0 1 2 3 4 5 6 7 8 9
0 1 3 2 4 5 7 6 8 9 0 1 2 3 4 5 6 7 8 9
0 1 3 2 4 5 7 6 8 9 0 1 2 3 4 5 6 7 8 9
8 7 6 5 4 3 2 1 0 9 9 8 7 6 5 4 3 2 1 0
8 7 6 5 4 3 2 1 0 9 9 8 7 6 5 4 3 2 1 0
8 7 6 5 4 3 2 1 0 9 9 8 7 6 5 4 3 2 1 0

Multiple spans, none nested - the spans to reverse are highlighted in yellow, and should be reversed in place without affecting the rest of the PRE element.

Source order Implicit text directions for remainder Explicit text directions for remainder
0 1 3 2 4 5 7 6 8 9 1 0 2 3 5 4 6 7 9 8
0 1 3 2 4 5 7 6 8 9 1 0 2 3 5 4 6 7 9 8
0 1 3 2 4 5 7 6 8 9 1 0 2 3 5 4 6 7 9 8

Nested spans - the outer spans to reverse are highlighted in yellow, the inner spans to reversed are highlighted in lime, and the yellow highlights should stay in the same place relative to the rest of the PRE.

Source order Implicit text directions for remainder Explicit text directions for remainder
0 1 2 3 4 9 8 7 6 5 0 1 2 3 4 9 8 7 6 5
0 1 2 3 4 9 8 7 6 5 0 1 2 3 4 9 8 7 6 5
0 1 2 3 4 9 8 7 6 5 0 1 2 3 4 9 8 7 6 5
0 1 2 3 9 8 7 6 0 1 2 3 4 5 9 8 7 6 5 4
0 1 2 3 9 8 7 6 0 1 2 3 4 5 9 8 7 6 5 4
0 1 2 3 9 8 7 6 0 1 2 3 4 5 9 8 7 6 5 4

8.2.4 Overriding the Bidirectional Algorithm: the BDO Element

Except for the "Source order" column, all of the PRE elements below should show digits in the same order as the "Control" line.

Control:

01234567890123456789

Single bdo - the bdo to reverse is highlighted in yellow, and should be reversed in place without affecting the rest of the PRE element.

Source order Implicit text directions for remainder Explicit text directions for remainder
01234567899876543210
01234567899876543210
01234567899876543210
01234987654321098765
01234987654321098765
01234987654321098765
98765432100123456789
98765432100123456789
98765432100123456789
43210987654321056789
43210987654321056789
43210987654321056789

Two bdos, not nested - the bdos to reverse are highlighted in yellow, and should be reversed in place without affecting the rest of the PRE element.

Source order Implicit text directions for remainder Explicit text directions for remainder
01234987650123498765
01234987650123498765
01234987650123498765
01276543890123459876
01276543890123459876
01276543890123459876
01324576890123456789
01324576890123456789
01324576890123456789
87654321099876543210
87654321099876543210
87654321099876543210

Multiple bdos, none nested - the bdos to reverse are highlighted in yellow, and should be reversed in place without affecting the rest of the PRE element.

Source order Implicit text directions for remainder Explicit text directions for remainder
01324576891023546798
01324576891023546798
01324576891023546798

Nested bdos - the outer bdos to reverse are highlighted in yellow, the inner bdos to reversed are highlighted in lime, and the yellow highlights should stay in the same place relative to the rest of the PRE.

Source order Implicit text directions for remainder Explicit text directions for remainder
01234987650123498765
01234987650123498765
01234987650123498765
01239876012345987654
01239876012345987654
01239876012345987654

8.2.5 Character References for directionality and joining control

Simple Test (should look like the second "Control" PRE above):

Hexadecimal character reference:

‮9876‬89012345‮76543‬012

Valid HTML 4.01!