css doesn't work correctly on FocusOut event

Germain Garand germain at ebooksfrance.org
Tue Mar 25 19:38:36 GMT 2008


Le mardi 25 mars 2008, Maksim Orlovich a écrit :
> > at least that specific testcase seem to work fine for me? (I.e. the text
> > goes
> > green when focused - though admittedly this is not very visible because
> > my french spellchecker almost instantly turns everything back to red :)
>
> Here, and from our IRC conversation, for Slava, it seems like the text
> color is simply messed up when the focus enters the textarea. In the
> following (which should hopefully work in .fr, too :-) ):
> <style type="text/css">
>     textarea {
> 	color: green;
>     }
>
>     textarea:focus {
> 	border: 3px solid red;
>     }
> </style>
>
>
> <textarea>
> Parachute
> </textarea>
>
> <textarea>
> Parachute
> </textarea>
>
> The colors are green initially, and become black permanently after one
> clicks in an area. The border changes just fine, however. Could be
> spell-checking acting up, but can't be sure.

mmh, OK. It works as expected for me in trunk, but I have spell-checking 
disabled in my 4.0 builds - only have it enabled in 3.5 branch.
So yes, it definetly looks spell-checker related.

>
> > But I'm not sure I remember where the change in style is really handled
> > on focus out. I think it's probably  when the new DOM focus node is set
> > (DocumentImpl::setFocusNode) that the style gets recalculated (and thus
> > RenderWidget::setStyle is called).. but I'm not sure where the widget's
> > node
> > is marked as changed in this process *shrug*
>
> NodeBaseImpl::setFocus

yes indeed! :)

Germain




More information about the kfm-devel mailing list