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

Side by Side Diff: third_party/WebKit/Source/core/page/AutoscrollController.cpp

Issue 2844593002: Protect against lifecycle updates that delete a layout object for autoscroll (Closed)
Patch Set: none 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights 3 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 6 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 const LayoutBox* layout_object) const { 69 const LayoutBox* layout_object) const {
70 return autoscroll_layout_object_ == layout_object; 70 return autoscroll_layout_object_ == layout_object;
71 } 71 }
72 72
73 void AutoscrollController::StartAutoscrollForSelection( 73 void AutoscrollController::StartAutoscrollForSelection(
74 LayoutObject* layout_object) { 74 LayoutObject* layout_object) {
75 // We don't want to trigger the autoscroll or the middleClickAutoscroll if 75 // We don't want to trigger the autoscroll or the middleClickAutoscroll if
76 // it's already active. 76 // it's already active.
77 if (autoscroll_type_ != kNoAutoscroll) 77 if (autoscroll_type_ != kNoAutoscroll)
78 return; 78 return;
79 if (layout_object)
80 layout_object->GetFrameView()->UpdateAllLifecyclePhasesExceptPaint();
81 LayoutBox* scrollable = LayoutBox::FindAutoscrollable(layout_object); 79 LayoutBox* scrollable = LayoutBox::FindAutoscrollable(layout_object);
82 if (!scrollable) 80 if (!scrollable)
83 scrollable = 81 scrollable =
84 layout_object->IsListBox() ? ToLayoutListBox(layout_object) : nullptr; 82 layout_object->IsListBox() ? ToLayoutListBox(layout_object) : nullptr;
85 if (!scrollable) 83 if (!scrollable)
86 return; 84 return;
87 85
88 pressed_layout_object_ = layout_object && layout_object->IsBox() 86 pressed_layout_object_ = layout_object && layout_object->IsBox()
89 ? ToLayoutBox(layout_object) 87 ? ToLayoutBox(layout_object)
90 : nullptr; 88 : nullptr;
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 } else if (east) { 411 } else if (east) {
414 view->SetCursor(EastPanningCursor()); 412 view->SetCursor(EastPanningCursor());
415 } else if (west) { 413 } else if (west) {
416 view->SetCursor(WestPanningCursor()); 414 view->SetCursor(WestPanningCursor());
417 } else { 415 } else {
418 view->SetCursor(MiddlePanningCursor()); 416 view->SetCursor(MiddlePanningCursor());
419 } 417 }
420 } 418 }
421 419
422 } // namespace blink 420 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698