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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLSelectElement.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) 2010 Nokia Corporation and/or its subsidiary(-ies). 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
4 * (C) 1999 Antti Koivisto (koivisto@kde.org) 4 * (C) 1999 Antti Koivisto (koivisto@kde.org)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
7 * reserved. 7 * reserved.
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2010 Google Inc. All rights reserved. 9 * Copyright (C) 2010 Google Inc. All rights reserved.
10 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 10 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
(...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after
1511 } 1511 }
1512 1512
1513 } else if (event->type() == EventTypeNames::mousemove && 1513 } else if (event->type() == EventTypeNames::mousemove &&
1514 event->IsMouseEvent()) { 1514 event->IsMouseEvent()) {
1515 MouseEvent* mouse_event = ToMouseEvent(event); 1515 MouseEvent* mouse_event = ToMouseEvent(event);
1516 if (mouse_event->button() != 1516 if (mouse_event->button() !=
1517 static_cast<short>(WebPointerProperties::Button::kLeft) || 1517 static_cast<short>(WebPointerProperties::Button::kLeft) ||
1518 !mouse_event->ButtonDown()) 1518 !mouse_event->ButtonDown())
1519 return; 1519 return;
1520 1520
1521 if (Page* page = GetDocument().GetPage()) 1521 if (LayoutObject* object = GetLayoutObject())
1522 object->GetFrameView()->UpdateAllLifecyclePhasesExceptPaint();
1523
1524 if (Page* page = GetDocument().GetPage()) {
1522 page->GetAutoscrollController().StartAutoscrollForSelection( 1525 page->GetAutoscrollController().StartAutoscrollForSelection(
1523 GetLayoutObject()); 1526 GetLayoutObject());
1527 }
1524 // Mousedown didn't happen in this element. 1528 // Mousedown didn't happen in this element.
1525 if (last_on_change_selection_.IsEmpty()) 1529 if (last_on_change_selection_.IsEmpty())
1526 return; 1530 return;
1527 1531
1528 if (HTMLOptionElement* option = EventTargetOption(*mouse_event)) { 1532 if (HTMLOptionElement* option = EventTargetOption(*mouse_event)) {
1529 if (!IsDisabledFormControl()) { 1533 if (!IsDisabledFormControl()) {
1530 if (is_multiple_) { 1534 if (is_multiple_) {
1531 // Only extend selection if there is something selected. 1535 // Only extend selection if there is something selected.
1532 if (!active_selection_anchor_) 1536 if (!active_selection_anchor_)
1533 return; 1537 return;
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
2055 popup_updater_ = nullptr; 2059 popup_updater_ = nullptr;
2056 } 2060 }
2057 2061
2058 void HTMLSelectElement::DidMutateSubtree() { 2062 void HTMLSelectElement::DidMutateSubtree() {
2059 DCHECK(PopupIsVisible()); 2063 DCHECK(PopupIsVisible());
2060 DCHECK(popup_); 2064 DCHECK(popup_);
2061 popup_->UpdateFromElement(PopupMenu::kByDOMChange); 2065 popup_->UpdateFromElement(PopupMenu::kByDOMChange);
2062 } 2066 }
2063 2067
2064 } // namespace blink 2068 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698