| Differences between
and this patch
- a/WebCore/ChangeLog +23 lines
Lines 2-7 a/WebCore/ChangeLog_sec1
2
2
3
        Reviewed by NOBODY (OOPS!).
3
        Reviewed by NOBODY (OOPS!).
4
4
5
        Multiselect Popup - PopupMenuClient extension
6
        https://bugs.webkit.org/show_bug.cgi?id=36178
7
8
        PopupMenuClient class is the interface used by combobox popup implementations.
9
        It needs to be extended to handle <select multiple> needs.
10
11
        A new interface named ListPopupClient that inherits from PopupMenuClient was created.
12
        The use of this new class instead of adding methods to PopupMenuClient avoids changes
13
        in other non related implementations of PopupMenuClient.
14
15
        RenderMenuList has changed to inherit ListPopupClient instead of PopupMenuClient
16
        and to have the new methods implemented.
17
18
        * platform/PopupMenuClient.h:
19
        * rendering/RenderMenuList.cpp:
20
        (WebCore::RenderMenuList::listBoxSelectItem):
21
        (WebCore::RenderMenuList::multiple):
22
        * rendering/RenderMenuList.h:
23
24
2010-03-18  Luiz Agostini  <luiz.agostini@openbossa.org>
25
26
        Reviewed by NOBODY (OOPS!).
27
5
        Multiselect Popup - Listbox click simulation
28
        Multiselect Popup - Listbox click simulation
6
        https://bugs.webkit.org/show_bug.cgi?id=36177
29
        https://bugs.webkit.org/show_bug.cgi?id=36177
7
30
- a/WebCore/platform/PopupMenuClient.h +8 lines
Lines 1-4 a/WebCore/platform/PopupMenuClient.h_sec1
1
/*
1
/*
2
 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
2
 * Copyright (C) 2006 Apple Computer, Inc.
3
 * Copyright (C) 2006 Apple Computer, Inc.
3
 *
4
 *
4
 * This library is free software; you can redistribute it and/or
5
 * This library is free software; you can redistribute it and/or
Lines 64-69 public: a/WebCore/platform/PopupMenuClient.h_sec2
64
    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize) = 0;
65
    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize) = 0;
65
};
66
};
66
67
68
class ListPopupClient : public PopupMenuClient {
69
public:
70
    virtual void listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow = true) = 0;
71
    virtual bool multiple() = 0;
72
};
73
74
67
}
75
}
68
76
69
#endif
77
#endif
- a/WebCore/rendering/RenderMenuList.cpp +13 lines
Lines 1-6 a/WebCore/rendering/RenderMenuList.cpp_sec1
1
/*
1
/*
2
 * This file is part of the select element renderer in WebCore.
2
 * This file is part of the select element renderer in WebCore.
3
 *
3
 *
4
 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4
 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
5
 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
5
 *               2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
6
 *               2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
6
 *
7
 *
Lines 309-314 void RenderMenuList::valueChanged(unsigned listIndex, bool fireOnChange) a/WebCore/rendering/RenderMenuList.cpp_sec2
309
    select->setSelectedIndexByUser(select->listToOptionIndex(listIndex), true, fireOnChange);
310
    select->setSelectedIndexByUser(select->listToOptionIndex(listIndex), true, fireOnChange);
310
}
311
}
311
312
313
void RenderMenuList::listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow)
314
{
315
    SelectElement* select = toSelectElement(static_cast<Element*>(node()));
316
    select->listBoxSelectItem(select->listToOptionIndex(listIndex), allowMultiplySelections, shift, fireOnChangeNow);
317
}
318
319
bool RenderMenuList::multiple()
320
{
321
    SelectElement* select = toSelectElement(static_cast<Element*>(node()));
322
    return select->multiple();
323
}
324
312
void RenderMenuList::didSetSelectedIndex()
325
void RenderMenuList::didSetSelectedIndex()
313
{
326
{
314
    int index = selectedIndex();
327
    int index = selectedIndex();
- a/WebCore/rendering/RenderMenuList.h -2 / +5 lines
Lines 1-6 a/WebCore/rendering/RenderMenuList.h_sec1
1
/*
1
/*
2
 * This file is part of the select element renderer in WebCore.
2
 * This file is part of the select element renderer in WebCore.
3
 *
3
 *
4
 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4
 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
5
 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
5
 *
6
 *
6
 * This library is free software; you can redistribute it and/or
7
 * This library is free software; you can redistribute it and/or
Lines 37-43 namespace WebCore { a/WebCore/rendering/RenderMenuList.h_sec2
37
class PopupMenu;
38
class PopupMenu;
38
class RenderText;
39
class RenderText;
39
40
40
class RenderMenuList : public RenderFlexibleBox, private PopupMenuClient {
41
class RenderMenuList : public RenderFlexibleBox, private ListPopupClient {
41
public:
42
public:
42
    RenderMenuList(Element*);
43
    RenderMenuList(Element*);
43
    virtual ~RenderMenuList();
44
    virtual ~RenderMenuList();
Lines 97-102 private: a/WebCore/rendering/RenderMenuList.h_sec3
97
    virtual HostWindow* hostWindow() const;
98
    virtual HostWindow* hostWindow() const;
98
    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
99
    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
99
100
101
    virtual void listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow = true);
102
    virtual bool multiple();
103
100
    virtual bool hasLineIfEmpty() const { return true; }
104
    virtual bool hasLineIfEmpty() const { return true; }
101
105
102
    Color itemBackgroundColor(unsigned listIndex) const;
106
    Color itemBackgroundColor(unsigned listIndex) const;
103
- 

Return to Bug 36178