| 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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); |
| 416 range->setEnd(indexPosition.containerNode(), indexPosition.offsetInContainer
Node(), ASSERT_NO_EXCEPTION); | 416 range->setEnd(indexPosition.containerNode(), indexPosition.offsetInContainer
Node(), ASSERT_NO_EXCEPTION); |
| 417 return TextIterator::rangeLength(range.get()); | 417 return TextIterator::rangeLength(range->startPosition(), range->endPosition(
)); |
| 418 } | 418 } |
| 419 | 419 |
| 420 int HTMLTextFormControlElement::selectionStart() const | 420 int HTMLTextFormControlElement::selectionStart() const |
| 421 { | 421 { |
| 422 if (!isTextFormControl()) | 422 if (!isTextFormControl()) |
| 423 return 0; | 423 return 0; |
| 424 if (document().focusedElement() != this) | 424 if (document().focusedElement() != this) |
| 425 return m_cachedSelectionStart; | 425 return m_cachedSelectionStart; |
| 426 | 426 |
| 427 return computeSelectionStart(); | 427 return computeSelectionStart(); |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 } | 1004 } |
| 1005 | 1005 |
| 1006 void HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(const Ele
ment& source) | 1006 void HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(const Ele
ment& source) |
| 1007 { | 1007 { |
| 1008 const HTMLTextFormControlElement& sourceElement = static_cast<const HTMLText
FormControlElement&>(source); | 1008 const HTMLTextFormControlElement& sourceElement = static_cast<const HTMLText
FormControlElement&>(source); |
| 1009 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit; | 1009 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit; |
| 1010 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source); | 1010 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source); |
| 1011 } | 1011 } |
| 1012 | 1012 |
| 1013 } // namespace blink | 1013 } // namespace blink |
| OLD | NEW |