OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 virtual LayoutUnit clientPaddingLeft() const { return 0; } | 115 virtual LayoutUnit clientPaddingLeft() const { return 0; } |
116 virtual LayoutUnit clientPaddingRight() const { return 0; } | 116 virtual LayoutUnit clientPaddingRight() const { return 0; } |
117 virtual int listSize() const { return m_listSize; } | 117 virtual int listSize() const { return m_listSize; } |
118 virtual int selectedIndex() const { return m_selectIndex; } | 118 virtual int selectedIndex() const { return m_selectIndex; } |
119 virtual void popupDidHide() { } | 119 virtual void popupDidHide() { } |
120 virtual bool itemIsSeparator(unsigned listIndex) const { return false; } | 120 virtual bool itemIsSeparator(unsigned listIndex) const { return false; } |
121 virtual bool itemIsLabel(unsigned listIndex) const { return false; } | 121 virtual bool itemIsLabel(unsigned listIndex) const { return false; } |
122 virtual bool itemIsSelected(unsigned listIndex) const { return listIndex ==
m_selectIndex; } | 122 virtual bool itemIsSelected(unsigned listIndex) const { return listIndex ==
m_selectIndex; } |
123 virtual bool valueShouldChangeOnHotTrack() const { return false; } | 123 virtual bool valueShouldChangeOnHotTrack() const { return false; } |
124 virtual void setTextFromItem(unsigned listIndex) { } | 124 virtual void setTextFromItem(unsigned listIndex) { } |
| 125 virtual IntRect elementRectRelativeToRootView() const override { return IntR
ect(); } |
| 126 virtual Element& ownerElement() const override { return *toElement(m_node);
} |
| 127 virtual RenderStyle* renderStyleForItem(Element& element) const override { r
eturn nullptr; } |
125 | 128 |
126 virtual FontSelector* fontSelector() const { return 0; } | 129 virtual FontSelector* fontSelector() const { return 0; } |
127 virtual HostWindow* hostWindow() const { return 0; } | 130 virtual HostWindow* hostWindow() const { return 0; } |
128 | 131 |
129 virtual PassRefPtrWillBeRawPtr<Scrollbar> createScrollbar(ScrollableArea*, S
crollbarOrientation, ScrollbarControlSize) { return nullptr; } | 132 virtual PassRefPtrWillBeRawPtr<Scrollbar> createScrollbar(ScrollableArea*, S
crollbarOrientation, ScrollbarControlSize) { return nullptr; } |
130 | 133 |
131 void setDisabledIndex(unsigned index) { m_disabledIndexSet.insert(index); } | 134 void setDisabledIndex(unsigned index) { m_disabledIndexSet.insert(index); } |
132 void setFocusedNode(Node* node) { m_node = node; } | 135 void setFocusedNode(Node* node) { m_node = node; } |
133 void setListSize(int listSize) { m_listSize = listSize; } | 136 void setListSize(int listSize) { m_listSize = listSize; } |
134 | 137 |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 private: | 592 private: |
590 FrameTestHelpers::WebViewHelper m_helper; | 593 FrameTestHelpers::WebViewHelper m_helper; |
591 }; | 594 }; |
592 | 595 |
593 #if OS(MACOSX) || OS(ANDROID) | 596 #if OS(MACOSX) || OS(ANDROID) |
594 TEST_F(SelectPopupMenuStyleTest, DISABLED_PopupListBoxRTLRowWidth) | 597 TEST_F(SelectPopupMenuStyleTest, DISABLED_PopupListBoxRTLRowWidth) |
595 #else | 598 #else |
596 TEST_F(SelectPopupMenuStyleTest, PopupListBoxRTLRowWidth) | 599 TEST_F(SelectPopupMenuStyleTest, PopupListBoxRTLRowWidth) |
597 #endif | 600 #endif |
598 { | 601 { |
| 602 RuntimeEnabledFeatures::setHTMLPopupMenuEnabled(false); |
599 registerMockedURLLoad("select_rtl_width.html"); | 603 registerMockedURLLoad("select_rtl_width.html"); |
600 loadFrame(mainFrame(), "select_rtl_width.html"); | 604 loadFrame(mainFrame(), "select_rtl_width.html"); |
601 HTMLSelectElement* select = toHTMLSelectElement(mainFrame()->frame()->docume
nt()->focusedElement()); | 605 HTMLSelectElement* select = toHTMLSelectElement(mainFrame()->frame()->docume
nt()->focusedElement()); |
602 RenderMenuList* menuList = toRenderMenuList(select->renderer()); | 606 RenderMenuList* menuList = toRenderMenuList(select->renderer()); |
603 ASSERT(menuList); | 607 ASSERT(menuList); |
604 menuList->showPopup(); | 608 menuList->showPopup(); |
605 ASSERT(popupOpen()); | 609 ASSERT(popupOpen()); |
606 PopupListBox* listBox = webView()->selectPopup()->listBox(); | 610 PopupListBox* listBox = webView()->selectPopup()->listBox(); |
607 int ltrWidth = listBox->getRowBaseWidth(0); | 611 int ltrWidth = listBox->getRowBaseWidth(0); |
608 int rtlWidth = listBox->getRowBaseWidth(1); | 612 int rtlWidth = listBox->getRowBaseWidth(1); |
609 EXPECT_LT(rtlWidth, ltrWidth); | 613 EXPECT_LT(rtlWidth, ltrWidth); |
610 } | 614 } |
611 | 615 |
612 } // namespace | 616 } // namespace |
OLD | NEW |