Chromium Code Reviews| OLD | NEW |
|---|---|
| 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. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. |
| 8 * All rights reserved. | 8 * All rights reserved. |
| 9 * (C) 2007 Eric Seidel (eric@webkit.org) | 9 * (C) 2007 Eric Seidel (eric@webkit.org) |
| 10 * | 10 * |
| (...skipping 2626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2637 void Element::focus(const FocusParams& params) { | 2637 void Element::focus(const FocusParams& params) { |
| 2638 if (!isConnected()) | 2638 if (!isConnected()) |
| 2639 return; | 2639 return; |
| 2640 | 2640 |
| 2641 if (document().focusedElement() == this) | 2641 if (document().focusedElement() == this) |
| 2642 return; | 2642 return; |
| 2643 | 2643 |
| 2644 if (!document().isActive()) | 2644 if (!document().isActive()) |
| 2645 return; | 2645 return; |
| 2646 | 2646 |
| 2647 if (isFrameOwnerElement() && | |
| 2648 toHTMLFrameOwnerElement(this)->contentDocument()->unloadStarted()) | |
|
tkent
2017/02/17 07:34:00
contnetDocument() might return nullptr.
| |
| 2649 return; | |
| 2650 | |
| 2647 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 2651 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
| 2648 if (!isFocusable()) | 2652 if (!isFocusable()) |
| 2649 return; | 2653 return; |
| 2650 | 2654 |
| 2651 if (authorShadowRoot() && authorShadowRoot()->delegatesFocus()) { | 2655 if (authorShadowRoot() && authorShadowRoot()->delegatesFocus()) { |
| 2652 if (isShadowIncludingInclusiveAncestorOf(document().focusedElement())) | 2656 if (isShadowIncludingInclusiveAncestorOf(document().focusedElement())) |
| 2653 return; | 2657 return; |
| 2654 | 2658 |
| 2655 // Slide the focus to its inner node. | 2659 // Slide the focus to its inner node. |
| 2656 Element* found = | 2660 Element* found = |
| (...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4134 } | 4138 } |
| 4135 | 4139 |
| 4136 DEFINE_TRACE_WRAPPERS(Element) { | 4140 DEFINE_TRACE_WRAPPERS(Element) { |
| 4137 if (hasRareData()) { | 4141 if (hasRareData()) { |
| 4138 visitor->traceWrappers(elementRareData()); | 4142 visitor->traceWrappers(elementRareData()); |
| 4139 } | 4143 } |
| 4140 ContainerNode::traceWrappers(visitor); | 4144 ContainerNode::traceWrappers(visitor); |
| 4141 } | 4145 } |
| 4142 | 4146 |
| 4143 } // namespace blink | 4147 } // namespace blink |
| OLD | NEW |