[Webkit-unassigned] [Bug 81102] blur() on shadow host should work when a shadow host contains a focused element in its shadow DOM subtrees.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 20 19:05:11 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=81102





--- Comment #37 from Hajime Morrita <morrita at google.com>  2012-03-20 19:05:11 PST ---
(In reply to comment #36)
> (In reply to comment #35)
> > (From update of attachment 132566 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=132566&action=review
> > 
> > >>> Source/WebCore/dom/TreeScope.cpp:172
> > >>> +        return this == document ? document->body() : 0;
> > >> 
> > >> Why do we have this check even after introducing the virtual method?
> > >> Is it for eliminating this, right?
> > > 
> > > Yes, both ShadowRoot & HTMLDocument shares the same code in TreeScope::activeElement().
> > 
> > Then the document specific behavior should be in Document::activeElement(), not TreeScope::activeElement().
> 

> The reason I have this code in TreeScope is, activeElement property is for HTMLDocument class and not Document class. And ShadowRoot is derived from TreeScope. So the common base class is TreeScope.
It's fine to have activeElement in Document. HTMLDocument.
Then you can override it in HTMLDocument. Superclass shouldn't know about its subclass if possible.
That's what runtime polymorphism (virtual) is designed for.

-- 
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