blur() on shadow host should work when a shadow host contains a focused element in...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2012 12:38:45 +0000 (12:38 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2012 12:38:45 +0000 (12:38 +0000)
commit59c09525df6c0dcbdfc6b14cc22e7a6aed9bd0d0
tree1672d939843479dcd985fbbc76c732e209272002
parentabddbf8e47d8c499a74a5139625ed42b09f967bc
blur() on shadow host should work when a shadow host contains a focused element in its shadow DOM subtrees
https://bugs.webkit.org/show_bug.cgi?id=81102

Patch by Kaustubh Atrawalkar <kaustubh@motorola.com> on 2012-03-22
Reviewed by Hajime Morita.

Source/WebCore:

This implementation will support blur for a focused element when its shadowHost's blur() is called.
To achieve this Element::blur() function is modified to blur the focused node in it's treeScope.

Test: fast/dom/shadow/shadow-root-blur.html

* dom/Element.cpp:
(WebCore::Element::blur): Modified to blur current treeScope's focused node.
* dom/ShadowRoot.h:
(WebCore::ShadowRoot::activeElement): Rework for code sharing.
* dom/TreeScope.cpp:
(WebCore::TreeScope::focusedNode): Added new function to share code for getting focused node.
* dom/TreeScope.h:
(TreeScope): New function declartion.
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::activeElement): Rework for code sharing.

LayoutTests:

* fast/dom/shadow/shadow-root-blur-expected.txt: Added.
* fast/dom/shadow/shadow-root-blur.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/shadow/shadow-root-blur-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/shadow/shadow-root-blur.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/ShadowRoot.h
Source/WebCore/dom/TreeScope.cpp
Source/WebCore/dom/TreeScope.h
Source/WebCore/html/HTMLDocument.cpp