Changeset 19797 in webkit


Ignore:
Timestamp:
Feb 22, 2007 11:57:49 AM (17 years ago)
Author:
antti
Message:

LayoutTests:

Reviewed by Darin.


  • fast/forms/select-initial-position-expected.checksum: Added.
  • fast/forms/select-initial-position-expected.png: Added.
  • fast/forms/select-initial-position-expected.txt: Added.
  • fast/forms/select-initial-position.html: Added.

WebCore:

Reviewed by Darin.


Initiate scroll when selected <option> is added to <select>.

  • html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::insertedIntoDocument):
  • html/HTMLOptionElement.h:
  • html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::notifyOptionSelected): (WebCore::HTMLSelectElement::updateListBoxSelection): (WebCore::HTMLSelectElement::scrollToSelection):
  • html/HTMLSelectElement.h:
Location:
trunk
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r19786 r19797  
     12007-02-21  Antti Koivisto  <antti@apple.com>
     2
     3        Reviewed by Darin.
     4       
     5        - tests for http://bugs.webkit.org/show_bug.cgi?id=11447
     6        REGRESSION(NativeListBox): List not scrolled to preselected option
     7        <rdar://problem/4957463>
     8
     9        * fast/forms/select-initial-position-expected.checksum: Added.
     10        * fast/forms/select-initial-position-expected.png: Added.
     11        * fast/forms/select-initial-position-expected.txt: Added.
     12        * fast/forms/select-initial-position.html: Added.
     13
    1142007-02-21  Geoffrey Garen  <ggaren@apple.com>
    215
  • trunk/WebCore/ChangeLog

    r19796 r19797  
     12007-02-22  Antti Koivisto  <antti@apple.com>
     2
     3        Reviewed by Darin.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=11447
     6        REGRESSION(NativeListBox): List not scrolled to preselected option
     7        <rdar://problem/4957463>
     8       
     9        Initiate scroll when selected <option> is added to <select>.
     10
     11        * html/HTMLOptionElement.cpp:
     12        (WebCore::HTMLOptionElement::insertedIntoDocument):
     13        * html/HTMLOptionElement.h:
     14        * html/HTMLSelectElement.cpp:
     15        (WebCore::HTMLSelectElement::notifyOptionSelected):
     16        (WebCore::HTMLSelectElement::updateListBoxSelection):
     17        (WebCore::HTMLSelectElement::scrollToSelection):
     18        * html/HTMLSelectElement.h:
     19
    1202007-02-22  Zack Rusin  <zrusin@trolltech.com>
    221
  • trunk/WebCore/html/HTMLOptionElement.cpp

    r19383 r19797  
    246246}
    247247
     248void HTMLOptionElement::insertedIntoDocument()
     249{
     250    HTMLSelectElement* select;
     251    if (selected() && (select = getSelect()))
     252        select->scrollToSelection();
     253   
     254    HTMLGenericFormElement::insertedIntoDocument();
     255}
     256
    248257} // namespace
  • trunk/WebCore/html/HTMLOptionElement.h

    r18874 r19797  
    8080   
    8181    virtual bool disabled() const;
     82   
     83    virtual void insertedIntoDocument();
    8284
    8385private:
  • trunk/WebCore/html/HTMLSelectElement.cpp

    r19707 r19797  
    563563        deselectItems(selectedOption);
    564564
    565     if (renderer() && !usesMenuList())
    566         static_cast<RenderListBox*>(renderer())->selectionChanged();
     565    scrollToSelection();
    567566
    568567    m_lastOnChangeIndex = selectedOption->index();
     
    822821    }
    823822
    824     static_cast<RenderListBox*>(renderer())->selectionChanged();
     823    scrollToSelection();
    825824}
    826825
     
    10091008}
    10101009
     1010void HTMLSelectElement::scrollToSelection()
     1011{
     1012    if (renderer() && !usesMenuList())
     1013        static_cast<RenderListBox*>(renderer())->selectionChanged();
     1014}
     1015
    10111016} // namespace
  • trunk/WebCore/html/HTMLSelectElement.h

    r19520 r19797  
    135135    int activeSelectionStartListIndex() const;
    136136    int activeSelectionEndListIndex() const;
     137   
     138    void scrollToSelection();
    137139
    138140private:
Note: See TracChangeset for help on using the changeset viewer.