DescriptionImprove 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
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=167629
Patch Set 1 #
Total comments: 2
Patch Set 2 : Fix handling of ancestral changes in contenteditable attribute. #
Total comments: 2
Patch Set 3 : Rebase. #Patch Set 4 : Remove html, head and body tags from test. #Messages
Total messages: 20 (0 generated)
|