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

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

Issue 2644693003: SUMMARY element: click() for invisible SUMMARY should toggle DETAILS element. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/html/summary-invisible-click.html ('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) 2011 Nokia Corporation and/or its subsidiary(-ies) 2 * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 return true; 91 return true;
92 Element* host = element->ownerShadowHost(); 92 Element* host = element->ownerShadowHost();
93 return host && host->isFormControlElement(); 93 return host && host->isFormControlElement();
94 } 94 }
95 95
96 bool HTMLSummaryElement::supportsFocus() const { 96 bool HTMLSummaryElement::supportsFocus() const {
97 return isMainSummary(); 97 return isMainSummary();
98 } 98 }
99 99
100 void HTMLSummaryElement::defaultEventHandler(Event* event) { 100 void HTMLSummaryElement::defaultEventHandler(Event* event) {
101 if (isMainSummary() && layoutObject()) { 101 if (isMainSummary()) {
102 if (event->type() == EventTypeNames::DOMActivate && 102 if (event->type() == EventTypeNames::DOMActivate &&
103 !isClickableControl(event->target()->toNode())) { 103 !isClickableControl(event->target()->toNode())) {
104 if (HTMLDetailsElement* details = detailsElement()) 104 if (HTMLDetailsElement* details = detailsElement())
105 details->toggleOpen(); 105 details->toggleOpen();
106 event->setDefaultHandled(); 106 event->setDefaultHandled();
107 return; 107 return;
108 } 108 }
109 109
110 if (event->isKeyboardEvent()) { 110 if (event->isKeyboardEvent()) {
111 if (event->type() == EventTypeNames::keydown && 111 if (event->type() == EventTypeNames::keydown &&
(...skipping 21 matching lines...) Expand all
133 event->setDefaultHandled(); 133 event->setDefaultHandled();
134 return; 134 return;
135 } 135 }
136 } 136 }
137 } 137 }
138 138
139 HTMLElement::defaultEventHandler(event); 139 HTMLElement::defaultEventHandler(event);
140 } 140 }
141 141
142 bool HTMLSummaryElement::willRespondToMouseClickEvents() { 142 bool HTMLSummaryElement::willRespondToMouseClickEvents() {
143 if (isMainSummary() && layoutObject()) 143 return isMainSummary() || HTMLElement::willRespondToMouseClickEvents();
144 return true;
145
146 return HTMLElement::willRespondToMouseClickEvents();
147 } 144 }
148 145
149 } // namespace blink 146 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/html/summary-invisible-click.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698