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

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

Issue 198553002: Use new is*Element() helper functions even more in HTML code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/HTMLDetailsElement.cpp ('k') | Source/core/html/HTMLDocument.cpp » ('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) 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 27 matching lines...) Expand all
38 namespace WebCore { 38 namespace WebCore {
39 39
40 using namespace HTMLNames; 40 using namespace HTMLNames;
41 41
42 // This function chooses the focused element when showModal() is invoked, as des cribed in the spec for showModal(). 42 // This function chooses the focused element when showModal() is invoked, as des cribed in the spec for showModal().
43 static void setFocusForModalDialog(HTMLDialogElement* dialog) 43 static void setFocusForModalDialog(HTMLDialogElement* dialog)
44 { 44 {
45 Element* focusableDescendant = 0; 45 Element* focusableDescendant = 0;
46 Node* next = 0; 46 Node* next = 0;
47 for (Node* node = dialog->firstChild(); node; node = next) { 47 for (Node* node = dialog->firstChild(); node; node = next) {
48 if (node->hasTagName(dialogTag)) 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()) {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 { 199 {
200 if (event->type() == EventTypeNames::cancel) { 200 if (event->type() == EventTypeNames::cancel) {
201 closeDialog(); 201 closeDialog();
202 event->setDefaultHandled(); 202 event->setDefaultHandled();
203 return; 203 return;
204 } 204 }
205 HTMLElement::defaultEventHandler(event); 205 HTMLElement::defaultEventHandler(event);
206 } 206 }
207 207
208 } // namespace WebCore 208 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLDetailsElement.cpp ('k') | Source/core/html/HTMLDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698