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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLTextFormControlElement.cpp

Issue 2341053002: Mark the createVisiblePosition overloads as deprecated (Closed)
Patch Set: minor revision Created 4 years, 3 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 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 VisiblePosition HTMLTextFormControlElement::visiblePositionForIndex(int index) c onst 393 VisiblePosition HTMLTextFormControlElement::visiblePositionForIndex(int index) c onst
394 { 394 {
395 if (index <= 0) 395 if (index <= 0)
396 return VisiblePosition::firstPositionInNode(innerEditorElement()); 396 return VisiblePosition::firstPositionInNode(innerEditorElement());
397 Position start, end; 397 Position start, end;
398 bool selected = Range::selectNodeContents(innerEditorElement(), start, end); 398 bool selected = Range::selectNodeContents(innerEditorElement(), start, end);
399 if (!selected) 399 if (!selected)
400 return VisiblePosition(); 400 return VisiblePosition();
401 CharacterIterator it(start, end); 401 CharacterIterator it(start, end);
402 it.advance(index - 1); 402 it.advance(index - 1);
403 return createVisiblePosition(it.endPosition(), TextAffinity::Upstream); 403 return createVisiblePositionDeprecated(it.endPosition(), TextAffinity::Upstr eam);
404 } 404 }
405 405
406 int HTMLTextFormControlElement::indexForVisiblePosition(const VisiblePosition& p os) const 406 int HTMLTextFormControlElement::indexForVisiblePosition(const VisiblePosition& p os) const
407 { 407 {
408 Position indexPosition = pos.deepEquivalent().parentAnchoredEquivalent(); 408 Position indexPosition = pos.deepEquivalent().parentAnchoredEquivalent();
409 if (enclosingTextFormControl(indexPosition) != this) 409 if (enclosingTextFormControl(indexPosition) != this)
410 return 0; 410 return 0;
411 DCHECK(indexPosition.document()); 411 DCHECK(indexPosition.document());
412 Range* range = Range::create(*indexPosition.document()); 412 Range* range = Range::create(*indexPosition.document());
413 range->setStart(innerEditorElement(), 0, ASSERT_NO_EXCEPTION); 413 range->setStart(innerEditorElement(), 0, ASSERT_NO_EXCEPTION);
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1024 } 1024 }
1025 1025
1026 void HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(const Ele ment& source) 1026 void HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(const Ele ment& source)
1027 { 1027 {
1028 const HTMLTextFormControlElement& sourceElement = static_cast<const HTMLText FormControlElement&>(source); 1028 const HTMLTextFormControlElement& sourceElement = static_cast<const HTMLText FormControlElement&>(source);
1029 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit; 1029 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit;
1030 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source); 1030 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source);
1031 } 1031 }
1032 1032
1033 } // namespace blink 1033 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698