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

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

Issue 23496036: Make it possible to focus on 0-size form controls and anchors. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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/HTMLFormControlElement.h ('k') | 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) 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 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 // trigger synchronous layout, so it must not be called during style recalc. 306 // trigger synchronous layout, so it must not be called during style recalc.
307 if (renderer()) 307 if (renderer())
308 queuePostAttachCallback(updateFromElementCallback, this); 308 queuePostAttachCallback(updateFromElementCallback, this);
309 } 309 }
310 310
311 bool HTMLFormControlElement::supportsFocus() const 311 bool HTMLFormControlElement::supportsFocus() const
312 { 312 {
313 return !isDisabledFormControl(); 313 return !isDisabledFormControl();
314 } 314 }
315 315
316 bool HTMLFormControlElement::rendererIsFocusable() const
317 {
318 // If there's a renderer, make sure the size isn't empty, but if there's no renderer,
319 // it might still be focusable if it's in a canvas subtree (handled in Eleme nt::rendererIsFocusable).
320 if (renderer() && (!renderer()->isBox() || toRenderBox(renderer())->size().i sEmpty()))
321 return false;
322 return HTMLElement::rendererIsFocusable();
323 }
324
325 bool HTMLFormControlElement::isKeyboardFocusable() const 316 bool HTMLFormControlElement::isKeyboardFocusable() const
326 { 317 {
327 // Skip tabIndex check in a parent class. 318 // Skip tabIndex check in a parent class.
328 return isFocusable(); 319 return isFocusable();
329 } 320 }
330 321
331 bool HTMLFormControlElement::shouldShowFocusRingOnMouseFocus() const 322 bool HTMLFormControlElement::shouldShowFocusRingOnMouseFocus() const
332 { 323 {
333 return false; 324 return false;
334 } 325 }
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 HTMLFormControlElement* HTMLFormControlElement::enclosingFormControlElement(Node * node) 486 HTMLFormControlElement* HTMLFormControlElement::enclosingFormControlElement(Node * node)
496 { 487 {
497 for (; node; node = node->parentNode()) { 488 for (; node; node = node->parentNode()) {
498 if (node->isElementNode() && toElement(node)->isFormControlElement()) 489 if (node->isElementNode() && toElement(node)->isFormControlElement())
499 return toHTMLFormControlElement(node); 490 return toHTMLFormControlElement(node);
500 } 491 }
501 return 0; 492 return 0;
502 } 493 }
503 494
504 } // namespace Webcore 495 } // namespace Webcore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLFormControlElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698