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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 { | 585 { |
586 if (!isTextFormControl()) | 586 if (!isTextFormControl()) |
587 return 0; | 587 return 0; |
588 if (document()->focusedNode() != this && cachedSelectionEnd() >= 0) | 588 if (document()->focusedNode() != this && cachedSelectionEnd() >= 0) |
589 return cachedSelectionEnd(); | 589 return cachedSelectionEnd(); |
590 if (!renderer()) | 590 if (!renderer()) |
591 return 0; | 591 return 0; |
592 return toRenderTextControl(renderer())->selectionEnd(); | 592 return toRenderTextControl(renderer())->selectionEnd(); |
593 } | 593 } |
594 | 594 |
595 VisibleSelection HTMLTextFormControlElement::selection() const | 595 PassRefPtr<Range> HTMLTextFormControlElement::selection() const |
596 { | 596 { |
597 if (!renderer() || !isTextFormControl() || cachedSelectionStart() < 0 || cac
hedSelectionEnd() < 0) | 597 if (!renderer() || !isTextFormControl() || cachedSelectionStart() < 0 || cac
hedSelectionEnd() < 0) |
598 return VisibleSelection(); | 598 return 0; |
599 return toRenderTextControl(renderer())->selection(cachedSelectionStart(), ca
chedSelectionEnd()); | 599 return toRenderTextControl(renderer())->selection(cachedSelectionStart(), ca
chedSelectionEnd()); |
600 } | 600 } |
601 | 601 |
602 void HTMLTextFormControlElement::parseMappedAttribute(Attribute* attr) | 602 void HTMLTextFormControlElement::parseMappedAttribute(Attribute* attr) |
603 { | 603 { |
604 if (attr->name() == placeholderAttr) | 604 if (attr->name() == placeholderAttr) |
605 updatePlaceholderVisibility(true); | 605 updatePlaceholderVisibility(true); |
606 else if (attr->name() == onselectAttr) | 606 else if (attr->name() == onselectAttr) |
607 setAttributeEventListener(eventNames().selectEvent, createAttributeEvent
Listener(this, attr)); | 607 setAttributeEventListener(eventNames().selectEvent, createAttributeEvent
Listener(this, attr)); |
608 else if (attr->name() == onchangeAttr) | 608 else if (attr->name() == onchangeAttr) |
609 setAttributeEventListener(eventNames().changeEvent, createAttributeEvent
Listener(this, attr)); | 609 setAttributeEventListener(eventNames().changeEvent, createAttributeEvent
Listener(this, attr)); |
610 else | 610 else |
611 HTMLFormControlElementWithState::parseMappedAttribute(attr); | 611 HTMLFormControlElementWithState::parseMappedAttribute(attr); |
612 } | 612 } |
613 | 613 |
614 } // namespace Webcore | 614 } // namespace Webcore |
OLD | NEW |