Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm

Issue 2868783006: Re-add delay to PostTask in StartScrollbarPaintTimer() (Closed)
Patch Set: add comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 // page cache, and 1026 // page cache, and
1027 // a relayout will happen on its own. Otherwise, we must initiate a re-layout 1027 // a relayout will happen on its own. Otherwise, we must initiate a re-layout
1028 // ourselves. 1028 // ourselves.
1029 if (!needs_scroller_style_update_) 1029 if (!needs_scroller_style_update_)
1030 GetScrollableArea()->ScrollbarStyleChanged(); 1030 GetScrollableArea()->ScrollbarStyleChanged();
1031 1031
1032 needs_scroller_style_update_ = false; 1032 needs_scroller_style_update_ = false;
1033 } 1033 }
1034 1034
1035 void ScrollAnimatorMac::StartScrollbarPaintTimer() { 1035 void ScrollAnimatorMac::StartScrollbarPaintTimer() {
1036 initial_scrollbar_paint_task_handle_ = task_runner_->PostCancellableTask( 1036 // Post a task with 1 ms delay to give a chance to run other immediate tasks
1037 BLINK_FROM_HERE, WTF::Bind(&ScrollAnimatorMac::InitialScrollbarPaintTask, 1037 // that may cancel this.
1038 WrapWeakPersistent(this))); 1038 initial_scrollbar_paint_task_handle_ =
1039 task_runner_->PostDelayedCancellableTask(
1040 BLINK_FROM_HERE,
1041 WTF::Bind(&ScrollAnimatorMac::InitialScrollbarPaintTask,
1042 WrapWeakPersistent(this)),
1043 1);
1039 } 1044 }
1040 1045
1041 bool ScrollAnimatorMac::ScrollbarPaintTimerIsActive() const { 1046 bool ScrollAnimatorMac::ScrollbarPaintTimerIsActive() const {
1042 return initial_scrollbar_paint_task_handle_.IsActive(); 1047 return initial_scrollbar_paint_task_handle_.IsActive();
1043 } 1048 }
1044 1049
1045 void ScrollAnimatorMac::StopScrollbarPaintTimer() { 1050 void ScrollAnimatorMac::StopScrollbarPaintTimer() {
1046 initial_scrollbar_paint_task_handle_.Cancel(); 1051 initial_scrollbar_paint_task_handle_.Cancel();
1047 } 1052 }
1048 1053
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 rect_in_view_coordinates = 1088 rect_in_view_coordinates =
1084 vertical_scrollbar->ConvertToContainingFrameViewBase(scroller_thumb); 1089 vertical_scrollbar->ConvertToContainingFrameViewBase(scroller_thumb);
1085 1090
1086 if (rect_in_view_coordinates == visible_scroller_thumb_rect_) 1091 if (rect_in_view_coordinates == visible_scroller_thumb_rect_)
1087 return; 1092 return;
1088 1093
1089 visible_scroller_thumb_rect_ = rect_in_view_coordinates; 1094 visible_scroller_thumb_rect_ = rect_in_view_coordinates;
1090 } 1095 }
1091 1096
1092 } // namespace blink 1097 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698