⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 136205 in webkit


Ignore:
Timestamp:
Nov 29, 2012, 9:46:10 PM (14 years ago)
Author:
keishi@webkit.org
Message:

Better type ahead for DateTimeSymbolicFieldElement
​https://bugs.webkit.org/show_bug.cgi?id=103031

Reviewed by Kent Tamura.

Source/WebCore:

This cuts out the type ahead code that will be used by HTMLSelectElement
and DateTimeSymbolicFieldElement into a TypeAhead class. This will
improve DateTimeSymbolicFieldElement type ahead which was first
character match only, by adding cycling, prefix match and index number
match.

Added tests to month-multiple-fields-keyboard-events.html.

  • GNUmakefile.list.am: Added TypeAhead.{h,cpp}
  • Target.pri: Ditto.
  • WebCore.gypi: Ditto.
  • WebCore.vcproj/WebCore.vcproj: Ditto.
  • WebCore.xcodeproj/project.pbxproj: Ditto.
  • CMakeLists.txt: Ditto.
  • html/HTMLSelectElement.cpp:

(WebCore):
(WebCore::HTMLSelectElement::HTMLSelectElement):
(WebCore::HTMLSelectElement::indexOfSelectedOption): Returns index of current selection.
(WebCore::HTMLSelectElement::optionCount): Returns total number of options.
(WebCore::HTMLSelectElement::optionAtIndex): Returns option at index.
(WebCore::HTMLSelectElement::typeAheadFind): Use TypeAhead.

  • html/HTMLSelectElement.h:

(HTMLSelectElement):

  • html/TypeAhead.cpp: Added.

(WebCore):
(WebCore::TypeAhead::TypeAhead):
(WebCore::stripLeadingWhiteSpace): Moved from HTMLSelectElement.cpp.
(WebCore::TypeAhead::handleEvent): Returns index for match.

  • html/TypeAhead.h: Added.

(WebCore):
(TypeAheadDataSource): Provide the data about the options that TypeAhead should match against.
(TypeAhead):

  • html/shadow/DateTimeSymbolicFieldElement.cpp:

(WebCore::DateTimeSymbolicFieldElement::DateTimeSymbolicFieldElement):
(WebCore::DateTimeSymbolicFieldElement::handleKeyboardEvent):
(WebCore::DateTimeSymbolicFieldElement::indexOfSelectedOption):
(WebCore):
(WebCore::DateTimeSymbolicFieldElement::optionCount):
(WebCore::DateTimeSymbolicFieldElement::optionAtIndex):

  • html/shadow/DateTimeSymbolicFieldElement.h:

(DateTimeSymbolicFieldElement):

LayoutTests:

  • fast/forms/month-multiple-fields/month-multiple-fields-keyboard-events-expected.txt:
  • fast/forms/month-multiple-fields/month-multiple-fields-keyboard-events.html: Added tests for typeahead.
Location:
trunk
Files:
2 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r136202 r136205  
     12012-11-29  Keishi Hattori  <keishi@webkit.org>
     2
     3        Better type ahead for DateTimeSymbolicFieldElement
     4        https://bugs.webkit.org/show_bug.cgi?id=103031
     5
     6        Reviewed by Kent Tamura.
     7
     8        * fast/forms/month-multiple-fields/month-multiple-fields-keyboard-events-expected.txt:
     9        * fast/forms/month-multiple-fields/month-multiple-fields-keyboard-events.html: Added tests for typeahead.
     10
    1112012-11-29  Keishi Hattori  <keishi@webkit.org>
    212
  • trunk/LayoutTests/fast/forms/month-multiple-fields/month-multiple-fields-keyboard-events-expected.txt

    r136113 r136205  
    1616FAIL input.value should be 0012-09. Was 0112-09.
    1717== Left/Right keys ==
    18 FAIL input.value should be 0005-06. Was 0005-09.
     18PASS input.value is "0005-06"
    1919PASS document.activeElement.id is "input"
    2020== Up/Down keys ==
    … …  
    5050PASS input.value is "0001-12"
    5151PASS input.value is "0002-12"
     52== Typeahead cycle first character ==
     53PASS input.value is "2012-01"
     54PASS input.value is "2012-06"
     55PASS input.value is "2012-07"
     56PASS input.value is "2012-01"
     57PASS input.value is "2012-01"
     58== Typeahead prefix match ==
     59PASS input.value is "2012-03"
     60PASS input.value is "2012-03"
     61PASS input.value is "2012-05"
     62PASS input.value is "2012-05"
     63== Typeahead index match ==
     64PASS input.value is "2012-01"
     65PASS input.value is "2012-12"
     66PASS input.value is "2012-12"
     67== Typeahead should search from current selection ==
     68PASS input.value is "2012-06"
    5269== RTL Left/Right keys ==
    5370PASS input.value is "2012-10"
  • trunk/LayoutTests/fast/forms/month-multiple-fields/month-multiple-fields-keyboard-events.html

    r136113 r136205  
    172172shouldBeEqualToString('input.value', '0002-12');
    173173
     174beginTest('Typeahead cycle first character', '2012-09');
     175keyDown('j'); //          -> [Jan] 2012
     176shouldBeEqualToString('input.value', '2012-01');
     177keyDown('j'); //          -> [Jun] 2012
     178shouldBeEqualToString('input.value', '2012-06');
     179keyDown('j'); //          -> [Jul] 2012
     180shouldBeEqualToString('input.value', '2012-07');
     181keyDown('j'); //          -> [Jan] 2012
     182shouldBeEqualToString('input.value', '2012-01');
     183keyDown('x'); //          -> [Jan] 2012
     184shouldBeEqualToString('input.value', '2012-01');
     185
     186beginTest('Typeahead prefix match', '2012-09');
     187keyDown('m'); //          -> [Mar] 2012
     188shouldBeEqualToString('input.value', '2012-03');
     189keyDown('a'); //          -> [Mar] 2012
     190shouldBeEqualToString('input.value', '2012-03');
     191keyDown('y'); //          -> [May] 2012
     192shouldBeEqualToString('input.value', '2012-05');
     193keyDown('x'); //          -> [May] 2012
     194shouldBeEqualToString('input.value', '2012-05');
     195
     196beginTest('Typeahead index match', '2012-09');
     197keyDown('1'); //          -> [Jan] 2012
     198shouldBeEqualToString('input.value', '2012-01');
     199keyDown('2'); //          -> [Dec] 2012
     200shouldBeEqualToString('input.value', '2012-12');
     201keyDown('x'); //          -> [Dec] 2012
     202shouldBeEqualToString('input.value', '2012-12');
     203
     204beginTest('Typeahead should search from current selection', '2012-01');
     205keyDown('j'); //          -> [Jun] 2012
     206shouldBeEqualToString('input.value', '2012-06');
     207
    174208// The tests in the following block fail on platforms without the
    175209// lang-attribute-aware-form-control-UI feature.
  • trunk/Source/WebCore/CMakeLists.txt

    r136113 r136205  
    14681468    html/TimeInputType.cpp
    14691469    html/TimeRanges.cpp
     1470    html/TypeAhead.cpp
    14701471    html/URLInputType.cpp
    14711472    html/ValidationMessage.cpp
  • trunk/Source/WebCore/ChangeLog

    r136204 r136205  
     12012-11-29  Keishi Hattori  <keishi@webkit.org>
     2
     3        Better type ahead for DateTimeSymbolicFieldElement
     4        https://bugs.webkit.org/show_bug.cgi?id=103031
     5
     6        Reviewed by Kent Tamura.
     7
     8        This cuts out the type ahead code that will be used by HTMLSelectElement
     9        and DateTimeSymbolicFieldElement into a TypeAhead class. This will
     10        improve DateTimeSymbolicFieldElement type ahead which was first
     11        character match only, by adding cycling, prefix match and index number
     12        match.
     13
     14        Added tests to month-multiple-fields-keyboard-events.html.
     15
     16        * GNUmakefile.list.am: Added TypeAhead.{h,cpp}
     17        * Target.pri: Ditto.
     18        * WebCore.gypi: Ditto.
     19        * WebCore.vcproj/WebCore.vcproj: Ditto.
     20        * WebCore.xcodeproj/project.pbxproj: Ditto.
     21        * CMakeLists.txt: Ditto.
     22        * html/HTMLSelectElement.cpp:
     23        (WebCore):
     24        (WebCore::HTMLSelectElement::HTMLSelectElement):
     25        (WebCore::HTMLSelectElement::indexOfSelectedOption): Returns index of current selection.
     26        (WebCore::HTMLSelectElement::optionCount): Returns total number of options.
     27        (WebCore::HTMLSelectElement::optionAtIndex): Returns option at index.
     28        (WebCore::HTMLSelectElement::typeAheadFind): Use TypeAhead.
     29        * html/HTMLSelectElement.h:
     30        (HTMLSelectElement):
     31        * html/TypeAhead.cpp: Added.
     32        (WebCore):
     33        (WebCore::TypeAhead::TypeAhead):
     34        (WebCore::stripLeadingWhiteSpace): Moved from HTMLSelectElement.cpp.
     35        (WebCore::TypeAhead::handleEvent): Returns index for match.
     36        * html/TypeAhead.h: Added.
     37        (WebCore):
     38        (TypeAheadDataSource): Provide the data about the options that TypeAhead should match against.
     39        (TypeAhead):
     40        * html/shadow/DateTimeSymbolicFieldElement.cpp:
     41        (WebCore::DateTimeSymbolicFieldElement::DateTimeSymbolicFieldElement):
     42        (WebCore::DateTimeSymbolicFieldElement::handleKeyboardEvent):
     43        (WebCore::DateTimeSymbolicFieldElement::indexOfSelectedOption):
     44        (WebCore):
     45        (WebCore::DateTimeSymbolicFieldElement::optionCount):
     46        (WebCore::DateTimeSymbolicFieldElement::optionAtIndex):
     47        * html/shadow/DateTimeSymbolicFieldElement.h:
     48        (DateTimeSymbolicFieldElement):
     49
    1502012-11-29  Rafael Weinstein  <rafaelw@chromium.org>
    251
  • trunk/Source/WebCore/GNUmakefile.list.am

    r136150 r136205  
    36263626        Source/WebCore/html/track/WebVTTTokenizer.h \
    36273627        Source/WebCore/html/track/WebVTTTokenizer.cpp \
     3628        Source/WebCore/html/TypeAhead.cpp \
     3629        Source/WebCore/html/TypeAhead.h \
    36283630        Source/WebCore/html/URLInputType.cpp \
    36293631        Source/WebCore/html/URLInputType.h \
  • trunk/Source/WebCore/Target.pri

    r136150 r136205  
    691691    html/TextInputType.cpp \
    692692    html/TimeInputType.cpp \
     693    html/TypeAhead.cpp \
    693694    html/URLInputType.cpp \
    694695    html/ValidationMessage.cpp \
    … …  
    18451846    html/TextDocument.h \
    18461847    html/TimeRanges.h \
     1848    html/TypeAhead.h \
    18471849    html/ValidityState.h \
    18481850    html/parser/CSSPreloadScanner.h \
  • trunk/Source/WebCore/WebCore.gypi

    r136166 r136205  
    42674267            'html/WeekInputType.cpp',
    42684268            'html/WeekInputType.h',
     4269            'html/TypeAhead.cpp',
     4270            'html/TypeAhead.h',
    42694271            'html/canvas/CanvasContextAttributes.cpp',
    42704272            'html/canvas/CanvasContextAttributes.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r136150 r136205  
    6399463994                                >
    6399563995                        </File>
     63996                <File
     63997                        RelativePath="..\html\TypeAhead.cpp"
     63998                        >
     63999                </File>
     64000                <File
     64001                        RelativePath="..\html\TypeAhead.h"
     64002                        >
     64003                </File>
    6399664004                        <File
    6399764005                                RelativePath="..\html\URLInputType.cpp"
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r136197 r136205  
    58355835                C348612315FDE21E007A1CC9 /* InputTypeNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C348612115FDE21E007A1CC9 /* InputTypeNames.cpp */; };
    58365836                C348612415FDE21E007A1CC9 /* InputTypeNames.h in Headers */ = {isa = PBXBuildFile; fileRef = C348612215FDE21E007A1CC9 /* InputTypeNames.h */; };
     5837                C375D7FD16639519006184AB /* TypeAhead.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C375D7FB16639519006184AB /* TypeAhead.cpp */; };
     5838                C375D7FE16639519006184AB /* TypeAhead.h in Headers */ = {isa = PBXBuildFile; fileRef = C375D7FC16639519006184AB /* TypeAhead.h */; };
    58375839                C37CDEBD149EF2030042090D /* ColorChooserClient.h in Headers */ = {isa = PBXBuildFile; fileRef = C37CDEBC149EF2030042090D /* ColorChooserClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
    58385840                C3CF17A415B0063F00276D39 /* IdTargetObserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C3CF17A015B0063F00276D39 /* IdTargetObserver.cpp */; };
    … …  
    1324613248                C348612115FDE21E007A1CC9 /* InputTypeNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InputTypeNames.cpp; sourceTree = "<group>"; };
    1324713249                C348612215FDE21E007A1CC9 /* InputTypeNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputTypeNames.h; sourceTree = "<group>"; };
     13250                C375D7FB16639519006184AB /* TypeAhead.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TypeAhead.cpp; sourceTree = "<group>"; };
     13251                C375D7FC16639519006184AB /* TypeAhead.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeAhead.h; sourceTree = "<group>"; };
    1324813252                C37CDEBC149EF2030042090D /* ColorChooserClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorChooserClient.h; sourceTree = "<group>"; };
    1324913253                C3CF17A015B0063F00276D39 /* IdTargetObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IdTargetObserver.cpp; sourceTree = "<group>"; };
    … …  
    1790117905                                E446139E0CD6331000FADA75 /* TimeRanges.h */,
    1790217906                                E446139F0CD6331000FADA75 /* TimeRanges.idl */,
     17907                                C375D7FB16639519006184AB /* TypeAhead.cpp */,
     17908                                C375D7FC16639519006184AB /* TypeAhead.h */,
    1790317909                                F55B3DA91251F12D003EF269 /* URLInputType.cpp */,
    1790417910                                F55B3DAA1251F12D003EF269 /* URLInputType.h */,
    … …  
    2584825854                                15B8B7C91652C5220036EF55 /* JSWebKitCSSMixFunctionValue.h in Headers */,
    2584925855                                93F72AF31666EDFC002A02BD /* LayerPool.h in Headers */,
     25856                                C375D7FE16639519006184AB /* TypeAhead.h in Headers */,
    2585025857                        );
    2585125858                        runOnlyForDeploymentPostprocessing = 0;
    … …  
    2895228959                                86BA766E166427A8005BE5D1 /* FrameLoadRequest.cpp in Sources */,
    2895328960                                93F72AF41666EDFC002A02BD /* LayerPool.mm in Sources */,
     28961                                C375D7FD16639519006184AB /* TypeAhead.cpp in Sources */,
    2895428962                        );
    2895528963                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Source/WebCore/html/HTMLSelectElement.cpp

    r136113 r136205  
    6565static const unsigned maxSelectItems = 10000;
    6666
    67 static const DOMTimeStamp typeAheadTimeout = 1000;
    68 
    6967HTMLSelectElement::HTMLSelectElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
    7068    : HTMLFormControlElementWithState(tagName, document, form)
    71     , m_lastCharTime(0)
     69    , m_typeAhead(this)
    7270    , m_size(0)
    7371    , m_lastOnChangeIndex(-1)
    7472    , m_activeSelectionAnchorIndex(-1)
    7573    , m_activeSelectionEndIndex(-1)
    76     , m_repeatingChar(0)
    7774    , m_isProcessingUserDrivenChange(false)
    7875    , m_multiple(false)
    … …  
    14751472}
    14761473
    1477 static String stripLeadingWhiteSpace(const String& string)
    1478 {
    1479     int length = string.length();
    1480 
    1481     int i;
    1482     for (i = 0; i < length; ++i) {
    1483         if (string[i] != noBreakSpace && (string[i] <= 0x7F ? !isASCIISpace(string[i]) : (direction(string[i]) != WhiteSpaceNeutral)))
    1484             break;
    1485     }
    1486 
    1487     return string.substring(i, length - i);
     1474int HTMLSelectElement::indexOfSelectedOption() const
     1475{
     1476    return optionToListIndex(selectedIndex());
     1477}
     1478
     1479int HTMLSelectElement::optionCount() const
     1480{
     1481    return listItems().size();
     1482}
     1483
     1484String HTMLSelectElement::optionAtIndex(int index) const
     1485{
     1486    const Vector<HTMLElement*>& items = listItems();
     1487   
     1488    HTMLElement* element = items[index];
     1489    if (!element->hasTagName(optionTag) || toHTMLOptionElement(element)->disabled())
     1490        return String();
     1491    return toHTMLOptionElement(element)->textIndentedToRespectGroupLabel();
    14881492}
    14891493
    14901494void HTMLSelectElement::typeAheadFind(KeyboardEvent* event)
    14911495{
    1492     if (event->timeStamp() < m_lastCharTime)
    1493         return;
    1494 
    1495     DOMTimeStamp delta = event->timeStamp() - m_lastCharTime;
    1496     m_lastCharTime = event->timeStamp();
    1497 
    1498     UChar c = event->charCode();
    1499 
    1500     String prefix;
    1501     int searchStartOffset = 1;
    1502     if (delta > typeAheadTimeout) {
    1503         prefix = String(&c, 1);
    1504         m_typedString = prefix;
    1505         m_repeatingChar = c;
    1506     } else {
    1507         m_typedString.append(c);
    1508 
    1509         if (c == m_repeatingChar) {
    1510             // The user is likely trying to cycle through all the items starting
    1511             // with this character, so just search on the character.
    1512             prefix = String(&c, 1);
    1513         } else {
    1514             m_repeatingChar = 0;
    1515             prefix = m_typedString;
    1516             searchStartOffset = 0;
    1517         }
    1518     }
    1519 
    1520     const Vector<HTMLElement*>& items = listItems();
    1521     int itemCount = items.size();
    1522     if (itemCount < 1)
    1523         return;
    1524 
    1525     int selected = selectedIndex();
    1526     int index = optionToListIndex(selected >= 0 ? selected : 0) + searchStartOffset;
     1496    int index = m_typeAhead.handleEvent(event, TypeAhead::MatchPrefix | TypeAhead::CycleFirstChar);
    15271497    if (index < 0)
    15281498        return;
    1529     index %= itemCount;
    1530 
    1531     // Compute a case-folded copy of the prefix string before beginning the search for
    1532     // a matching element. This code uses foldCase to work around the fact that
    1533     // String::startWith does not fold non-ASCII characters. This code can be changed
    1534     // to use startWith once that is fixed.
    1535     String prefixWithCaseFolded(prefix.foldCase());
    1536     for (int i = 0; i < itemCount; ++i, index = (index + 1) % itemCount) {
    1537         HTMLElement* element = items[index];
    1538         if (!element->hasTagName(optionTag) || toHTMLOptionElement(element)->disabled())
    1539             continue;
    1540 
    1541         // Fold the option string and check if its prefix is equal to the folded prefix.
    1542         String text = toHTMLOptionElement(element)->textIndentedToRespectGroupLabel();
    1543         if (stripLeadingWhiteSpace(text).foldCase().startsWith(prefixWithCaseFolded)) {
    1544             selectOption(listToOptionIndex(index), DeselectOtherOptions | DispatchChangeEvent | UserDriven);
    1545             if (!usesMenuList())
    1546                 listBoxOnChange();
    1547 
    1548             setOptionsChangedOnRenderer();
    1549             setNeedsStyleRecalc();
    1550             return;
    1551         }
    1552     }
     1499    selectOption(listToOptionIndex(index), DeselectOtherOptions | DispatchChangeEvent | UserDriven);
     1500    if (!usesMenuList())
     1501        listBoxOnChange();
    15531502}
    15541503
  • trunk/Source/WebCore/html/HTMLSelectElement.h

    r136113 r136205  
    3030#include "HTMLFormControlElementWithState.h"
    3131#include "HTMLOptionsCollection.h"
     32#include "TypeAhead.h"
    3233#include <wtf/Vector.h>
    3334
    … …  
    3637class HTMLOptionElement;
    3738
    38 class HTMLSelectElement : public HTMLFormControlElementWithState {
     39class HTMLSelectElement : public HTMLFormControlElementWithState, public TypeAheadDataSource {
    3940public:
    4041    static PassRefPtr<HTMLSelectElement> create(const QualifiedName&, Document*, HTMLFormElement*);
    … …  
    104105    // For use in the implementation of HTMLOptionElement.
    105106    void optionSelectionStateChanged(HTMLOptionElement*, bool optionIsSelected);
    106    
     107
    107108protected:
    108109    HTMLSelectElement(const QualifiedName&, Document*, HTMLFormElement*);
    … …  
    182183    virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; }
    183184
     185    // TypeAheadDataSource functions.
     186    virtual int indexOfSelectedOption() const OVERRIDE;
     187    virtual int optionCount() const OVERRIDE;
     188    virtual String optionAtIndex(int index) const OVERRIDE;
     189
    184190    // m_listItems contains HTMLOptionElement, HTMLOptGroupElement, and HTMLHRElement objects.
    185191    mutable Vector<HTMLElement*> m_listItems;
    186192    Vector<bool> m_lastOnChangeSelection;
    187193    Vector<bool> m_cachedStateForActiveSelection;
    188     DOMTimeStamp m_lastCharTime;
    189     String m_typedString;
     194    TypeAhead m_typeAhead;
    190195    int m_size;
    191196    int m_lastOnChangeIndex;
    192197    int m_activeSelectionAnchorIndex;
    193198    int m_activeSelectionEndIndex;
    194     UChar m_repeatingChar;
    195199    bool m_isProcessingUserDrivenChange;
    196200    bool m_multiple;
  • trunk/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp

    r136113 r136205  
    5656    , m_visibleEmptyValue(makeVisibleEmptyValue(symbols))
    5757    , m_selectedIndex(-1)
     58    , m_typeAhead(this)
    5859{
    5960    ASSERT(!symbols.isEmpty());
    … …  
    8384
    8485    keyboardEvent->setDefaultHandled();
    85     for (unsigned index = 0; index < m_symbols.size(); ++index) {
    86         if (!m_symbols[index].isEmpty() && WTF::Unicode::toLower(m_symbols[index][0]) == charCode) {
    87             setValueAsInteger(index, DispatchEvent);
    88             return;
    89         }
    90     }
     86
     87    int index = m_typeAhead.handleEvent(keyboardEvent, TypeAhead::MatchPrefix | TypeAhead::CycleFirstChar | TypeAhead::MatchIndex);
     88    if (index < 0)
     89        return;
     90    setValueAsInteger(index, DispatchEvent);
    9191}
    9292
    … …  
    151151}
    152152
     153int DateTimeSymbolicFieldElement::indexOfSelectedOption() const
     154{
     155    return m_selectedIndex;
     156}
     157
     158int DateTimeSymbolicFieldElement::optionCount() const
     159{
     160    return m_symbols.size();
     161}
     162
     163String DateTimeSymbolicFieldElement::optionAtIndex(int index) const
     164{
     165    return m_symbols[index];
     166}
     167
    153168} // namespace WebCore
    154169
  • trunk/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h

    r136113 r136205  
    2929#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
    3030#include "DateTimeFieldElement.h"
     31#include "TypeAhead.h"
    3132
    3233namespace WebCore {
    … …  
    3435// DateTimeSymbolicFieldElement represents non-numeric field of data time
    3536// format, such as: AM/PM, and month.
    36 class DateTimeSymbolicFieldElement : public DateTimeFieldElement {
     37class DateTimeSymbolicFieldElement : public DateTimeFieldElement, public TypeAheadDataSource {
    3738    WTF_MAKE_NONCOPYABLE(DateTimeSymbolicFieldElement);
    3839
    … …  
    6061    virtual String visibleValue() const OVERRIDE FINAL;
    6162
     63    // TypeAheadDataSource functions.
     64    virtual int indexOfSelectedOption() const OVERRIDE;
     65    virtual int optionCount() const OVERRIDE;
     66    virtual String optionAtIndex(int index) const OVERRIDE;
     67
    6268    const Vector<String> m_symbols;
    6369
    … …  
    6672    const AtomicString m_visibleEmptyValue;
    6773    int m_selectedIndex;
     74    TypeAhead m_typeAhead;
    6875};
    6976
Note: See TracChangeset for help on using the changeset viewer.