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.
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 2361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2372 if (next && containsIncludingShadowDOM(next)) { | 2372 if (next && containsIncludingShadowDOM(next)) { |
2373 next->focus(FocusParams(SelectionBehaviorOnFocus::Reset, WebFocusTyp
eForward, nullptr)); | 2373 next->focus(FocusParams(SelectionBehaviorOnFocus::Reset, WebFocusTyp
eForward, nullptr)); |
2374 return; | 2374 return; |
2375 } | 2375 } |
2376 } | 2376 } |
2377 | 2377 |
2378 RefPtrWillBeRawPtr<Node> protect(this); | 2378 RefPtrWillBeRawPtr<Node> protect(this); |
2379 if (!document().page()->focusController().setFocusedElement(this, document()
.frame(), params)) | 2379 if (!document().page()->focusController().setFocusedElement(this, document()
.frame(), params)) |
2380 return; | 2380 return; |
2381 | 2381 |
2382 // Setting the focused node above might have invalidated the layout due to s
cripts. | 2382 if (document().focusedElement() == this && UserGestureIndicator::processedUs
erGestureSinceLoad()) { |
2383 document().updateLayoutIgnorePendingStylesheets(); | |
2384 if (!isFocusable()) | |
2385 return; | |
2386 | |
2387 cancelFocusAppearanceUpdate(); | |
2388 updateFocusAppearance(params.selectionBehavior); | |
2389 | |
2390 if (UserGestureIndicator::processedUserGestureSinceLoad()) { | |
2391 // Bring up the keyboard in the context of anything triggered by a user | 2383 // Bring up the keyboard in the context of anything triggered by a user |
2392 // gesture. Since tracking that across arbitrary boundaries (eg. | 2384 // gesture. Since tracking that across arbitrary boundaries (eg. |
2393 // animations) is difficult, for now we match IE's heuristic and bring | 2385 // animations) is difficult, for now we match IE's heuristic and bring |
2394 // up the keyboard if there's been any gesture since load. | 2386 // up the keyboard if there's been any gesture since load. |
2395 document().page()->chromeClient().showImeIfNeeded(); | 2387 document().page()->chromeClient().showImeIfNeeded(); |
2396 } | 2388 } |
2397 } | 2389 } |
2398 | 2390 |
2399 void Element::updateFocusAppearance(SelectionBehaviorOnFocus) | 2391 void Element::updateFocusAppearance(SelectionBehaviorOnFocus selectionBehavior) |
2400 { | 2392 { |
| 2393 if (selectionBehavior == SelectionBehaviorOnFocus::None) |
| 2394 return; |
2401 if (isRootEditableElement()) { | 2395 if (isRootEditableElement()) { |
2402 // Taking the ownership since setSelection() may release the last refere
nce to |frame|. | 2396 // Taking the ownership since setSelection() may release the last refere
nce to |frame|. |
2403 RefPtrWillBeRawPtr<LocalFrame> frame(document().frame()); | 2397 RefPtrWillBeRawPtr<LocalFrame> frame(document().frame()); |
2404 if (!frame) | 2398 if (!frame) |
2405 return; | 2399 return; |
2406 | 2400 |
2407 // When focusing an editable element in an iframe, don't reset the selec
tion if it already contains a selection. | 2401 // When focusing an editable element in an iframe, don't reset the selec
tion if it already contains a selection. |
2408 if (this == frame->selection().rootEditableElement()) | 2402 if (this == frame->selection().rootEditableElement()) |
2409 return; | 2403 return; |
2410 | 2404 |
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3573 { | 3567 { |
3574 #if ENABLE(OILPAN) | 3568 #if ENABLE(OILPAN) |
3575 if (hasRareData()) | 3569 if (hasRareData()) |
3576 visitor->trace(elementRareData()); | 3570 visitor->trace(elementRareData()); |
3577 visitor->trace(m_elementData); | 3571 visitor->trace(m_elementData); |
3578 #endif | 3572 #endif |
3579 ContainerNode::trace(visitor); | 3573 ContainerNode::trace(visitor); |
3580 } | 3574 } |
3581 | 3575 |
3582 } // namespace blink | 3576 } // namespace blink |
OLD | NEW |