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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLLabelElement.cpp

Issue 2708703003: Expand FrameSeleciton::isRange() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-21T23:48:22 rebase Created 3 years, 10 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // If the click is not simulated and the text of the label element 161 // If the click is not simulated and the text of the label element
162 // is selected by dragging over it, then return without passing the 162 // is selected by dragging over it, then return without passing the
163 // click event to control element. 163 // click event to control element.
164 // Note: check if it is a MouseEvent because a click event may 164 // Note: check if it is a MouseEvent because a click event may
165 // not be an instance of a MouseEvent if created by document.createEvent(). 165 // not be an instance of a MouseEvent if created by document.createEvent().
166 if (evt->isMouseEvent() && toMouseEvent(evt)->hasPosition()) { 166 if (evt->isMouseEvent() && toMouseEvent(evt)->hasPosition()) {
167 if (LocalFrame* frame = document().frame()) { 167 if (LocalFrame* frame = document().frame()) {
168 // Check if there is a selection and click is not on the 168 // Check if there is a selection and click is not on the
169 // selection. 169 // selection.
170 if (layoutObject() && layoutObject()->isSelectable() && 170 if (layoutObject() && layoutObject()->isSelectable() &&
171 frame->selection().isRange() && 171 frame->selection()
172 .computeVisibleSelectionInDOMTreeDeprecated()
173 .isRange() &&
172 !frame->eventHandler() 174 !frame->eventHandler()
173 .selectionController() 175 .selectionController()
174 .mouseDownWasSingleClickInSelection()) 176 .mouseDownWasSingleClickInSelection())
175 isLabelTextSelected = true; 177 isLabelTextSelected = true;
176 // If selection is there and is single click i.e. text is 178 // If selection is there and is single click i.e. text is
177 // selected by dragging over label text, then return. 179 // selected by dragging over label text, then return.
178 // Click count >=2, meaning double click or triple click, 180 // Click count >=2, meaning double click or triple click,
179 // should pass click event to control element. 181 // should pass click event to control element.
180 // Only in case of drag, *neither* we pass the click event, 182 // Only in case of drag, *neither* we pass the click event,
181 // *nor* we focus the control element. 183 // *nor* we focus the control element.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 } 230 }
229 231
230 void HTMLLabelElement::accessKeyAction(bool sendMouseEvents) { 232 void HTMLLabelElement::accessKeyAction(bool sendMouseEvents) {
231 if (HTMLElement* element = control()) 233 if (HTMLElement* element = control())
232 element->accessKeyAction(sendMouseEvents); 234 element->accessKeyAction(sendMouseEvents);
233 else 235 else
234 HTMLElement::accessKeyAction(sendMouseEvents); 236 HTMLElement::accessKeyAction(sendMouseEvents);
235 } 237 }
236 238
237 } // namespace blink 239 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.cpp ('k') | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698