You need to
before you can comment on or make changes to this bug.
When selecting a textarea, its :focus selector is not always applied directly.
STEPS TO REPRODUCE:
1. Open the example at <http://amonre.org/pub/css/textarea-focus/>.
2. Click in the textarea to focus it.
The textarea's background color stays red, but it should be green.
3. Switch to another window or tab, and select the window or tab containing the textarea.
The textarea's background color turns green.
In the example: the textarea's background color should be green whenever it is selected.
In the example: the textarea's background color stays red when selecting the textarea. The textarea's background color turns green when re-focusing the window containing the textarea.
This is a regression from r9935 (Make sure :focus is not matched when the window is not key). Clicking in the text area makes the WebHTMLView resign as first responder, which ultimately calls setDisplaysWithFocusAttributes(false), preventing the focus selector from matching. When the window is made key again, even though the WebHTMLView is still not first responder, it calls setDisplaysWithFocusAttributes(true).
I think this can be fixed by implementing formControlIsBecomingFirstResponder methods like the formControlIsResigningFirstResponder that already exist.
Created an attachment (id=7656) [details]
And another manual test...
Created an attachment (id=7657) [details]
(From update of attachment 7657 [details])
Looks fine. r=me
I think we can automate the manual test included in the patch, eventSender.mouseClick for first part and layoutTestController.setWindowIsKey for the second part.