[webkit-dev] Scroll bars in DumpRenderTree snapshots
Avi Drissman
avi at google.com
Tue Sep 8 08:00:14 PDT 2009
As you might know, on the Chromium project we're adapted DumpRenderTree into
our TestShell, and we use it to dump layout test snapshots and do pixel
tests.
Well, we run pixel tests on Linux and Windows, but we don't do it on the Mac
(yet). And that's because we'd like to compare to the baseline images that
Safari uses because a) it eases maintenance for us, b) it's better for web
developers if they can rely on the same rendering in Chromium and Safari,
and c) I can't think of any more right now, but it should be pretty obvious
that it's a Good Thing.
The problem we keep hitting is scrollbars. When we draw scrollbars, we're
consistently drawing the thumb ~20px too long. I've been looking at this,
comparing our version of WebCore to the stock version of WebKit to compare
the values passed into the drawing code.
I took as an example LayoutTests/css1/basic/inheritance.html. For that case,
ScrollbarThemeMac turns a scrollbar with values visible size = 600, total
size = 724 into:
scrollbar size: 15x585 (we lose 15px to the growbox)
min: 0
max: 124
viewsize: 560 (visible size of 600 - cAmountToKeepWhenPaging; see
ScrollView::updateScrollbars)
OK. I then loaded DumpRenderTree into GDB, and breakpointed in
ScrollbarThemeMac.mm. But it wouldn't hit. Nor would breakpoints in
Scrollbar.cpp or ScrollView.cpp. In desperation I breakpointed on
HIThemeDrawTrack. And that didn't hit either.
What *did* hit was -[NSScroller drawRect:] at this damning backtrace:
#0 0x96143759 in -[NSScroller drawRect:]
#1 0x9605fbf8 in -[NSView _drawRect:clip:]
#2 0x9605e6ef in -[NSView
_recursiveDisplayAllDirtyWithLockFocus:visRect:]
#3 0x9605ea86 in -[NSView
_recursiveDisplayAllDirtyWithLockFocus:visRect:]
#4 0x9605ea86 in -[NSView
_recursiveDisplayAllDirtyWithLockFocus:visRect:]
#5 0x9605ea86 in -[NSView
_recursiveDisplayAllDirtyWithLockFocus:visRect:]
#6 0x9605ea86 in -[NSView
_recursiveDisplayAllDirtyWithLockFocus:visRect:]
#7 0x9605ea86 in -[NSView
_recursiveDisplayAllDirtyWithLockFocus:visRect:]
#8 0x9605d045 in -[NSView
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#9 0x96145385 in -[NSNextStepFrame
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#10 0x960594ab in -[NSView
_displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
#11 0x95f99e7b in -[NSView displayIfNeeded]
#12 0x00011ab4 in -[FrameLoadDelegate webView:didFinishLoadForFrame:] at
FrameLoadDelegate.mm:207
That explained things but seriously confused me as well. I thought WebCore
had moved away from using Cocoa for scrolling. In the xcodeproj files you
clearly are including ScrollbarThemeMac.
Any thoughts on what's going on?
Avi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090908/a08e1d8a/attachment.html>
More information about the webkit-dev
mailing list