Skip to content

Commit b420a47

Browse files
author
Sanders Kleinfeld
committed
Handling for "textarea" element.
1 parent fdcd784 commit b420a47

File tree

2 files changed

+43
-10
lines changed

2 files changed

+43
-10
lines changed

htmlbook.xsd

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -819,13 +819,7 @@
819819
</xs:attribute>
820820
<xs:attribute name="pattern" type="xs:string"/>
821821
<xs:attribute name="placeholder" type="xs:string"/>
822-
<xs:attribute name="readonly">
823-
<xs:simpleType>
824-
<xs:restriction base="xs:token">
825-
<xs:pattern value="([Rr][Ee][Aa][Dd][Oo][Nn][Ll][Yy])?"></xs:pattern>
826-
</xs:restriction>
827-
</xs:simpleType>
828-
</xs:attribute>
822+
<xs:attribute name="readonly" type="readonly_boolean"/>
829823
<xs:attribute name="required" type="required_boolean"/>
830824
<xs:attribute name="size" type="positive_int"/>
831825
<xs:attribute name="src" type="xs:anyURI"/>
@@ -1151,8 +1145,37 @@
11511145

11521146
<xs:element name="sup" type="inline_children_only"/>
11531147

1154-
<!-- Not imposing any HTMLBook specific constraints on button content; deferring to HTML5 spec -->
1155-
<xs:element name="textarea" type="any_elems_attrs"/>
1148+
<xs:element name="textarea">
1149+
<xs:complexType mixed="true">
1150+
<xs:attribute name="autofocus" type="autofocus_boolean"/>
1151+
<xs:attribute name="cols" type="positive_int"/>
1152+
<xs:attribute name="dirname" type="xs:string"/>
1153+
<xs:attribute name="disabled" type="disabled_boolean"/>
1154+
<!-- form attribute must refer to ID of a <form> element, but we're just checking that it's an IDREF -->
1155+
<xs:attribute name="form" type="xs:IDREF"/>
1156+
<xs:attribute name="maxlength" type="positive_int"/>
1157+
<xs:attribute name="name">
1158+
<xs:simpleType>
1159+
<xs:restriction base="xs:string">
1160+
<xs:minLength value="1"/>
1161+
</xs:restriction>
1162+
</xs:simpleType>
1163+
</xs:attribute>
1164+
<xs:attribute name="placeholder" type="xs:string"/>
1165+
<xs:attribute name="readonly" type="readonly_boolean"/>
1166+
<xs:attribute name="required" type="required_boolean"/>
1167+
<xs:attribute name="rows" type="positive_int"/>
1168+
<xs:attribute name="wrap">
1169+
<xs:simpleType>
1170+
<xs:restriction base="xs:token">
1171+
<xs:enumeration value="soft"/>
1172+
<xs:enumeration value="hard"/>
1173+
</xs:restriction>
1174+
</xs:simpleType>
1175+
</xs:attribute>
1176+
<xs:attributeGroup ref="globals"/>
1177+
</xs:complexType>
1178+
</xs:element>
11561179

11571180
<xs:element name="time">
11581181
<!-- time elements can have any inline children, excluding another "time" element -->
@@ -1558,6 +1581,13 @@
15581581
<xs:pattern value="([Mm][Uu][Ll][Tt][Ii][Pp][Ll][Ee])?"></xs:pattern>
15591582
</xs:restriction>
15601583
</xs:simpleType>
1584+
1585+
<!-- readonly boolean -->
1586+
<xs:simpleType name="readonly_boolean">
1587+
<xs:restriction base="xs:token">
1588+
<xs:pattern value="([Rr][Ee][Aa][Dd][Oo][Nn][Ll][Yy])?"></xs:pattern>
1589+
</xs:restriction>
1590+
</xs:simpleType>
15611591

15621592
<!-- required boolean -->
15631593
<xs:simpleType name="required_boolean">

samples/test_schema.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,10 @@ <h2>Inline testing</h2>
257257
<option disabled="disabled" label="lab" selected="selected" value="3">Option</option>
258258
</select>. And another select with an optgroup instead:
259259
<select id="select2"><optgroup label="optgroup" class="optgroup_class" id="optgroup_elem"><option disabled="disabled">Another option</option></optgroup></select></p>
260-
<p>Lastly, same for textarea like this: <textarea id="textareasarenice">there <bogusagain/> should not be any <em>child elems here</em>, but we don't really care</textarea></p>
260+
<p>Lastly, same for textarea like this:
261+
<textarea id="a_textarea_elem" autofocus="autofocuS" cols="3" dirname="dir" disabled="" form="coolform" maxlength="3" name="aname" placeholder="hmm"
262+
readonly="READONLY" required="required" rows="30" wrap="soft">a textarea</textarea>
263+
</p>
261264
<p>I love <cite id="coolbook">DocBook: The <em>Definitiv<b>e</b></em> Guide</cite></p>
262265
<p>To go into the directory you'd enter <code id="cd_command">cd <em>yourdirectoryname</em></code></p>
263266
<p>If we ever use a datalist, it would look like this:

0 commit comments

Comments
 (0)