Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2374183004: Make non-null VisibleSelections creatable only by createVisibleSelection[Deprecated] (Closed)
Patch Set: Fix mac compile error Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after
2471 if (isRootEditableElement(*this)) { 2471 if (isRootEditableElement(*this)) {
2472 LocalFrame* frame = document().frame(); 2472 LocalFrame* frame = document().frame();
2473 if (!frame) 2473 if (!frame)
2474 return; 2474 return;
2475 2475
2476 // When focusing an editable element in an iframe, don't reset the selec tion if it already contains a selection. 2476 // When focusing an editable element in an iframe, don't reset the selec tion if it already contains a selection.
2477 if (this == frame->selection().rootEditableElement()) 2477 if (this == frame->selection().rootEditableElement())
2478 return; 2478 return;
2479 2479
2480 // FIXME: We should restore the previous selection if there is one. 2480 // FIXME: We should restore the previous selection if there is one.
2481 VisibleSelection newSelection = VisibleSelection(firstPositionInOrBefore Node(this), TextAffinity::Downstream); 2481 VisibleSelection newSelection = createVisibleSelectionDeprecated(firstPo sitionInOrBeforeNode(this), TextAffinity::Downstream);
2482 // Passing DoNotSetFocus as this function is called after FocusControlle r::setFocusedElement() 2482 // Passing DoNotSetFocus as this function is called after FocusControlle r::setFocusedElement()
2483 // and we don't want to change the focus to a new Element. 2483 // and we don't want to change the focus to a new Element.
2484 frame->selection().setSelection(newSelection, FrameSelection::CloseTypi ng | FrameSelection::ClearTypingStyle | FrameSelection::DoNotSetFocus); 2484 frame->selection().setSelection(newSelection, FrameSelection::CloseTypi ng | FrameSelection::ClearTypingStyle | FrameSelection::DoNotSetFocus);
2485 2485
2486 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesh eets 2486 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesh eets
2487 // needs to be audited. See http://crbug.com/590369 for more details. 2487 // needs to be audited. See http://crbug.com/590369 for more details.
2488 document().updateStyleAndLayoutIgnorePendingStylesheets(); 2488 document().updateStyleAndLayoutIgnorePendingStylesheets();
2489 2489
2490 frame->selection().revealSelection(); 2490 frame->selection().revealSelection();
2491 } else if (layoutObject() && !layoutObject()->isLayoutPart()) { 2491 } else if (layoutObject() && !layoutObject()->isLayoutPart()) {
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
3829 3829
3830 DEFINE_TRACE_WRAPPERS(Element) 3830 DEFINE_TRACE_WRAPPERS(Element)
3831 { 3831 {
3832 if (hasRareData()) { 3832 if (hasRareData()) {
3833 visitor->traceWrappers(elementRareData()); 3833 visitor->traceWrappers(elementRareData());
3834 } 3834 }
3835 ContainerNode::traceWrappers(visitor); 3835 ContainerNode::traceWrappers(visitor);
3836 } 3836 }
3837 3837
3838 } // namespace blink 3838 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698