| Differences between
and this patch
- Source/WebCore/ChangeLog +22 lines
Lines 1-3 Source/WebCore/ChangeLog_sec1
1
2012-05-08  Rob Flack  <flackr@chromium.org>
2
3
        [chromium] Only increase size of Combo Box Options when displayed on touch screen
4
        https://bugs.webkit.org/show_bug.cgi?id=85921
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Adds a flag to set whether the current device is a touch screen, independent of whether touch events are supported and use this for the combo box sizing.
9
10
        * page/Settings.cpp:
11
        (WebCore::Settings::Settings):
12
        * page/Settings.h:
13
        (WebCore::Settings::setDeviceTouchScreen):
14
        (WebCore::Settings::isDeviceTouchScreen):
15
        (Settings):
16
        * platform/chromium/PopupListBox.cpp:
17
        (WebCore::PopupListBox::getRowHeight):
18
        * platform/chromium/PopupListBox.h:
19
        (PopupContainerSettings):
20
        * platform/chromium/PopupMenuChromium.cpp:
21
        (WebCore::PopupMenuChromium::show):
22
1
2012-05-08  Rafael Weinstein  <rafaelw@chromium.org>
23
2012-05-08  Rafael Weinstein  <rafaelw@chromium.org>
2
24
3
        HTMLElementStack::hasOnlyHTMLElementsInScope is no longer called
25
        HTMLElementStack::hasOnlyHTMLElementsInScope is no longer called
- Source/WebCore/page/Settings.cpp +1 lines
Lines 265-270 Settings::Settings(Page* page) Source/WebCore/page/Settings.cpp_sec1
265
    , m_shouldRespectImageOrientation(false)
265
    , m_shouldRespectImageOrientation(false)
266
    , m_wantsBalancedSetDefersLoadingBehavior(false)
266
    , m_wantsBalancedSetDefersLoadingBehavior(false)
267
    , m_requestAnimationFrameEnabled(true)
267
    , m_requestAnimationFrameEnabled(true)
268
    , m_deviceTouchScreen(false)
268
    , m_loadsImagesAutomaticallyTimer(this, &Settings::loadsImagesAutomaticallyTimerFired)
269
    , m_loadsImagesAutomaticallyTimer(this, &Settings::loadsImagesAutomaticallyTimerFired)
269
    , m_incrementalRenderingSuppressionTimeoutInSeconds(defaultIncrementalRenderingSuppressionTimeoutInSeconds)
270
    , m_incrementalRenderingSuppressionTimeoutInSeconds(defaultIncrementalRenderingSuppressionTimeoutInSeconds)
270
{
271
{
- Source/WebCore/page/Settings.h +4 lines
Lines 561-566 namespace WebCore { Source/WebCore/page/Settings.h_sec1
561
        void setRequestAnimationFrameEnabled(bool enabled) { m_requestAnimationFrameEnabled = enabled; }
561
        void setRequestAnimationFrameEnabled(bool enabled) { m_requestAnimationFrameEnabled = enabled; }
562
        bool requestAnimationFrameEnabled() const { return m_requestAnimationFrameEnabled; }
562
        bool requestAnimationFrameEnabled() const { return m_requestAnimationFrameEnabled; }
563
563
564
        void setDeviceTouchScreen(bool enabled) { m_deviceTouchScreen = enabled; }
565
        bool isDeviceTouchScreen() const { return m_deviceTouchScreen; }
566
564
#if USE(JSC)
567
#if USE(JSC)
565
        static void setShouldRespectPriorityInCSSAttributeSetters(bool);
568
        static void setShouldRespectPriorityInCSSAttributeSetters(bool);
566
        static bool shouldRespectPriorityInCSSAttributeSetters();
569
        static bool shouldRespectPriorityInCSSAttributeSetters();
Lines 725-730 namespace WebCore { Source/WebCore/page/Settings.h_sec2
725
        bool m_shouldRespectImageOrientation : 1;
728
        bool m_shouldRespectImageOrientation : 1;
726
        bool m_wantsBalancedSetDefersLoadingBehavior : 1;
729
        bool m_wantsBalancedSetDefersLoadingBehavior : 1;
727
        bool m_requestAnimationFrameEnabled : 1;
730
        bool m_requestAnimationFrameEnabled : 1;
731
        bool m_deviceTouchScreen : 1;
728
732
729
        Timer<Settings> m_loadsImagesAutomaticallyTimer;
733
        Timer<Settings> m_loadsImagesAutomaticallyTimer;
730
        void loadsImagesAutomaticallyTimerFired(Timer<Settings>*);
734
        void loadsImagesAutomaticallyTimerFired(Timer<Settings>*);
- Source/WebCore/platform/chromium/PopupListBox.cpp -1 / +1 lines
Lines 632-638 int PopupListBox::getRowHeight(int index Source/WebCore/platform/chromium/PopupListBox.cpp_sec1
632
{
632
{
633
    int scale = m_settings.defaultDeviceScaleFactor;
633
    int scale = m_settings.defaultDeviceScaleFactor;
634
    int paddingForTouch = 0;
634
    int paddingForTouch = 0;
635
    if (RuntimeEnabledFeatures::touchEnabled())
635
    if (m_settings.isDeviceTouchScreen)
636
        paddingForTouch = PopupMenuChromium::optionPaddingForTouch();
636
        paddingForTouch = PopupMenuChromium::optionPaddingForTouch();
637
    if (index < 0 || m_popupClient->itemStyle(index).isDisplayNone())
637
    if (index < 0 || m_popupClient->itemStyle(index).isDisplayNone())
638
        return PopupMenuChromium::minimumRowHeight() * scale;
638
        return PopupMenuChromium::minimumRowHeight() * scale;
- Source/WebCore/platform/chromium/PopupListBox.h +1 lines
Lines 81-86 struct PopupContainerSettings { Source/WebCore/platform/chromium/PopupListBox.h_sec1
81
    bool restrictWidthOfListBox;
81
    bool restrictWidthOfListBox;
82
82
83
    int defaultDeviceScaleFactor;
83
    int defaultDeviceScaleFactor;
84
    bool isDeviceTouchScreen;
84
};
85
};
85
86
86
// A container for the data for each menu item (e.g. represented by <option>
87
// A container for the data for each menu item (e.g. represented by <option>
- Source/WebCore/platform/chromium/PopupMenuChromium.cpp +2 lines
Lines 74-79 void PopupMenuChromium::show(const IntRe Source/WebCore/platform/chromium/PopupMenuChromium.cpp_sec1
74
            v->frame()->page()->settings()->defaultDeviceScaleFactor();
74
            v->frame()->page()->settings()->defaultDeviceScaleFactor();
75
        if (!popupSettings.defaultDeviceScaleFactor)
75
        if (!popupSettings.defaultDeviceScaleFactor)
76
            popupSettings.defaultDeviceScaleFactor = 1;
76
            popupSettings.defaultDeviceScaleFactor = 1;
77
        popupSettings.isDeviceTouchScreen =
78
            v->frame()->page()->settings()->isDeviceTouchScreen();
77
        p.popup = PopupContainer::create(client(), PopupContainer::Select, popupSettings);
79
        p.popup = PopupContainer::create(client(), PopupContainer::Select, popupSettings);
78
    }
80
    }
79
    p.popup->showInRect(r, v, index);
81
    p.popup->showInRect(r, v, index);
- Source/WebKit/chromium/ChangeLog +22 lines
Lines 1-3 Source/WebKit/chromium/ChangeLog_sec1
1
2012-05-08  Rob Flack  <flackr@chromium.org>
2
3
        [chromium] Only increase size of Combo Box Options when displayed on touch screen.
4
        https://bugs.webkit.org/show_bug.cgi?id=85921
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Adds a flag to set whether the current device is a touch screen, independent of whether touch events are supported and use this for the combo box sizing.
9
10
        * public/WebSettings.h:
11
        * src/WebSettingsImpl.cpp:
12
        (WebKit::WebSettingsImpl::setDeviceTouchScreen):
13
        (WebKit):
14
        * src/WebSettingsImpl.h:
15
        (WebSettingsImpl):
16
        * src/WebViewImpl.cpp:
17
        (WebKit::WebViewImpl::applyAutofillSuggestions):
18
        * tests/PopupMenuTest.cpp:
19
        (WebKit::SelectPopupMenuTest::SetUp):
20
        (WebKit::SelectPopupMenuTest::TearDown):
21
        (SelectPopupMenuTest):
22
1
2012-05-08  W. James MacLean  <wjmaclean@chromium.org>
23
2012-05-08  W. James MacLean  <wjmaclean@chromium.org>
2
24
3
        [chromium] Create LinkHighlightLayerChromium class to provide link-highlight preview animations for GraphicsLayerChromium.
25
        [chromium] Create LinkHighlightLayerChromium class to provide link-highlight preview animations for GraphicsLayerChromium.
- Source/WebKit/chromium/public/WebSettings.h +1 lines
Lines 64-69 public: Source/WebKit/chromium/public/WebSettings.h_sec1
64
    virtual void setMinimumLogicalFontSize(int) = 0;
64
    virtual void setMinimumLogicalFontSize(int) = 0;
65
    virtual void setDefaultDeviceScaleFactor(int) = 0;
65
    virtual void setDefaultDeviceScaleFactor(int) = 0;
66
    virtual void setDefaultTextEncodingName(const WebString&) = 0;
66
    virtual void setDefaultTextEncodingName(const WebString&) = 0;
67
    virtual void setDeviceTouchScreen(bool) = 0;
67
    virtual void setJavaScriptEnabled(bool) = 0;
68
    virtual void setJavaScriptEnabled(bool) = 0;
68
    virtual void setWebSecurityEnabled(bool) = 0;
69
    virtual void setWebSecurityEnabled(bool) = 0;
69
    virtual void setJavaScriptCanOpenWindowsAutomatically(bool) = 0;
70
    virtual void setJavaScriptCanOpenWindowsAutomatically(bool) = 0;
- Source/WebKit/chromium/src/WebSettingsImpl.cpp +5 lines
Lines 114-119 void WebSettingsImpl::setDefaultDeviceSc Source/WebKit/chromium/src/WebSettingsImpl.cpp_sec1
114
    m_settings->setDefaultDeviceScaleFactor(defaultDeviceScaleFactor);
114
    m_settings->setDefaultDeviceScaleFactor(defaultDeviceScaleFactor);
115
}
115
}
116
116
117
void WebSettingsImpl::setDeviceTouchScreen(bool deviceTouchScreen)
118
{
119
    m_settings->setDeviceTouchScreen(deviceTouchScreen);
120
}
121
117
void WebSettingsImpl::setDefaultTextEncodingName(const WebString& encoding)
122
void WebSettingsImpl::setDefaultTextEncodingName(const WebString& encoding)
118
{
123
{
119
    m_settings->setDefaultTextEncodingName((String)encoding);
124
    m_settings->setDefaultTextEncodingName((String)encoding);
- Source/WebKit/chromium/src/WebSettingsImpl.h +1 lines
Lines 56-61 public: Source/WebKit/chromium/src/WebSettingsImpl.h_sec1
56
    virtual void setMinimumLogicalFontSize(int);
56
    virtual void setMinimumLogicalFontSize(int);
57
    virtual void setDefaultDeviceScaleFactor(int);
57
    virtual void setDefaultDeviceScaleFactor(int);
58
    virtual void setDefaultTextEncodingName(const WebString&);
58
    virtual void setDefaultTextEncodingName(const WebString&);
59
    virtual void setDeviceTouchScreen(bool);
59
    virtual void setJavaScriptEnabled(bool);
60
    virtual void setJavaScriptEnabled(bool);
60
    virtual void setWebSecurityEnabled(bool);
61
    virtual void setWebSecurityEnabled(bool);
61
    virtual void setJavaScriptCanOpenWindowsAutomatically(bool);
62
    virtual void setJavaScriptCanOpenWindowsAutomatically(bool);
- Source/WebKit/chromium/src/WebViewImpl.cpp +2 lines
Lines 2792-2797 void WebViewImpl::applyAutofillSuggestio Source/WebKit/chromium/src/WebViewImpl.cpp_sec1
2792
            m_page->settings()->defaultDeviceScaleFactor();
2792
            m_page->settings()->defaultDeviceScaleFactor();
2793
        if (!popupSettings.defaultDeviceScaleFactor)
2793
        if (!popupSettings.defaultDeviceScaleFactor)
2794
            popupSettings.defaultDeviceScaleFactor = 1;
2794
            popupSettings.defaultDeviceScaleFactor = 1;
2795
        popupSettings.isDeviceTouchScreen =
2796
            m_page->settings()->isDeviceTouchScreen();
2795
        m_autofillPopup = PopupContainer::create(m_autofillPopupClient.get(),
2797
        m_autofillPopup = PopupContainer::create(m_autofillPopupClient.get(),
2796
                                                 PopupContainer::Suggestion,
2798
                                                 PopupContainer::Suggestion,
2797
                                                 popupSettings);
2799
                                                 popupSettings);
- Source/WebKit/chromium/tests/PopupMenuTest.cpp -6 / +3 lines
Lines 182-192 public: Source/WebKit/chromium/tests/PopupMenuTest.cpp_sec1
182
protected:
182
protected:
183
    virtual void SetUp()
183
    virtual void SetUp()
184
    {
184
    {
185
        // When touch is enabled, padding is added to option elements
186
        // In these tests, we'll assume touch is disabled.
187
        m_touchWasEnabled = RuntimeEnabledFeatures::touchEnabled();
188
        RuntimeEnabledFeatures::setTouchEnabled(false);
189
        m_webView = static_cast<WebViewImpl*>(WebView::create(&m_webviewClient));
185
        m_webView = static_cast<WebViewImpl*>(WebView::create(&m_webviewClient));
186
        // When a touch screen is present, padding is added to option elements.
187
        // In these tests, we'll assume no touch screen is attached.
188
        m_webView->page()->settings()->setDeviceTouchScreen(false);
190
        m_webView->initializeMainFrame(&m_webFrameClient);
189
        m_webView->initializeMainFrame(&m_webFrameClient);
191
        m_popupMenu = adoptRef(new PopupMenuChromium(&m_popupMenuClient));
190
        m_popupMenu = adoptRef(new PopupMenuChromium(&m_popupMenuClient));
192
    }
191
    }
Lines 196-202 protected: Source/WebKit/chromium/tests/PopupMenuTest.cpp_sec2
196
        m_popupMenu = 0;
195
        m_popupMenu = 0;
197
        m_webView->close();
196
        m_webView->close();
198
        webkit_support::UnregisterAllMockedURLs();
197
        webkit_support::UnregisterAllMockedURLs();
199
        RuntimeEnabledFeatures::setTouchEnabled(m_touchWasEnabled);
200
    }
198
    }
201
199
202
    // Returns true if there currently is a select popup in the WebView.
200
    // Returns true if there currently is a select popup in the WebView.
Lines 284-290 protected: Source/WebKit/chromium/tests/PopupMenuTest.cpp_sec3
284
    TestWebFrameClient m_webFrameClient;
282
    TestWebFrameClient m_webFrameClient;
285
    TestPopupMenuClient m_popupMenuClient;
283
    TestPopupMenuClient m_popupMenuClient;
286
    RefPtr<PopupMenu> m_popupMenu;
284
    RefPtr<PopupMenu> m_popupMenu;
287
    bool m_touchWasEnabled;
288
    std::string baseURL;
285
    std::string baseURL;
289
};
286
};
290
287

Return to Bug 85921