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

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

Issue 1868433002: Rename function names to match the DOM Standard (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 element->setHovered(hovered()); 129 element->setHovered(hovered());
130 } 130 }
131 131
132 bool HTMLLabelElement::isInteractiveContent() const 132 bool HTMLLabelElement::isInteractiveContent() const
133 { 133 {
134 return true; 134 return true;
135 } 135 }
136 136
137 bool HTMLLabelElement::isInInteractiveContent(Node* node) const 137 bool HTMLLabelElement::isInInteractiveContent(Node* node) const
138 { 138 {
139 if (!containsIncludingShadowDOM(node)) 139 if (!isShadowIncludingInclusiveAncestorOf(node))
140 return false; 140 return false;
141 while (node && this != node) { 141 while (node && this != node) {
142 if (node->isHTMLElement() && toHTMLElement(node)->isInteractiveContent() ) 142 if (node->isHTMLElement() && toHTMLElement(node)->isInteractiveContent() )
143 return true; 143 return true;
144 node = node->parentOrShadowHostNode(); 144 node = node->parentOrShadowHostNode();
145 } 145 }
146 return false; 146 return false;
147 } 147 }
148 148
149 void HTMLLabelElement::defaultEventHandler(Event* evt) 149 void HTMLLabelElement::defaultEventHandler(Event* evt)
150 { 150 {
151 if (evt->type() == EventTypeNames::click && !m_processingClick) { 151 if (evt->type() == EventTypeNames::click && !m_processingClick) {
152 RawPtr<HTMLElement> element = control(); 152 RawPtr<HTMLElement> element = control();
153 153
154 // If we can't find a control or if the control received the click 154 // If we can't find a control or if the control received the click
155 // event, then there's no need for us to do anything. 155 // event, then there's no need for us to do anything.
156 if (!element || (evt->target() && element->containsIncludingShadowDOM(ev t->target()->toNode()))) 156 if (!element || (evt->target() && element->isShadowIncludingInclusiveAnc estorOf(evt->target()->toNode())))
157 return; 157 return;
158 158
159 if (evt->target() && isInInteractiveContent(evt->target()->toNode())) 159 if (evt->target() && isInInteractiveContent(evt->target()->toNode()))
160 return; 160 return;
161 161
162 // Behaviour of label element is as follows: 162 // Behaviour of label element is as follows:
163 // - If there is double click, two clicks will be passed to control 163 // - If there is double click, two clicks will be passed to control
164 // element. Control element will *not* be focused. 164 // element. Control element will *not* be focused.
165 // - If there is selection of label element by dragging, no click 165 // - If there is selection of label element by dragging, no click
166 // event is passed. Also, no focus on control element. 166 // event is passed. Also, no focus on control element.
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 if (attributeName == forAttr) { 301 if (attributeName == forAttr) {
302 TreeScope& scope = treeScope(); 302 TreeScope& scope = treeScope();
303 if (scope.shouldCacheLabelsByForAttribute()) 303 if (scope.shouldCacheLabelsByForAttribute())
304 updateLabel(scope, oldValue, attributeValue); 304 updateLabel(scope, oldValue, attributeValue);
305 } 305 }
306 HTMLElement::parseAttribute(attributeName, oldValue, attributeValue); 306 HTMLElement::parseAttribute(attributeName, oldValue, attributeValue);
307 } 307 }
308 } 308 }
309 309
310 } // namespace blink 310 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698