| 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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 void HTMLTextFormControlElement::restoreCachedSelection() { | 602 void HTMLTextFormControlElement::restoreCachedSelection() { |
| 603 if (setSelectionRange(m_cachedSelectionStart, m_cachedSelectionEnd, | 603 if (setSelectionRange(m_cachedSelectionStart, m_cachedSelectionEnd, |
| 604 m_cachedSelectionDirection)) | 604 m_cachedSelectionDirection)) |
| 605 scheduleSelectEvent(); | 605 scheduleSelectEvent(); |
| 606 } | 606 } |
| 607 | 607 |
| 608 void HTMLTextFormControlElement::selectionChanged(bool userTriggered) { | 608 void HTMLTextFormControlElement::selectionChanged(bool userTriggered) { |
| 609 if (!layoutObject() || !isTextFormControl()) | 609 if (!layoutObject() || !isTextFormControl()) |
| 610 return; | 610 return; |
| 611 | 611 |
| 612 // selectionStart() or selectionEnd() will return cached selection when this n
ode doesn't have focus | 612 // selectionStart() or selectionEnd() will return cached selection when this |
| 613 // node doesn't have focus. |
| 613 cacheSelection(computeSelectionStart(), computeSelectionEnd(), | 614 cacheSelection(computeSelectionStart(), computeSelectionEnd(), |
| 614 computeSelectionDirection()); | 615 computeSelectionDirection()); |
| 615 | 616 |
| 616 if (LocalFrame* frame = document().frame()) { | 617 if (LocalFrame* frame = document().frame()) { |
| 617 if (frame->selection().isRange() && userTriggered) | 618 if (frame->selection().isRange() && userTriggered) |
| 618 dispatchEvent(Event::createBubble(EventTypeNames::select)); | 619 dispatchEvent(Event::createBubble(EventTypeNames::select)); |
| 619 } | 620 } |
| 620 } | 621 } |
| 621 | 622 |
| 622 void HTMLTextFormControlElement::scheduleSelectEvent() { | 623 void HTMLTextFormControlElement::scheduleSelectEvent() { |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 breakOffset = line->lineBreakPos(); | 726 breakOffset = line->lineBreakPos(); |
| 726 line = next; | 727 line = next; |
| 727 return; | 728 return; |
| 728 } | 729 } |
| 729 } | 730 } |
| 730 breakNode = 0; | 731 breakNode = 0; |
| 731 breakOffset = 0; | 732 breakOffset = 0; |
| 732 } | 733 } |
| 733 | 734 |
| 734 String HTMLTextFormControlElement::valueWithHardLineBreaks() const { | 735 String HTMLTextFormControlElement::valueWithHardLineBreaks() const { |
| 735 // FIXME: It's not acceptable to ignore the HardWrap setting when there is no
layoutObject. | 736 // FIXME: It's not acceptable to ignore the HardWrap setting when there is no |
| 736 // While we have no evidence this has ever been a practical problem, it would
be best to fix it some day. | 737 // layoutObject. While we have no evidence this has ever been a practical |
| 738 // problem, it would be best to fix it some day. |
| 737 HTMLElement* innerText = innerEditorElement(); | 739 HTMLElement* innerText = innerEditorElement(); |
| 738 if (!innerText || !isTextFormControl()) | 740 if (!innerText || !isTextFormControl()) |
| 739 return value(); | 741 return value(); |
| 740 | 742 |
| 741 LayoutBlockFlow* layoutObject = toLayoutBlockFlow(innerText->layoutObject()); | 743 LayoutBlockFlow* layoutObject = toLayoutBlockFlow(innerText->layoutObject()); |
| 742 if (!layoutObject) | 744 if (!layoutObject) |
| 743 return value(); | 745 return value(); |
| 744 | 746 |
| 745 Node* breakNode; | 747 Node* breakNode; |
| 746 unsigned breakOffset; | 748 unsigned breakOffset; |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 | 1087 |
| 1086 void HTMLTextFormControlElement::copyNonAttributePropertiesFromElement( | 1088 void HTMLTextFormControlElement::copyNonAttributePropertiesFromElement( |
| 1087 const Element& source) { | 1089 const Element& source) { |
| 1088 const HTMLTextFormControlElement& sourceElement = | 1090 const HTMLTextFormControlElement& sourceElement = |
| 1089 static_cast<const HTMLTextFormControlElement&>(source); | 1091 static_cast<const HTMLTextFormControlElement&>(source); |
| 1090 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit; | 1092 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit; |
| 1091 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source); | 1093 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source); |
| 1092 } | 1094 } |
| 1093 | 1095 |
| 1094 } // namespace blink | 1096 } // namespace blink |
| OLD | NEW |