summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-14 18:34:31 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-14 18:34:31 +0000
commita5f9bded7d8d8ff47ba62507c188106dba40229c (patch)
tree038102ae0060c7106fae7fef12087539e43f7e68
parentdafa99a9ee99fd8ca6b584ec0d8327fa22ccf32b (diff)
downloadchromium_src-a5f9bded7d8d8ff47ba62507c188106dba40229c.zip
chromium_src-a5f9bded7d8d8ff47ba62507c188106dba40229c.tar.gz
chromium_src-a5f9bded7d8d8ff47ba62507c188106dba40229c.tar.bz2
Linux: don't drop invalid scroll requests.
When performing an anchor jump, WebKit will send a scroll request with an invalid scroll magnitude (greater than the size of the window). We must still process the paint request attached however. BUG=10494 http://codereview.chromium.org/67132 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13682 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/renderer_host/backing_store_x.cc38
1 files changed, 18 insertions, 20 deletions
diff --git a/chrome/browser/renderer_host/backing_store_x.cc b/chrome/browser/renderer_host/backing_store_x.cc
index f9212f0..a4b53c3 100644
--- a/chrome/browser/renderer_host/backing_store_x.cc
+++ b/chrome/browser/renderer_host/backing_store_x.cc
@@ -240,28 +240,26 @@ void BackingStore::ScrollRect(base::ProcessHandle process,
if (dy) {
// Positive values of |dy| scroll up
- if (abs(dy) >= clip_rect.height())
- return;
-
- XCopyArea(display_, pixmap_, pixmap_, static_cast<GC>(pixmap_gc_),
- clip_rect.x() /* source x */,
- std::max(clip_rect.y(), clip_rect.y() - dy),
- clip_rect.width(),
- clip_rect.height() - abs(dy),
- clip_rect.x() /* dest x */,
- std::max(clip_rect.y(), clip_rect.y() + dy) /* dest y */);
+ if (abs(dy) < clip_rect.height()) {
+ XCopyArea(display_, pixmap_, pixmap_, static_cast<GC>(pixmap_gc_),
+ clip_rect.x() /* source x */,
+ std::max(clip_rect.y(), clip_rect.y() - dy),
+ clip_rect.width(),
+ clip_rect.height() - abs(dy),
+ clip_rect.x() /* dest x */,
+ std::max(clip_rect.y(), clip_rect.y() + dy) /* dest y */);
+ }
} else if (dx) {
// Positive values of |dx| scroll right
- if (abs(dx) >= clip_rect.width())
- return;
-
- XCopyArea(display_, pixmap_, pixmap_, static_cast<GC>(pixmap_gc_),
- std::max(clip_rect.x(), clip_rect.x() - dx),
- clip_rect.y() /* source y */,
- clip_rect.width() - abs(dx),
- clip_rect.height(),
- std::max(clip_rect.x(), clip_rect.x() + dx) /* dest x */,
- clip_rect.y() /* dest x */);
+ if (abs(dx) < clip_rect.width()) {
+ XCopyArea(display_, pixmap_, pixmap_, static_cast<GC>(pixmap_gc_),
+ std::max(clip_rect.x(), clip_rect.x() - dx),
+ clip_rect.y() /* source y */,
+ clip_rect.width() - abs(dx),
+ clip_rect.height(),
+ std::max(clip_rect.x(), clip_rect.x() + dx) /* dest x */,
+ clip_rect.y() /* dest x */);
+ }
}
PaintRect(process, bitmap, bitmap_rect);