[Webkit-unassigned] [Bug 120273] Making a focused element invisible should make it blur
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Aug 26 10:37:04 PDT 2013
https://bugs.webkit.org/show_bug.cgi?id=120273
--- Comment #7 from Arunprasad Rajkumar <arurajku at cisco.com> 2013-08-26 10:36:28 PST ---
(In reply to comment #6)
> (From update of attachment 209593 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=209593&action=review
>
> > Source/WebCore/dom/Document.cpp:381
> > +// This class should be passed only to Document::postTask.
>
> I don't understand the value of this comment. What other bad thing could someone do with this class. Next time just leave this out. I suspect this entire class will go away, but we if keep it I have a few comments.
>
> > Source/WebCore/dom/Document.cpp:386
> > + return adoptPtr(new CheckFocusedNodeTask());
>
> I suggest omitting the "()" here.
>
> > Source/WebCore/dom/Document.cpp:388
> > + virtual ~CheckFocusedNodeTask() { }
>
> I suggest omitting this entirely. It should be generated.
>
> > Source/WebCore/dom/Document.cpp:391
> > + CheckFocusedNodeTask() { }
>
> Doesn't seem to be valuable to make this private. There would be no harm if someone constructed one of these without using the create function. I suggest just omitting this and letting it be generated.
>
> > Source/WebCore/dom/Document.cpp:395
> > + Document* document = toDocument(context);
>
> I suggest using Document& here instead of Document* since it can’t be null. In newer code in general we are trying to use references for such things.
>
> > Source/WebCore/dom/Document.cpp:401
> > + if (focusedElement->renderer() && focusedElement->renderer()->needsLayout())
> > + return;
>
> This needsLayout check does not make sense. It's not helpful to check if the single renderer has the needs-layout bit set on it. What bug did it fix to check this?
>
> > Source/WebCore/dom/Document.cpp:1885
> > + // FIXME: Using a Task doesn't look a good idea.
>
> Yes, a Task is not a good fix for this. I suggest sharing the updateFocusAppearance timer.
>
> > Source/WebCore/dom/Document.cpp:1889
> > + if (m_focusedElement && !m_didPostCheckFocusedNodeTask) {
> > + postTask(CheckFocusedNodeTask::create());
> > + m_didPostCheckFocusedNodeTask = true;
> > + }
>
> Here’s what I think this code should say:
>
> if (!m_focusedElement->isFocusable())
> updateFocusAppearanceSoon(false);
>
> Then, inside the updateFocusAppearanceTimerFired function:
>
> if (element->isFocusable())
> element->updateFocusAppearance(m_updateFocusAppearanceRestoresSelection);
> else
> document->setFocusedElement(0);
>
> Please give that a try and see if there are any problems caused by that approach.
Darin, Thanks for your comments :) Sure, I will try with m_updateFocusAppearanceTimer and let u know the result.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list