| 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 2459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2470 | 2470 |
| 2471 // When focusing an editable element in an iframe, don't reset the selec
tion if it already contains a selection. | 2471 // When focusing an editable element in an iframe, don't reset the selec
tion if it already contains a selection. |
| 2472 if (this == frame->selection().rootEditableElement()) | 2472 if (this == frame->selection().rootEditableElement()) |
| 2473 return; | 2473 return; |
| 2474 | 2474 |
| 2475 // FIXME: We should restore the previous selection if there is one. | 2475 // FIXME: We should restore the previous selection if there is one. |
| 2476 VisibleSelection newSelection = VisibleSelection(firstPositionInOrBefore
Node(this), TextAffinity::Downstream); | 2476 VisibleSelection newSelection = VisibleSelection(firstPositionInOrBefore
Node(this), TextAffinity::Downstream); |
| 2477 // Passing DoNotSetFocus as this function is called after FocusControlle
r::setFocusedElement() | 2477 // Passing DoNotSetFocus as this function is called after FocusControlle
r::setFocusedElement() |
| 2478 // and we don't want to change the focus to a new Element. | 2478 // and we don't want to change the focus to a new Element. |
| 2479 frame->selection().setSelection(newSelection, FrameSelection::CloseTypi
ng | FrameSelection::ClearTypingStyle | FrameSelection::DoNotSetFocus); | 2479 frame->selection().setSelection(newSelection, FrameSelection::CloseTypi
ng | FrameSelection::ClearTypingStyle | FrameSelection::DoNotSetFocus); |
| 2480 |
| 2481 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesh
eets |
| 2482 // needs to be audited. See http://crbug.com/590369 for more details. |
| 2483 document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 2484 |
| 2480 frame->selection().revealSelection(); | 2485 frame->selection().revealSelection(); |
| 2481 } else if (layoutObject() && !layoutObject()->isLayoutPart()) { | 2486 } else if (layoutObject() && !layoutObject()->isLayoutPart()) { |
| 2482 layoutObject()->scrollRectToVisible(boundingBox()); | 2487 layoutObject()->scrollRectToVisible(boundingBox()); |
| 2483 } | 2488 } |
| 2484 } | 2489 } |
| 2485 | 2490 |
| 2486 void Element::blur() | 2491 void Element::blur() |
| 2487 { | 2492 { |
| 2488 cancelFocusAppearanceUpdate(); | 2493 cancelFocusAppearanceUpdate(); |
| 2489 if (adjustedFocusedElementInTreeScope() == this) { | 2494 if (adjustedFocusedElementInTreeScope() == this) { |
| (...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3818 | 3823 |
| 3819 DEFINE_TRACE_WRAPPERS(Element) | 3824 DEFINE_TRACE_WRAPPERS(Element) |
| 3820 { | 3825 { |
| 3821 if (hasRareData()) { | 3826 if (hasRareData()) { |
| 3822 visitor->traceWrappers(elementRareData()); | 3827 visitor->traceWrappers(elementRareData()); |
| 3823 } | 3828 } |
| 3824 ContainerNode::traceWrappers(visitor); | 3829 ContainerNode::traceWrappers(visitor); |
| 3825 } | 3830 } |
| 3826 | 3831 |
| 3827 } // namespace blink | 3832 } // namespace blink |
| OLD | NEW |