Summary: | Handle focus event in shadow content. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Hayato Ito <hayato> | ||||||
Component: | DOM | Assignee: | Dimitri Glazkov (Google) <dglazkov> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | dglazkov, dominicc, hayato, webkit.review.bot | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 59805, 61409 | ||||||||
Attachments: |
|
Description
Hayato Ito
2011-05-24 22:59:19 PDT
Created attachment 96506 [details]
WIP: Needs tests and loving.
Created attachment 104166 [details]
patch
Hi Dimitri, I've updated a patch, which is based on your patch, fixing some minor issues and adding a LayoutTest. Could you review that? Comment on attachment 104166 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=104166&action=review > Source/WebCore/dom/Event.cpp:343 > +PassRefPtr<FocusEventDispatchMediator> FocusEventDispatchMediator::create(PassRefPtr<Node> oldFocusedNode) > +{ > + return adoptRef(new FocusEventDispatchMediator(oldFocusedNode)); > +} > + > +FocusEventDispatchMediator::FocusEventDispatchMediator(PassRefPtr<Node> oldFocusedNode) > + : EventDispatchMediator(Event::create(eventNames().focusEvent, false, false)) > + , m_oldFocusedNode(oldFocusedNode) > +{ > +} > + > +bool FocusEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const > +{ > + dispatcher->adjustRelatedTarget(event(), m_oldFocusedNode); > + return EventDispatchMediator::dispatchEvent(dispatcher); > +} > + > +PassRefPtr<BlurEventDispatchMediator> BlurEventDispatchMediator::create(PassRefPtr<Node> newFocusedNode) > +{ > + return adoptRef(new BlurEventDispatchMediator(newFocusedNode)); > +} > + > +BlurEventDispatchMediator::BlurEventDispatchMediator(PassRefPtr<Node> newFocusedNode) > + : EventDispatchMediator(Event::create(eventNames().blurEvent, false, false)) > + , m_newFocusedNode(newFocusedNode) > +{ > +} > + > +bool BlurEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const > +{ > + dispatcher->adjustRelatedTarget(event(), m_newFocusedNode); > + return EventDispatchMediator::dispatchEvent(dispatcher); > +} These should be in UIEvent, right? > Source/WebCore/page/FocusController.cpp:80 > + document->focusedNode()->dispatchBlurEvent(0); Ah. This is a nice improvement over my old patch! :) Comment on attachment 104166 [details] patch Thank you for the review. View in context: https://bugs.webkit.org/attachment.cgi?id=104166&action=review >> Source/WebCore/dom/Event.cpp:343 >> +} > > These should be in UIEvent, right? Focus/Blur events are not UIEvent in definition according to http://www.w3.org/TR/DOM-Level-2-Events/events.html. Hence, I'd like to avoid putting these in UIEvent.{h,cpp}, even though they look very 'similar' to FocusIn/FocusOut events. I am landing this patch as is. But it's uncomfortable for me to leave these Focus/BlurEventDispatchMediator in Event.h. So I'll extract EventDispatchMediator and Focus/BlueEventDispatchMediator to another files, named EventDispatchMediator.{h, cpp} in another patch. Comment on attachment 104166 [details] patch Clearing flags on attachment: 104166 Committed r93276: <http://trac.webkit.org/changeset/93276> All reviewed patches have been landed. Closing bug. |