| 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 2615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2626 if (isRootEditableElement(*this)) { | 2626 if (isRootEditableElement(*this)) { |
| 2627 LocalFrame* frame = document().frame(); | 2627 LocalFrame* frame = document().frame(); |
| 2628 if (!frame) | 2628 if (!frame) |
| 2629 return; | 2629 return; |
| 2630 | 2630 |
| 2631 // When focusing an editable element in an iframe, don't reset the selection | 2631 // When focusing an editable element in an iframe, don't reset the selection |
| 2632 // if it already contains a selection. | 2632 // if it already contains a selection. |
| 2633 if (this == frame->selection().rootEditableElement()) | 2633 if (this == frame->selection().rootEditableElement()) |
| 2634 return; | 2634 return; |
| 2635 | 2635 |
| 2636 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| 2637 // needs to be audited. See http://crbug.com/590369 for more details. |
| 2638 document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 2639 |
| 2636 // FIXME: We should restore the previous selection if there is one. | 2640 // FIXME: We should restore the previous selection if there is one. |
| 2637 VisibleSelection newSelection = createVisibleSelectionDeprecated( | 2641 VisibleSelection newSelection = createVisibleSelection( |
| 2638 firstPositionInOrBeforeNode(this), TextAffinity::Downstream); | 2642 firstPositionInOrBeforeNode(this), TextAffinity::Downstream); |
| 2639 // Passing DoNotSetFocus as this function is called after | 2643 // Passing DoNotSetFocus as this function is called after |
| 2640 // FocusController::setFocusedElement() and we don't want to change the | 2644 // FocusController::setFocusedElement() and we don't want to change the |
| 2641 // focus to a new Element. | 2645 // focus to a new Element. |
| 2642 frame->selection().setSelection(newSelection, | 2646 frame->selection().setSelection(newSelection, |
| 2643 FrameSelection::CloseTyping | | 2647 FrameSelection::CloseTyping | |
| 2644 FrameSelection::ClearTypingStyle | | 2648 FrameSelection::ClearTypingStyle | |
| 2645 FrameSelection::DoNotSetFocus); | 2649 FrameSelection::DoNotSetFocus); |
| 2646 | 2650 |
| 2647 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets | 2651 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| (...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4079 } | 4083 } |
| 4080 | 4084 |
| 4081 DEFINE_TRACE_WRAPPERS(Element) { | 4085 DEFINE_TRACE_WRAPPERS(Element) { |
| 4082 if (hasRareData()) { | 4086 if (hasRareData()) { |
| 4083 visitor->traceWrappers(elementRareData()); | 4087 visitor->traceWrappers(elementRareData()); |
| 4084 } | 4088 } |
| 4085 ContainerNode::traceWrappers(visitor); | 4089 ContainerNode::traceWrappers(visitor); |
| 4086 } | 4090 } |
| 4087 | 4091 |
| 4088 } // namespace blink | 4092 } // namespace blink |
| OLD | NEW |