Re-land "Improve support for :read-only and :read-write pseudoclasses".

The fix was reverted because it appeared to cause a security issue.
(It didn't).

Previous review: https://codereview.chromium.org/148223004

BUG=338309,353143
TEST=fast/css/readwrite-contenteditable.html
     fast/css/readwrite-contenteditable-recalc.html

Review URL: https://codereview.chromium.org/236753004

git-svn-id: svn://svn.chromium.org/blink/trunk@171564 bbb929c8-8fbe-4397-9dbb-9b2b20218538