Reviewed by John.
No regression test possible.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
* platform/PopupMenuClient.h:
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenu::calculatePositionAndSize):
(WebCore::PopupMenu::focusFirst):
(WebCore::PopupMenu::focusLast):
(WebCore::PopupMenu::down):
(WebCore::PopupMenu::up):
(WebCore::PopupMenu::paint):
* rendering/RenderMenuList.cpp:
* rendering/RenderMenuList.h:
* rendering/RenderTextControl.cpp:
* rendering/RenderTextControl.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@23876
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-06-29 Adam Roben <aroben@apple.com>
+
+ Change PopupMenuClient::listSize to return an int to appease warnings from MSVC /W3
+
+ Reviewed by John.
+
+ No regression test possible.
+
+ * html/HTMLSelectElement.cpp:
+ (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
+ * platform/PopupMenuClient.h:
+ * platform/win/PopupMenuWin.cpp:
+ (WebCore::PopupMenu::calculatePositionAndSize):
+ (WebCore::PopupMenu::focusFirst):
+ (WebCore::PopupMenu::focusLast):
+ (WebCore::PopupMenu::down):
+ (WebCore::PopupMenu::up):
+ (WebCore::PopupMenu::paint):
+ * rendering/RenderMenuList.cpp:
+ * rendering/RenderMenuList.h:
+ * rendering/RenderTextControl.cpp:
+ * rendering/RenderTextControl.h:
+
2007-06-29 Adam Roben <aroben@apple.com>
Fix two typos spotted by MSVC /W3
#else
int listIndex = optionToListIndex(selectedIndex());
if (keyIdentifier == "Down" || keyIdentifier == "Right") {
- size_t size = listItems().size();
+ int size = listItems().size();
for (listIndex += 1;
listIndex >= 0 && listIndex < size && (listItems()[listIndex]->disabled() || !listItems()[listIndex]->hasTagName(optionTag));
++listIndex);
setSelectedIndex(listToOptionIndex(listIndex));
handled = true;
} else if (keyIdentifier == "Up" || keyIdentifier == "Left") {
- size_t size = listItems().size();
+ int size = listItems().size();
for (listIndex -= 1;
listIndex >= 0 && listIndex < size && (listItems()[listIndex]->disabled() || !listItems()[listIndex]->hasTagName(optionTag));
--listIndex);
virtual Document* clientDocument() const = 0;
virtual int clientPaddingLeft() const = 0;
virtual int clientPaddingRight() const = 0;
- virtual unsigned listSize() const = 0;
+ virtual int listSize() const = 0;
virtual int selectedIndex() const = 0;
virtual void hidePopup() = 0;
virtual bool itemIsSeparator(unsigned listIndex) const = 0;
rScreenCoords.setLocation(location);
// First, determine the popup's height
- size_t itemCount = client()->listSize();
+ int itemCount = client()->listSize();
m_itemHeight = client()->clientStyle()->font().height() + optionSpacingMiddle;
int naturalHeight = m_itemHeight * itemCount;
int popupHeight = min(maxPopupHeight, naturalHeight);
if (!client())
return;
- size_t size = client()->listSize();
+ int size = client()->listSize();
for (int i = 0; i < size; ++i)
if (client()->itemIsEnabled(i)) {
if (!client())
return;
- size_t size = client()->listSize();
+ int size = client()->listSize();
for (int i = size - 1; i > 0; --i)
if (client()->itemIsEnabled(i)) {
if (!client())
return false;
- size_t size = client()->listSize();
+ int size = client()->listSize();
int lastSelectableIndex, selectedListIndex;
lastSelectableIndex = selectedListIndex = focusedIndex();
if (!client())
return false;
- size_t size = client()->listSize();
+ int size = client()->listSize();
int lastSelectableIndex, selectedListIndex;
lastSelectableIndex = selectedListIndex = focusedIndex();
GraphicsContext context(m_DC);
- size_t itemCount = client()->listSize();
+ int itemCount = client()->listSize();
// listRect is the damageRect translated into the coordinates of the entire menu list (which is itemCount * m_itemHeight pixels tall)
IntRect listRect = damageRect;
return paddingRight();
}
-unsigned RenderMenuList::listSize() const
+int RenderMenuList::listSize() const
{
HTMLSelectElement* select = static_cast<HTMLSelectElement*>(node());
return select->listItems().size();
virtual Document* clientDocument() const;
virtual int clientPaddingLeft() const;
virtual int clientPaddingRight() const;
- virtual unsigned listSize() const;
+ virtual int listSize() const;
virtual int selectedIndex() const;
virtual bool itemIsSeparator(unsigned listIndex) const;
virtual bool itemIsLabel(unsigned listIndex) const;
void RenderTextControl::valueChanged(unsigned listIndex, bool fireEvents)
{
- ASSERT(listIndex < listSize());
+ ASSERT(static_cast<int>(listIndex) < listSize());
HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
if (listIndex == (listSize() - 1)) {
if (fireEvents) {
String RenderTextControl::itemText(unsigned listIndex) const
{
- unsigned size = listSize();
+ int size = listSize();
if (size == 1) {
ASSERT(!listIndex);
return searchMenuNoRecentSearchesText();
return paddingRight() + m_cancelButton->renderer()->width();
}
-unsigned RenderTextControl::listSize() const
+int RenderTextControl::listSize() const
{
// If there are no recent searches, then our menu will have 1 "No recent searches" item.
if (!m_recentSearches.size())
virtual Document* clientDocument() const;
virtual int clientPaddingLeft() const;
virtual int clientPaddingRight() const;
- virtual unsigned listSize() const;
+ virtual int listSize() const;
virtual int selectedIndex() const;
virtual bool itemIsSeparator(unsigned listIndex) const;
virtual bool itemIsLabel(unsigned listIndex) const;