| 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 2311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2322 // Taking the ownership since setSelection() may release the last refere
nce to |frame|. | 2322 // Taking the ownership since setSelection() may release the last refere
nce to |frame|. |
| 2323 RefPtrWillBeRawPtr<LocalFrame> frame(document().frame()); | 2323 RefPtrWillBeRawPtr<LocalFrame> frame(document().frame()); |
| 2324 if (!frame) | 2324 if (!frame) |
| 2325 return; | 2325 return; |
| 2326 | 2326 |
| 2327 // When focusing an editable element in an iframe, don't reset the selec
tion if it already contains a selection. | 2327 // When focusing an editable element in an iframe, don't reset the selec
tion if it already contains a selection. |
| 2328 if (this == frame->selection().rootEditableElement()) | 2328 if (this == frame->selection().rootEditableElement()) |
| 2329 return; | 2329 return; |
| 2330 | 2330 |
| 2331 // FIXME: We should restore the previous selection if there is one. | 2331 // FIXME: We should restore the previous selection if there is one. |
| 2332 VisibleSelection newSelection = VisibleSelection(firstPositionInOrBefore
Node(this), DOWNSTREAM); | 2332 VisibleSelection newSelection = VisibleSelection(firstPositionInOrBefore
Node(this), TextAffinity::Downstream); |
| 2333 // Passing DoNotSetFocus as this function is called after FocusControlle
r::setFocusedElement() | 2333 // Passing DoNotSetFocus as this function is called after FocusControlle
r::setFocusedElement() |
| 2334 // and we don't want to change the focus to a new Element. | 2334 // and we don't want to change the focus to a new Element. |
| 2335 frame->selection().setSelection(newSelection, FrameSelection::CloseTypi
ng | FrameSelection::ClearTypingStyle | FrameSelection::DoNotSetFocus); | 2335 frame->selection().setSelection(newSelection, FrameSelection::CloseTypi
ng | FrameSelection::ClearTypingStyle | FrameSelection::DoNotSetFocus); |
| 2336 frame->selection().revealSelection(); | 2336 frame->selection().revealSelection(); |
| 2337 } else if (layoutObject() && !layoutObject()->isLayoutPart()) { | 2337 } else if (layoutObject() && !layoutObject()->isLayoutPart()) { |
| 2338 layoutObject()->scrollRectToVisible(boundingBox()); | 2338 layoutObject()->scrollRectToVisible(boundingBox()); |
| 2339 } | 2339 } |
| 2340 } | 2340 } |
| 2341 | 2341 |
| 2342 void Element::blur() | 2342 void Element::blur() |
| (...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3498 { | 3498 { |
| 3499 #if ENABLE(OILPAN) | 3499 #if ENABLE(OILPAN) |
| 3500 if (hasRareData()) | 3500 if (hasRareData()) |
| 3501 visitor->trace(elementRareData()); | 3501 visitor->trace(elementRareData()); |
| 3502 visitor->trace(m_elementData); | 3502 visitor->trace(m_elementData); |
| 3503 #endif | 3503 #endif |
| 3504 ContainerNode::trace(visitor); | 3504 ContainerNode::trace(visitor); |
| 3505 } | 3505 } |
| 3506 | 3506 |
| 3507 } // namespace blink | 3507 } // namespace blink |
| OLD | NEW |