Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: Source/core/dom/Element.cpp

Issue 1177673004: Implement ShadowRoot.delegatesFocus 3/4 (Slide focus on focus() method) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/dom/shadow/focus-method-with-delegatesFocus-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2175 matching lines...) Expand 10 before | Expand all | Expand 10 after
2186 if (document().focusedElement() == this) 2186 if (document().focusedElement() == this)
2187 return; 2187 return;
2188 2188
2189 if (!document().isActive()) 2189 if (!document().isActive())
2190 return; 2190 return;
2191 2191
2192 document().updateLayoutIgnorePendingStylesheets(); 2192 document().updateLayoutIgnorePendingStylesheets();
2193 if (!isFocusable()) 2193 if (!isFocusable())
2194 return; 2194 return;
2195 2195
2196 if (shadowRoot() && shadowRoot()->delegatesFocus()) {
2197 if (containsIncludingShadowDOM(document().focusedElement()))
2198 return;
2199
2200 // Slide the focus to its inner node.
2201 Node* next = document().page()->focusController().findFocusableNode(WebF ocusTypeForward, *this);
2202 if (next && next->isElementNode() && containsIncludingShadowDOM(next)) {
2203 toElement(next)->focus(false, WebFocusTypeForward);
2204 return;
2205 }
2206 }
2207
2196 RefPtrWillBeRawPtr<Node> protect(this); 2208 RefPtrWillBeRawPtr<Node> protect(this);
2197 if (!document().page()->focusController().setFocusedElement(this, document() .frame(), type)) 2209 if (!document().page()->focusController().setFocusedElement(this, document() .frame(), type))
2198 return; 2210 return;
2199 2211
2200 // Setting the focused node above might have invalidated the layout due to s cripts. 2212 // Setting the focused node above might have invalidated the layout due to s cripts.
2201 document().updateLayoutIgnorePendingStylesheets(); 2213 document().updateLayoutIgnorePendingStylesheets();
2202 if (!isFocusable()) 2214 if (!isFocusable())
2203 return; 2215 return;
2204 2216
2205 cancelFocusAppearanceUpdate(); 2217 cancelFocusAppearanceUpdate();
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after
3394 { 3406 {
3395 #if ENABLE(OILPAN) 3407 #if ENABLE(OILPAN)
3396 if (hasRareData()) 3408 if (hasRareData())
3397 visitor->trace(elementRareData()); 3409 visitor->trace(elementRareData());
3398 visitor->trace(m_elementData); 3410 visitor->trace(m_elementData);
3399 #endif 3411 #endif
3400 ContainerNode::trace(visitor); 3412 ContainerNode::trace(visitor);
3401 } 3413 }
3402 3414
3403 } // namespace blink 3415 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/shadow/focus-method-with-delegatesFocus-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698