Improve support for :read-only and :read-write pseudoclasses.

This change fixes these two issues:

 1) The :read-write pseudoclass should apply to all elements which are
    editable, not just form elements.
 2) The :read-only pseudoclass should match all elements which is not
    matched by the :read-write class, not just form elements which are
    non-editable.

Case (1) is problematic because of the -webkit-user-modify property.
When we try to match :read-write to an element, we may not yet have applied
other rules which contain -webkit-user-modify and hence modify the
editability of the element. So, we can not check the computed style for
an element for a match against :read-write. Instead, I suggest checking
the conteteditable attribute on the element. If this attribute is set, and
contains an absolute value, then we have our answer. If the value is
"inherit", then we check the computed style of parent elements (via
rendererIsEditable()).

Note that this fix only works for elements which specify "contenteditable",
not for elements with -webkit-user-modify properties in their style.
However, the CSS property was removed from the spec, and it doesn't
appear to work in Firefox anymore either. It should probably be removed
from Blink.

The test-case fast/forms/select-live-pseudo-selectors.html failed with this
change, because it incorrectly and probably accidentally depended on
:read-only not being applied to <select> elements. Fixed by not applying
:read-only to <select> elements.

TEST=automated
BUG=338309

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167629 bbb929c8-8fbe-4397-9dbb-9b2b20218538
14 files changed
tree: 330c20c85a4a4bf5b3e9000b2ad6498f7da83636
  1. third_party/