Changeset 61487 in webkit


Ignore:
Timestamp:
Jun 19, 2010 7:19:32 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-06-19 Yael Aharon <yael.aharon@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Platform plugin's multi-select does not take OptGroup into account
https://bugs.webkit.org/show_bug.cgi?id=40718

In multi-select elements, optgroup elements are counted in the index calculation,
but in single-select they are not. Keep the same logic even when NO_LISTBOX_RENDERING
is enabled.
Added tests to the existing manual test, as testing this requires a special build, in which
NO_LISTBOX_RENDERING is enabled.

  • html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::listBoxSelectItem):
  • manual-tests/no-listbox-rendering.html:
  • rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::listBoxSelectItem):

2010-06-19 Yael Aharon <yael.aharon@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Platform plugin's multi-select does not take OptGroup into account
https://bugs.webkit.org/show_bug.cgi?id=40718

Make sure that SelectData is valid throughout the lifetime of the dialog.
This is mostly important for the Orbt based plugin.
Added virtual desctructors where they were missing.

  • Api/qwebkitplatformplugin.h: (QWebSelectData::~QWebSelectData): (QWebSelectMethod::~QWebSelectMethod): (QWebNotificationData::~QWebNotificationData):
  • WebCoreSupport/QtPlatformPlugin.cpp: (WebCore::SelectInputMethodWrapper::SelectInputMethodWrapper): (WebCore::SelectInputMethodWrapper::~SelectInputMethodWrapper): (WebCore::SelectInputMethodWrapper::show):
  • WebCoreSupport/QtPlatformPlugin.h:
  • examples/platformplugin/WebPlugin.cpp:
  • examples/platformplugin/qwebkitplatformplugin.h: (QWebSelectData::~QWebSelectData): (QWebSelectMethod::~QWebSelectMethod): (QWebNotificationData::~QWebNotificationData):
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r61486 r61487  
     12010-06-19  Yael Aharon  <yael.aharon@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Platform plugin's multi-select does not take OptGroup into account
     6        https://bugs.webkit.org/show_bug.cgi?id=40718
     7
     8        In multi-select elements, optgroup elements are counted in the index calculation,
     9        but in single-select they are not. Keep the same logic even when NO_LISTBOX_RENDERING
     10        is enabled.
     11        Added tests to the existing manual test, as testing this requires a special build, in which
     12        NO_LISTBOX_RENDERING is enabled.
     13
     14        * html/HTMLSelectElement.cpp:
     15        (WebCore::HTMLSelectElement::listBoxSelectItem):
     16        * manual-tests/no-listbox-rendering.html:
     17        * rendering/RenderMenuList.cpp:
     18        (WebCore::RenderMenuList::listBoxSelectItem):
     19
    1202010-06-19  Thomas Van Lenten  <thomasvl@chromium.org>
    221
  • trunk/WebCore/html/HTMLSelectElement.cpp

    r61293 r61487  
    108108{
    109109    if (!multiple())
    110         setSelectedIndexByUser(listIndex, true, fireOnChangeNow);
     110        setSelectedIndexByUser(listToOptionIndex(listIndex), true, fireOnChangeNow);
    111111    else {
    112112        updateSelectedState(m_data, this, listIndex, allowMultiplySelections, shift);
  • trunk/WebCore/manual-tests/no-listbox-rendering.html

    r57714 r61487  
    2323    </tr>
    2424    <tr>
     25        <td>
     26        <select multiple>
     27        <optgroup label="1"></optgroup>
     28        <option>11</option>
     29        <option>12</option>
     30        <option>13</option>
     31        <option>14</option>
     32        <optgroup label="2"></optgroup>
     33        <option>21</option>
     34        <option>22</option>
     35        <option>23</option>
     36        <option>24</option>
     37        </select>
     38        </td>
     39        <td>combobox in previos cell should handle optgroup correctly.</td>
     40    </tr>
     41    <tr>
     42        <td>
     43        <select>
     44        <optgroup label="1"></optgroup>
     45        <option>11</option>
     46        <option>12</option>
     47        <option>13</option>
     48        <option>14</option>
     49        <optgroup label="2"></optgroup>
     50        <option>21</option>
     51        <option>22</option>
     52        <option>23</option>
     53        <option>24</option>
     54        </select>
     55        </td>
     56        <td>combobox in previos cell should handle optgroup correctly.</td>
     57    </tr>
     58    <tr>
    2559        <td><input type="reset"</td>
    2660        <td>after pressing this button all the combo boxes should go back to the state discribed above.</td>
  • trunk/WebCore/rendering/RenderMenuList.cpp

    r59956 r61487  
    315315{
    316316    SelectElement* select = toSelectElement(static_cast<Element*>(node()));
    317     select->listBoxSelectItem(select->listToOptionIndex(listIndex), allowMultiplySelections, shift, fireOnChangeNow);
     317    select->listBoxSelectItem(listIndex, allowMultiplySelections, shift, fireOnChangeNow);
    318318}
    319319
  • trunk/WebKit/qt/Api/qwebkitplatformplugin.h

    r61121 r61487  
    3232{
    3333public:
    34     inline ~QWebSelectData() {}
     34    virtual ~QWebSelectData() {}
    3535
    3636    enum ItemType { Option, Group, Separator };
     
    4949    Q_OBJECT
    5050public:
    51     inline ~QWebSelectMethod() {}
     51    virtual ~QWebSelectMethod() {}
    5252
    5353    virtual void show(const QWebSelectData&) = 0;
     
    6262{
    6363public:
     64    virtual ~QWebNotificationData() {}
     65
    6466    virtual const QString title() const = 0;
    6567    virtual const QString message() const = 0;
  • trunk/WebKit/qt/ChangeLog

    r61480 r61487  
     12010-06-19  Yael Aharon  <yael.aharon@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Platform plugin's multi-select does not take OptGroup into account
     6        https://bugs.webkit.org/show_bug.cgi?id=40718
     7
     8        Make sure that SelectData is valid throughout the lifetime of the dialog.
     9        This is mostly important for the Orbt based plugin.
     10        Added virtual desctructors where they were missing.
     11
     12        * Api/qwebkitplatformplugin.h:
     13        (QWebSelectData::~QWebSelectData):
     14        (QWebSelectMethod::~QWebSelectMethod):
     15        (QWebNotificationData::~QWebNotificationData):
     16        * WebCoreSupport/QtPlatformPlugin.cpp:
     17        (WebCore::SelectInputMethodWrapper::SelectInputMethodWrapper):
     18        (WebCore::SelectInputMethodWrapper::~SelectInputMethodWrapper):
     19        (WebCore::SelectInputMethodWrapper::show):
     20        * WebCoreSupport/QtPlatformPlugin.h:
     21        * examples/platformplugin/WebPlugin.cpp:
     22        * examples/platformplugin/qwebkitplatformplugin.h:
     23        (QWebSelectData::~QWebSelectData):
     24        (QWebSelectMethod::~QWebSelectMethod):
     25        (QWebNotificationData::~QWebNotificationData):
     26
    1272010-06-19  No'am Rosenthal  <noam.rosenthal@nokia.com>
    228
  • trunk/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp

    r61121 r61487  
    5757SelectInputMethodWrapper::SelectInputMethodWrapper(QWebSelectMethod* plugin)
    5858    : m_plugin(plugin)
     59    , m_selectData(0)
    5960{
    6061    m_plugin->setParent(this);
     
    6364}
    6465
     66SelectInputMethodWrapper::~SelectInputMethodWrapper()
     67{
     68    delete m_selectData;
     69}
     70
    6571void SelectInputMethodWrapper::show()
    6672{
    67     SelectData data(this);
    68     m_plugin->show(data);
     73    if (m_selectData)
     74        delete m_selectData;
     75    m_selectData = new SelectData(this);
     76    m_plugin->show(*m_selectData);
    6977}
    7078
  • trunk/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h

    r61121 r61487  
    2929class QWebKitPlatformPlugin;
    3030class QWebNotificationPresenter;
     31class QWebSelectData;
    3132
    3233namespace WebCore {
     
    3637public:
    3738    SelectInputMethodWrapper(QWebSelectMethod* plugin);
     39    ~SelectInputMethodWrapper();
    3840
    3941    virtual void show();
     
    4648private:
    4749    QWebSelectMethod* m_plugin;
     50    QWebSelectData* m_selectData;
    4851};
    4952
  • trunk/WebKit/qt/examples/platformplugin/WebPlugin.cpp

    r61121 r61487  
    222222}
    223223
    224 Q_EXPORT_PLUGIN2(qwebselectim, WebPlugin)
     224Q_EXPORT_PLUGIN2(platformplugin, WebPlugin)
  • trunk/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h

    r61121 r61487  
    3232{
    3333public:
    34     inline ~QWebSelectData() {}
     34    virtual ~QWebSelectData() {}
    3535
    3636    enum ItemType { Option, Group, Separator };
     
    4949    Q_OBJECT
    5050public:
    51     inline ~QWebSelectMethod() {}
     51    virtual ~QWebSelectMethod() {}
    5252
    5353    virtual void show(const QWebSelectData&) = 0;
     
    6262{
    6363public:
     64    virtual ~QWebNotificationData() {}
     65
    6466    virtual const QString title() const = 0;
    6567    virtual const QString message() const = 0;
Note: See TracChangeset for help on using the changeset viewer.