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

Side by Side Diff: Source/core/html/HTMLInputElement.cpp

Issue 18548003: Rename ExceptionCode constants to use the names in the spec (2/3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLElement.cpp ('k') | Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
10 * Copyright (C) 2012 Samsung Electronics. All rights reserved. 10 * Copyright (C) 2012 Samsung Electronics. All rights reserved.
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 } 546 }
547 547
548 bool HTMLInputElement::canHaveSelection() const 548 bool HTMLInputElement::canHaveSelection() const
549 { 549 {
550 return isTextField(); 550 return isTextField();
551 } 551 }
552 552
553 int HTMLInputElement::selectionStartForBinding(ExceptionCode& ec) const 553 int HTMLInputElement::selectionStartForBinding(ExceptionCode& ec) const
554 { 554 {
555 if (!canHaveSelection()) { 555 if (!canHaveSelection()) {
556 ec = INVALID_STATE_ERR; 556 ec = InvalidStateError;
557 return 0; 557 return 0;
558 } 558 }
559 return HTMLTextFormControlElement::selectionStart(); 559 return HTMLTextFormControlElement::selectionStart();
560 } 560 }
561 561
562 int HTMLInputElement::selectionEndForBinding(ExceptionCode& ec) const 562 int HTMLInputElement::selectionEndForBinding(ExceptionCode& ec) const
563 { 563 {
564 if (!canHaveSelection()) { 564 if (!canHaveSelection()) {
565 ec = INVALID_STATE_ERR; 565 ec = InvalidStateError;
566 return 0; 566 return 0;
567 } 567 }
568 return HTMLTextFormControlElement::selectionEnd(); 568 return HTMLTextFormControlElement::selectionEnd();
569 } 569 }
570 570
571 String HTMLInputElement::selectionDirectionForBinding(ExceptionCode& ec) const 571 String HTMLInputElement::selectionDirectionForBinding(ExceptionCode& ec) const
572 { 572 {
573 if (!canHaveSelection()) { 573 if (!canHaveSelection()) {
574 ec = INVALID_STATE_ERR; 574 ec = InvalidStateError;
575 return String(); 575 return String();
576 } 576 }
577 return HTMLTextFormControlElement::selectionDirection(); 577 return HTMLTextFormControlElement::selectionDirection();
578 } 578 }
579 579
580 void HTMLInputElement::setSelectionStartForBinding(int start, ExceptionCode& ec) 580 void HTMLInputElement::setSelectionStartForBinding(int start, ExceptionCode& ec)
581 { 581 {
582 if (!canHaveSelection()) { 582 if (!canHaveSelection()) {
583 ec = INVALID_STATE_ERR; 583 ec = InvalidStateError;
584 return; 584 return;
585 } 585 }
586 HTMLTextFormControlElement::setSelectionStart(start); 586 HTMLTextFormControlElement::setSelectionStart(start);
587 } 587 }
588 588
589 void HTMLInputElement::setSelectionEndForBinding(int end, ExceptionCode& ec) 589 void HTMLInputElement::setSelectionEndForBinding(int end, ExceptionCode& ec)
590 { 590 {
591 if (!canHaveSelection()) { 591 if (!canHaveSelection()) {
592 ec = INVALID_STATE_ERR; 592 ec = InvalidStateError;
593 return; 593 return;
594 } 594 }
595 HTMLTextFormControlElement::setSelectionEnd(end); 595 HTMLTextFormControlElement::setSelectionEnd(end);
596 } 596 }
597 597
598 void HTMLInputElement::setSelectionDirectionForBinding(const String& direction, ExceptionCode& ec) 598 void HTMLInputElement::setSelectionDirectionForBinding(const String& direction, ExceptionCode& ec)
599 { 599 {
600 if (!canHaveSelection()) { 600 if (!canHaveSelection()) {
601 ec = INVALID_STATE_ERR; 601 ec = InvalidStateError;
602 return; 602 return;
603 } 603 }
604 HTMLTextFormControlElement::setSelectionDirection(direction); 604 HTMLTextFormControlElement::setSelectionDirection(direction);
605 } 605 }
606 606
607 void HTMLInputElement::setSelectionRangeForBinding(int start, int end, Exception Code& ec) 607 void HTMLInputElement::setSelectionRangeForBinding(int start, int end, Exception Code& ec)
608 { 608 {
609 if (!canHaveSelection()) { 609 if (!canHaveSelection()) {
610 ec = INVALID_STATE_ERR; 610 ec = InvalidStateError;
611 return; 611 return;
612 } 612 }
613 HTMLTextFormControlElement::setSelectionRange(start, end); 613 HTMLTextFormControlElement::setSelectionRange(start, end);
614 } 614 }
615 615
616 void HTMLInputElement::setSelectionRangeForBinding(int start, int end, const Str ing& direction, ExceptionCode& ec) 616 void HTMLInputElement::setSelectionRangeForBinding(int start, int end, const Str ing& direction, ExceptionCode& ec)
617 { 617 {
618 if (!canHaveSelection()) { 618 if (!canHaveSelection()) {
619 ec = INVALID_STATE_ERR; 619 ec = InvalidStateError;
620 return; 620 return;
621 } 621 }
622 HTMLTextFormControlElement::setSelectionRange(start, end, direction); 622 HTMLTextFormControlElement::setSelectionRange(start, end, direction);
623 } 623 }
624 624
625 void HTMLInputElement::accessKeyAction(bool sendMouseEvents) 625 void HTMLInputElement::accessKeyAction(bool sendMouseEvents)
626 { 626 {
627 m_inputType->accessKeyAction(sendMouseEvents); 627 m_inputType->accessKeyAction(sendMouseEvents);
628 } 628 }
629 629
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 setSelectionRange(max, max); 1020 setSelectionRange(max, max);
1021 else 1021 else
1022 cacheSelectionInResponseToSetValue(max); 1022 cacheSelectionInResponseToSetValue(max);
1023 1023
1024 dispatchInputEvent(); 1024 dispatchInputEvent();
1025 } 1025 }
1026 1026
1027 void HTMLInputElement::setValue(const String& value, ExceptionCode& ec, TextFiel dEventBehavior eventBehavior) 1027 void HTMLInputElement::setValue(const String& value, ExceptionCode& ec, TextFiel dEventBehavior eventBehavior)
1028 { 1028 {
1029 if (isFileUpload() && !value.isEmpty()) { 1029 if (isFileUpload() && !value.isEmpty()) {
1030 ec = INVALID_STATE_ERR; 1030 ec = InvalidStateError;
1031 return; 1031 return;
1032 } 1032 }
1033 setValue(value, eventBehavior); 1033 setValue(value, eventBehavior);
1034 } 1034 }
1035 1035
1036 void HTMLInputElement::setValue(const String& value, TextFieldEventBehavior even tBehavior) 1036 void HTMLInputElement::setValue(const String& value, TextFieldEventBehavior even tBehavior)
1037 { 1037 {
1038 if (!m_inputType->canSetValue(value)) 1038 if (!m_inputType->canSetValue(value))
1039 return; 1039 return;
1040 1040
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
1831 } 1831 }
1832 1832
1833 void ListAttributeTargetObserver::idTargetChanged() 1833 void ListAttributeTargetObserver::idTargetChanged()
1834 { 1834 {
1835 m_element->listAttributeTargetChanged(); 1835 m_element->listAttributeTargetChanged();
1836 } 1836 }
1837 1837
1838 void HTMLInputElement::setRangeText(const String& replacement, ExceptionCode& ec ) 1838 void HTMLInputElement::setRangeText(const String& replacement, ExceptionCode& ec )
1839 { 1839 {
1840 if (!m_inputType->supportsSelectionAPI()) { 1840 if (!m_inputType->supportsSelectionAPI()) {
1841 ec = INVALID_STATE_ERR; 1841 ec = InvalidStateError;
1842 return; 1842 return;
1843 } 1843 }
1844 1844
1845 HTMLTextFormControlElement::setRangeText(replacement, ec); 1845 HTMLTextFormControlElement::setRangeText(replacement, ec);
1846 } 1846 }
1847 1847
1848 void HTMLInputElement::setRangeText(const String& replacement, unsigned start, u nsigned end, const String& selectionMode, ExceptionCode& ec) 1848 void HTMLInputElement::setRangeText(const String& replacement, unsigned start, u nsigned end, const String& selectionMode, ExceptionCode& ec)
1849 { 1849 {
1850 if (!m_inputType->supportsSelectionAPI()) { 1850 if (!m_inputType->supportsSelectionAPI()) {
1851 ec = INVALID_STATE_ERR; 1851 ec = InvalidStateError;
1852 return; 1852 return;
1853 } 1853 }
1854 1854
1855 HTMLTextFormControlElement::setRangeText(replacement, start, end, selectionM ode, ec); 1855 HTMLTextFormControlElement::setRangeText(replacement, start, end, selectionM ode, ec);
1856 } 1856 }
1857 1857
1858 bool HTMLInputElement::setupDateTimeChooserParameters(DateTimeChooserParameters& parameters) 1858 bool HTMLInputElement::setupDateTimeChooserParameters(DateTimeChooserParameters& parameters)
1859 { 1859 {
1860 if (!document()->view()) 1860 if (!document()->view())
1861 return false; 1861 return false;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1910 } 1910 }
1911 1911
1912 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 1912 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
1913 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() 1913 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer()
1914 { 1914 {
1915 return m_inputType->customStyleForRenderer(originalStyleForRenderer()); 1915 return m_inputType->customStyleForRenderer(originalStyleForRenderer());
1916 } 1916 }
1917 #endif 1917 #endif
1918 1918
1919 } // namespace 1919 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLElement.cpp ('k') | Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698