blob: 8c66da43da01cdaadc1e8760fbd1675aaea3b890 [file] [log] [blame]
<!doctype html>
<html>
<head>
<style>
* {
background-color: pink;
color: black;
}
.read-write {
background-color: white;
color: green;
}
</style>
</head>
<body>
<!-- In the reference, we cannot use :read-only/:read-write for styling. The attributes must remain the same since they can be used by the theme. -->
<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 class="read-write">
<div class="read-write">WebKit rocks! Editable</div>
<div contenteditable=false>
<div>Not editable</div>
</div>
</div>
<!-- True is true :) -->
<div contenteditable=true class="read-write">
<div class="read-write">Editable</div>
<div contenteditable=false>
<div>Not editable</div>
</div>
</div>
<!-- The case of the attribute's value is irrelevant. -->
<div contenteditable="TrUe" class="read-write">
<div class="read-write">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" class="read-write">
<div class="read-write">Editable</div>
<div contenteditable="false">
<div>Not editable</div>
</div>
</div>
<!-- Per definition, the rules for editing host and editable elements do not apply do <input> elements. -->
<div contenteditable=true class="read-write">
<div class="read-write">Editable</div>
<input type="text" value="read-write input" class="read-write">
<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 class="read-write">
<div class="read-write">Editable</div>
<textarea class="read-write">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>