Summary: | [gdk] Use a GtkLayout for the ScrollView implementation to get real scrollbars | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Holger Freyther <zecke> | ||||||
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | ||||||||
Priority: | P2 | ||||||||
Version: | 523.x (Safari 3) | ||||||||
Hardware: | Mac | ||||||||
OS: | OS X 10.4 | ||||||||
Attachments: |
|
Description
Holger Freyther
2007-05-26 19:02:31 PDT
Created attachment 14745 [details]
Make ScrollView a scrollable view
Without the ChangeLog entries one would see that less lines of code are needed to implement scrollbars properly. Please review, meanwhile I plan to valgrind and search for CodingStyle issues myself as well.
WebCore/ChangeLog | 49 +++++++++
WebCore/platform/ScrollView.h | 12 +-
WebCore/platform/gdk/FrameGdk.cpp | 87 +---------------
WebCore/platform/gdk/ScrollViewGdk.cpp | 147 +++++++++++++---------------
WebCore/platform/gdk/TemporaryLinkStubs.cpp | 8 -
WebCore/platform/gdk/WidgetGdk.cpp | 52 ++++++++-
WebKitTools/ChangeLog | 14 ++
WebKitTools/GdkLauncher/main.cpp | 53 ++++++----
8 files changed, 231 insertions(+), 191 deletions(-)
(In reply to comment #1) > Created an attachment (id=14745) [edit] > Make ScrollView a scrollable view FloatRect ScrollView::visibleContentRect() const { - FloatRect contentRect = FloatRect(m_data->viewportArea); - contentRect.move(m_data->scrollOffset); - return contentRect; + return FloatRect(contentsX(), contentsY(), visibleHeight(), visibleWidth()); } visibleHeight() and visibleWidth() are the wrong way round. Switching them makes the patch work better. I haven't had the opportunity to review it for correctness yet though. (In reply to comment #1) > Created an attachment (id=14745) [edit] > Make ScrollView a scrollable view I noticed that the map area on http://maps.google.com/ does not resize vertically with this patch. (In reply to comment #3) > (In reply to comment #1) > > Created an attachment (id=14745) [edit] > > Make ScrollView a scrollable view > > I noticed that the map area on http://maps.google.com/ does not resize > vertically with this patch. > - gFrame->sendResizeEvent(); + gFrame->view()->adjustViewSize(); Sending the Resize Event is still needed. This seems to fix maps.google.com here. Created attachment 14750 [details]
Make ScrollView a scrollable view
-in GdkLauncher/main.cpp call Frame::sendResizeEvent on viewport resizes.
-Fix the width/height swap spotted by Alp
-There is no need to move the contentsUpdate IntRect. It is correct.
Will this GtkLayout thing work for subframe scrolling, and will it let the view make its own scroll view if it is in the window with other contents? I am not sure how GtkLayout works. (In reply to comment #6) > Will this GtkLayout thing work for subframe scrolling, and will it let the view > make its own scroll view if it is in the window with other contents? I am not > sure how GtkLayout works. > Honest answer is I don't know. But it is unlikely that it will work. Currently the Gdk FrameLoaderClient is returning 0 on the request to create a new Frame. From what I can see is that we only have one FrameView at a time? So the SubFrame's are within the FrameTree of the 'initial'/main Frame? How is the Mac port handling scrolling of SubFrames? Is it using PlatformScrollbar + RenderLayout::setScrollOffsetX,Y for that? Or do you have more than one NSView? Looking forward to chat about this, I will try to understand how the Mac port is doing this. And I don't understand the second part of the question. Do you mean having another ScrollView inside the FrameView? Comment on attachment 14750 [details]
Make ScrollView a scrollable view
r=me
|