<!DOCTYPE html>
<html>
<style>
:read-only { color: green; }
:read-write { color: red; }
</style>
<body onload="document.designMode='on';document.designMode='off'">
<div>test</div>
</body>
</html>