Commit d59609b9 authored by peter@chromium.org's avatar peter@chromium.org
Browse files

Android's mock scrollbars shows up as a difference in layout test results

https://bugs.webkit.org/show_bug.cgi?id=96382

Reviewed by Adam Barth.

Remove the exceptions made for layout tests in Android's scrollbar theme.
This will make our actual scrollbars show up in layout test pixel results,
bringing the tests closer to what we actually ship.

An important difference with other platforms is that scrollbars do not
take any width on Android, they're rendered on top of the content. Therefore
each test that has a visible scrollbar does not just need a new pixel
result, but will also need a new text result. This will be handled as part
of a larger rebaselining process.

Will be exercised by every layout test that has a scrollbar.

* platform/chromium/ScrollbarThemeChromiumAndroid.cpp:
(WebCore::ScrollbarThemeChromiumAndroid::scrollbarThickness):
(WebCore::ScrollbarThemeChromiumAndroid::usesOverlayScrollbars):
(WebCore::ScrollbarThemeChromiumAndroid::hasThumb):
* platform/chromium/ScrollbarThemeChromiumAndroid.h:
(ScrollbarThemeChromiumAndroid):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 951cfccc
2012-09-24 Peter Beverloo <peter@chromium.org>
Android's mock scrollbars shows up as a difference in layout test results
https://bugs.webkit.org/show_bug.cgi?id=96382
Reviewed by Adam Barth.
Remove the exceptions made for layout tests in Android's scrollbar theme.
This will make our actual scrollbars show up in layout test pixel results,
bringing the tests closer to what we actually ship.
An important difference with other platforms is that scrollbars do not
take any width on Android, they're rendered on top of the content. Therefore
each test that has a visible scrollbar does not just need a new pixel
result, but will also need a new text result. This will be handled as part
of a larger rebaselining process.
Will be exercised by every layout test that has a scrollbar.
* platform/chromium/ScrollbarThemeChromiumAndroid.cpp:
(WebCore::ScrollbarThemeChromiumAndroid::scrollbarThickness):
(WebCore::ScrollbarThemeChromiumAndroid::usesOverlayScrollbars):
(WebCore::ScrollbarThemeChromiumAndroid::hasThumb):
* platform/chromium/ScrollbarThemeChromiumAndroid.h:
(ScrollbarThemeChromiumAndroid):
2012-09-24 Sean Wang <Xuewen.Wang@torchmobile.com.cn>
 
[BlackBerry] Basic authentication challenge credentials for stored credentials again after restarting browser
......@@ -26,7 +26,6 @@
#include "config.h"
#include "ScrollbarThemeChromiumAndroid.h"
#include "LayoutTestSupport.h"
#include "PlatformContextSkia.h"
#include "PlatformMouseEvent.h"
#include "PlatformSupport.h"
......@@ -50,21 +49,12 @@ ScrollbarTheme* ScrollbarTheme::nativeTheme()
int ScrollbarThemeChromiumAndroid::scrollbarThickness(ScrollbarControlSize controlSize)
{
if (isRunningLayoutTest()) {
// Match Chromium-Linux for DumpRenderTree, so the layout test results
// can be shared. The width of scrollbar down arrow should equal the
// width of the vertical scrollbar.
IntSize scrollbarSize = PlatformSupport::getThemePartSize(PlatformSupport::PartScrollbarDownArrow);
return scrollbarSize.width();
}
return scrollbarWidth + scrollbarMargin;
}
bool ScrollbarThemeChromiumAndroid::usesOverlayScrollbars() const
{
// In layout test mode, match Chromium-Linux.
return !isRunningLayoutTest();
return true;
}
int ScrollbarThemeChromiumAndroid::thumbPosition(ScrollbarThemeClient* scrollbar)
......@@ -92,8 +82,7 @@ int ScrollbarThemeChromiumAndroid::thumbLength(ScrollbarThemeClient* scrollbar)
bool ScrollbarThemeChromiumAndroid::hasThumb(ScrollbarThemeClient* scrollbar)
{
// In layout test mode, match Chromium-Linux.
return !isRunningLayoutTest();
return true;
}
IntRect ScrollbarThemeChromiumAndroid::backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool)
......@@ -157,12 +146,4 @@ void ScrollbarThemeChromiumAndroid::paintThumb(GraphicsContext* context, Scrollb
fillSmoothEdgedRect(context, thumbRect, Color(128, 128, 128, 128));
}
void ScrollbarThemeChromiumAndroid::paintScrollbarBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar)
{
// Paint black background in DumpRenderTree, otherwise the pixels in the scrollbar area depend
// on their previous state, which makes the dumped result undetermined.
if (isRunningLayoutTest())
context->fillRect(scrollbar->frameRect(), Color::black, ColorSpaceDeviceRGB);
}
} // namespace WebCore
......@@ -46,7 +46,6 @@ public:
virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false);
virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
virtual void paintScrollbarBackground(GraphicsContext*, ScrollbarThemeClient*);
};
} // namespace WebCore
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment