| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 if (isHTMLDialogElement(*node)) | 48 if (isHTMLDialogElement(*node)) |
| 49 next = NodeTraversal::nextSkippingChildren(*node, dialog); | 49 next = NodeTraversal::nextSkippingChildren(*node, dialog); |
| 50 else | 50 else |
| 51 next = NodeTraversal::next(*node, dialog); | 51 next = NodeTraversal::next(*node, dialog); |
| 52 | 52 |
| 53 if (!node->isElementNode()) | 53 if (!node->isElementNode()) |
| 54 continue; | 54 continue; |
| 55 Element* element = toElement(node); | 55 Element* element = toElement(node); |
| 56 if (element->isFormControlElement()) { | 56 if (element->isFormControlElement()) { |
| 57 HTMLFormControlElement* control = toHTMLFormControlElement(node); | 57 HTMLFormControlElement* control = toHTMLFormControlElement(node); |
| 58 if (control->isAutofocusable()) { | 58 if (control->isAutofocusable() && control->isFocusable()) { |
| 59 control->focus(); | 59 control->focus(); |
| 60 return; | 60 return; |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 if (!focusableDescendant && element->isFocusable()) | 63 if (!focusableDescendant && element->isFocusable()) |
| 64 focusableDescendant = element; | 64 focusableDescendant = element; |
| 65 } | 65 } |
| 66 | 66 |
| 67 if (focusableDescendant) { | 67 if (focusableDescendant) { |
| 68 focusableDescendant->focus(); | 68 focusableDescendant->focus(); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 { | 201 { |
| 202 if (event->type() == EventTypeNames::cancel) { | 202 if (event->type() == EventTypeNames::cancel) { |
| 203 closeDialog(); | 203 closeDialog(); |
| 204 event->setDefaultHandled(); | 204 event->setDefaultHandled(); |
| 205 return; | 205 return; |
| 206 } | 206 } |
| 207 HTMLElement::defaultEventHandler(event); | 207 HTMLElement::defaultEventHandler(event); |
| 208 } | 208 } |
| 209 | 209 |
| 210 } // namespace blink | 210 } // namespace blink |
| OLD | NEW |