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

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

Issue 852083002: Propagate focus type to plugins (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moved Created 5 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLLabelElement.h ('k') | Source/core/html/HTMLLegendElement.h » ('j') | 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) 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 m_processingClick = true; 176 m_processingClick = true;
177 177
178 document().updateLayoutIgnorePendingStylesheets(); 178 document().updateLayoutIgnorePendingStylesheets();
179 if (element->isMouseFocusable()) { 179 if (element->isMouseFocusable()) {
180 // If the label is *not* selected, or if the click happened on 180 // If the label is *not* selected, or if the click happened on
181 // selection of label, only then focus the control element. 181 // selection of label, only then focus the control element.
182 // In case of double click or triple click, selection will be there, 182 // In case of double click or triple click, selection will be there,
183 // so do not focus the control element. 183 // so do not focus the control element.
184 if (!isLabelTextSelected) 184 if (!isLabelTextSelected)
185 element->focus(true, FocusTypeMouse); 185 element->focus(true, WebFocusTypeMouse);
186 } 186 }
187 187
188 // Click the corresponding control. 188 // Click the corresponding control.
189 element->dispatchSimulatedClick(evt); 189 element->dispatchSimulatedClick(evt);
190 190
191 m_processingClick = false; 191 m_processingClick = false;
192 192
193 evt->setDefaultHandled(); 193 evt->setDefaultHandled();
194 } 194 }
195 195
196 HTMLElement::defaultEventHandler(evt); 196 HTMLElement::defaultEventHandler(evt);
197 } 197 }
198 198
199 bool HTMLLabelElement::willRespondToMouseClickEvents() 199 bool HTMLLabelElement::willRespondToMouseClickEvents()
200 { 200 {
201 if (control() && control()->willRespondToMouseClickEvents()) 201 if (control() && control()->willRespondToMouseClickEvents())
202 return true; 202 return true;
203 203
204 return HTMLElement::willRespondToMouseClickEvents(); 204 return HTMLElement::willRespondToMouseClickEvents();
205 } 205 }
206 206
207 void HTMLLabelElement::focus(bool, FocusType type) 207 void HTMLLabelElement::focus(bool, WebFocusType type)
208 { 208 {
209 // to match other browsers, always restore previous selection 209 // to match other browsers, always restore previous selection
210 if (HTMLElement* element = control()) 210 if (HTMLElement* element = control())
211 element->focus(true, type); 211 element->focus(true, type);
212 if (isFocusable()) 212 if (isFocusable())
213 HTMLElement::focus(true, type); 213 HTMLElement::focus(true, type);
214 } 214 }
215 215
216 void HTMLLabelElement::accessKeyAction(bool sendMouseEvents) 216 void HTMLLabelElement::accessKeyAction(bool sendMouseEvents)
217 { 217 {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 282
283 void HTMLLabelElement::parseAttribute(const QualifiedName& attributeName, const AtomicString& attributeValue) 283 void HTMLLabelElement::parseAttribute(const QualifiedName& attributeName, const AtomicString& attributeValue)
284 { 284 {
285 if (attributeName == formAttr) 285 if (attributeName == formAttr)
286 formAttributeChanged(); 286 formAttributeChanged();
287 else 287 else
288 HTMLElement::parseAttribute(attributeName, attributeValue); 288 HTMLElement::parseAttribute(attributeName, attributeValue);
289 } 289 }
290 290
291 } // namespace 291 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLLabelElement.h ('k') | Source/core/html/HTMLLegendElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698