71 lines
2.6 KiB
HTML
71 lines
2.6 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<style>
|
|
* {
|
|
background-color: white;
|
|
color: black;
|
|
}
|
|
:read-only {
|
|
background-color: pink;
|
|
}
|
|
:read-write {
|
|
color: green;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<p>This test checks the styling of element with :read-only and :read-write. Every element where text can be entered/changed should have green text over a white background. Every element that cannot be edited should have black text over pink background.</p>
|
|
<div>
|
|
<!-- Default is true -->
|
|
<div contenteditable>
|
|
<div>WebKit rocks! Editable</div>
|
|
<div contenteditable=false>
|
|
<div>Not editable</div>
|
|
</div>
|
|
</div>
|
|
<!-- True is true :) -->
|
|
<div contenteditable=true>
|
|
<div>Editable</div>
|
|
<div contenteditable=false>
|
|
<div>Not editable</div>
|
|
</div>
|
|
</div>
|
|
<!-- The case of the attribute's value is irrelevant. -->
|
|
<div contenteditable="TrUe">
|
|
<div>Editable</div>
|
|
<div contenteditable="FaLsE">
|
|
<div>Not editable</div>
|
|
</div>
|
|
</div>
|
|
<!-- The value "plaintext-only" is a WebKit extension, it defines an editing host too. -->
|
|
<div contenteditable="plaintext-only">
|
|
<div>Editable</div>
|
|
<div contenteditable="false">
|
|
<div id="non-editable-subblock-4">Not editable</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Per definition, the rules for editing host and editable elements do not apply do <input> elements. -->
|
|
<div contenteditable=true>
|
|
<div>Editable</div>
|
|
<input type="text" value="read-write input">
|
|
<input type="text" disabled value="read-only input">
|
|
<input type="text" readonly value="read-only input">
|
|
</div>
|
|
<input type="text" contenteditable=true disabled value="read-only input">
|
|
<input type="text" contenteditable=true readonly value="read-only input">
|
|
|
|
<!-- Same story for <textarea>, it has its own definition of :read-write/:read-only. The rules for editing host and editable elements do not apply must be ignored. -->
|
|
<div contenteditable=true>
|
|
<div>Editable</div>
|
|
<textarea>Editable text area</textarea>
|
|
<textarea disabled>Non editable text area</textarea>
|
|
<textarea readonly>Non editable text area</textarea>
|
|
</div>
|
|
<textarea contenteditable=true disabled>Non editable text area</textarea>
|
|
<textarea contenteditable=true readonly>Non editable text area</textarea>
|
|
</div>
|
|
</body>
|
|
</html>
|