Bug 19911

Summary: :read-only and :read-write pseudoclasses support
Product: WebKit Reporter: Michelangelo De Simone <michelangelo>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Enhancement CC: hyatt
Priority: P3    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://www.w3.org/TR/web-forms-2/#relation
Bug Depends on:    
Bug Blocks: 19264    
Attachments:
Description Flags
Support for :read-only and :read-write pseudoclasses
adele: review-
Support for :read-only and :read-write pseudoclasses (updated) adele: review+

Michelangelo De Simone
Reported Sunday, July 6, 2008 12:28:05 PM UTC
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.
Attachments
Support for :read-only and :read-write pseudoclasses (16.49 KB, patch)
2008-07-06 06:02 PDT, Michelangelo De Simone
adele: review-
Support for :read-only and :read-write pseudoclasses (updated) (16.08 KB, patch)
2008-07-07 14:09 PDT, Michelangelo De Simone
adele: review+
Michelangelo De Simone
Comment 1 Sunday, July 6, 2008 12:30:06 PM UTC
A patch is going to be submitted.
Michelangelo De Simone
Comment 2 Sunday, July 6, 2008 2:02:40 PM UTC
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.
Adele Peterson
Comment 3 Monday, July 7, 2008 6:02:34 PM UTC
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().
Adele Peterson
Comment 4 Monday, July 7, 2008 7:43:08 PM UTC
Also, we may want to add the -webkit prefix for these pseudoclasses.
Michelangelo De Simone
Comment 5 Monday, July 7, 2008 10:09:27 PM UTC
Created attachment 22140 [details] Support for :read-only and :read-write pseudoclasses (updated) Patch updated according to Adele's comments.
Adele Peterson
Comment 6 Monday, July 7, 2008 10:34:54 PM UTC
Committed revision 35042.
Dave Hyatt
Comment 7 Monday, July 7, 2008 10:40:27 PM UTC
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
Adele Peterson
Comment 8 Monday, July 7, 2008 10:41:06 PM UTC
re-opening. We need to address style-sharing with a new patch.
Michelangelo De Simone
Comment 9 Monday, July 7, 2008 11:41:16 PM UTC
Style sharing already checks for readonlyAttr. No issue.
Note You need to log in before you can comment on or make changes to this bug.