| 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 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 VisiblePosition HTMLTextFormControlElement::visiblePositionForIndex(int index) c
onst | 395 VisiblePosition HTMLTextFormControlElement::visiblePositionForIndex(int index) c
onst |
| 396 { | 396 { |
| 397 if (index <= 0) | 397 if (index <= 0) |
| 398 return VisiblePosition(firstPositionInNode(innerEditorElement())); | 398 return VisiblePosition(firstPositionInNode(innerEditorElement())); |
| 399 Position start, end; | 399 Position start, end; |
| 400 bool selected = Range::selectNodeContents(innerEditorElement(), start, end); | 400 bool selected = Range::selectNodeContents(innerEditorElement(), start, end); |
| 401 if (!selected) | 401 if (!selected) |
| 402 return VisiblePosition(); | 402 return VisiblePosition(); |
| 403 CharacterIterator it(start, end); | 403 CharacterIterator it(start, end); |
| 404 it.advance(index - 1); | 404 it.advance(index - 1); |
| 405 return VisiblePosition(it.endPosition(), UPSTREAM); | 405 return VisiblePosition(it.endPosition(), TextAffinity::Upstream); |
| 406 } | 406 } |
| 407 | 407 |
| 408 int HTMLTextFormControlElement::indexForVisiblePosition(const VisiblePosition& p
os) const | 408 int HTMLTextFormControlElement::indexForVisiblePosition(const VisiblePosition& p
os) const |
| 409 { | 409 { |
| 410 Position indexPosition = pos.deepEquivalent().parentAnchoredEquivalent(); | 410 Position indexPosition = pos.deepEquivalent().parentAnchoredEquivalent(); |
| 411 if (enclosingTextFormControl(indexPosition) != this) | 411 if (enclosingTextFormControl(indexPosition) != this) |
| 412 return 0; | 412 return 0; |
| 413 ASSERT(indexPosition.document()); | 413 ASSERT(indexPosition.document()); |
| 414 RefPtrWillBeRawPtr<Range> range = Range::create(*indexPosition.document()); | 414 RefPtrWillBeRawPtr<Range> range = Range::create(*indexPosition.document()); |
| 415 range->setStart(innerEditorElement(), 0, ASSERT_NO_EXCEPTION); | 415 range->setStart(innerEditorElement(), 0, ASSERT_NO_EXCEPTION); |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 } | 1003 } |
| 1004 | 1004 |
| 1005 void HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(const Ele
ment& source) | 1005 void HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(const Ele
ment& source) |
| 1006 { | 1006 { |
| 1007 const HTMLTextFormControlElement& sourceElement = static_cast<const HTMLText
FormControlElement&>(source); | 1007 const HTMLTextFormControlElement& sourceElement = static_cast<const HTMLText
FormControlElement&>(source); |
| 1008 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit; | 1008 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit; |
| 1009 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source); | 1009 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source); |
| 1010 } | 1010 } |
| 1011 | 1011 |
| 1012 } // namespace blink | 1012 } // namespace blink |
| OLD | NEW |