WebKit should be able to deal with :read-only and :read-write CSS pseudoclasses which apply to editable form controls (text/password inputs and textareas) when "readonly" attribute is specified. These pseudoclasses do not apply input types such radio, checkbox and so on.
A patch is going to be submitted.
Created attachment 22107 [details] Support for :read-only and :read-write pseudoclasses The attached patch includes Opera's test suite for :read-only and :read-write.
Comment on attachment 22107 [details] Support for :read-only and :read-write pseudoclasses Looks pretty good- I have just a few comments: atomic strings in CSSSelector.cpp should be readOnly and readWrite you shouldn't need the check && !e->isInputTypeHidden() you've left out checks for search fields and isindex - instead of using the specific checks for the type, you can use isTextField().
Also, we may want to add the -webkit prefix for these pseudoclasses.
Created attachment 22140 [details] Support for :read-only and :read-write pseudoclasses (updated) Patch updated according to Adele's comments.
Committed revision 35042.
This patch does not deal with style sharing: dhyatt: canShareStyleWithElement [4:38pm] dhyatt: if (isControl && (s->isEnabled() != m_element->isEnabled()) || [4:38pm] dhyatt: (s->isIndeterminate() != m_element->isIndeterminate()) || [4:38pm] dhyatt: (s->isChecked() != m_element->isChecked())) [4:38pm] dhyatt: return false; [4:38pm] dhyatt: has this check [4:38pm] dhyatt: for enabled/indeterminate/checked [4:38pm] dhyatt: you need to add readonlycontrol or whatever to this [4:38pm] dhyatt: make a test with two adjacent textareas [4:38pm] dhyatt: sibling textareas [4:38pm] dhyatt: and make the first one read-only and the second one not be read-only [4:38pm] dhyatt: and then write a pseudo rule [4:39pm] dhyatt: the second one will incorrectly match [4:39pm] dhyatt: because it will share style with the first
re-opening. We need to address style-sharing with a new patch.
Style sharing already checks for readonlyAttr. No issue.