Changeset 123407 in webkit
- Timestamp:
- Jul 23, 2012 5:12:13 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r123406 r123407 1 2012-07-23 Hayato Ito <hayato@chromium.org> 2 3 A FocusScope for a distributed node should not be its TreeScope. 4 https://bugs.webkit.org/show_bug.cgi?id=91829 5 6 Reviewed by Dimitri Glazkov. 7 8 * fast/dom/shadow/focus-navigation-with-distributed-nodes-expected.txt: Added. 9 * fast/dom/shadow/focus-navigation-with-distributed-nodes.html: Added. 10 * fast/dom/shadow/resources/shadow-dom.js: 11 (shouldNavigateFocus): 12 1 13 2012-07-23 Douglas Stockwell <dstockwell@google.com> 2 14 -
trunk/LayoutTests/fast/dom/shadow/resources/shadow-dom.js
r120797 r123407 125 125 } 126 126 fromElement.focus(); 127 if (!isInnermostActiveElement(from)) { 128 debug('FAIL: Can not be focused: '+ from); 129 return; 130 } 127 131 if (direction == 'forward') 128 132 navigateFocusForward(); -
trunk/Source/WebCore/ChangeLog
r123406 r123407 1 2012-07-23 Hayato Ito <hayato@chromium.org> 2 3 A FocusScope for a distributed node should not be its TreeScope. 4 https://bugs.webkit.org/show_bug.cgi?id=91829 5 6 Reviewed by Dimitri Glazkov. 7 8 Current implementation of FocusScope::focusScopeOf(Node*) returns 9 the given node's treeScope(). That does not apply if the node is 10 a distributed node. We should calculate a FocusScope for a 11 distributed node by traversing ancestor nodes in Composed Shadow 12 Tree. 13 14 Test: fast/dom/shadow/focus-navigation-with-distributed-nodes.html 15 16 * page/FocusController.cpp: 17 (WebCore::FocusScope::focusScopeOf): 18 1 19 2012-07-23 Douglas Stockwell <dstockwell@google.com> 2 20 -
trunk/Source/WebCore/page/FocusController.cpp
r117723 r123407 120 120 { 121 121 ASSERT(node); 122 TreeScope* scope = node->treeScope(); 123 if (scope->rootNode()->isShadowRoot()) 124 return FocusScope(toShadowRoot(scope->rootNode())->owner()->youngestShadowRoot()); 125 return FocusScope(scope); 122 ComposedShadowTreeWalker walker(node, ComposedShadowTreeWalker::DoNotCrossUpperBoundary); 123 Node* root = node; 124 while (walker.get()) { 125 root = walker.get(); 126 walker.parent(); 127 } 128 // The result is not always a ShadowRoot nor a DocumentNode since 129 // a starting node is in an orphaned tree in composed shadow tree. 130 return FocusScope(root->treeScope()); 126 131 } 127 132
Note: See TracChangeset
for help on using the changeset viewer.