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

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

Issue 2327743002: Rename Node::shadowHost() to Node::ownerShadowHost() (Closed)
Patch Set: fix Created 4 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
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 markerControl->setIdAttribute(ShadowElementNames::detailsMarker()); 58 markerControl->setIdAttribute(ShadowElementNames::detailsMarker());
59 root.appendChild(markerControl); 59 root.appendChild(markerControl);
60 root.appendChild(HTMLContentElement::create(document())); 60 root.appendChild(HTMLContentElement::create(document()));
61 } 61 }
62 62
63 HTMLDetailsElement* HTMLSummaryElement::detailsElement() const 63 HTMLDetailsElement* HTMLSummaryElement::detailsElement() const
64 { 64 {
65 Node* parent = parentNode(); 65 Node* parent = parentNode();
66 if (isHTMLDetailsElement(parent)) 66 if (isHTMLDetailsElement(parent))
67 return toHTMLDetailsElement(parent); 67 return toHTMLDetailsElement(parent);
68 Element* host = shadowHost(); 68 Element* host = ownerShadowHost();
69 if (isHTMLDetailsElement(host)) 69 if (isHTMLDetailsElement(host))
70 return toHTMLDetailsElement(host); 70 return toHTMLDetailsElement(host);
71 return nullptr; 71 return nullptr;
72 } 72 }
73 73
74 Element* HTMLSummaryElement::markerControl() 74 Element* HTMLSummaryElement::markerControl()
75 { 75 {
76 return ensureUserAgentShadowRoot().getElementById(ShadowElementNames::detail sMarker()); 76 return ensureUserAgentShadowRoot().getElementById(ShadowElementNames::detail sMarker());
77 } 77 }
78 78
79 bool HTMLSummaryElement::isMainSummary() const 79 bool HTMLSummaryElement::isMainSummary() const
80 { 80 {
81 if (HTMLDetailsElement* details = detailsElement()) 81 if (HTMLDetailsElement* details = detailsElement())
82 return details->findMainSummary() == this; 82 return details->findMainSummary() == this;
83 83
84 return false; 84 return false;
85 } 85 }
86 86
87 static bool isClickableControl(Node* node) 87 static bool isClickableControl(Node* node)
88 { 88 {
89 if (!node->isElementNode()) 89 if (!node->isElementNode())
90 return false; 90 return false;
91 Element* element = toElement(node); 91 Element* element = toElement(node);
92 if (element->isFormControlElement()) 92 if (element->isFormControlElement())
93 return true; 93 return true;
94 Element* host = element->shadowHost(); 94 Element* host = element->ownerShadowHost();
95 return host && host->isFormControlElement(); 95 return host && host->isFormControlElement();
96 } 96 }
97 97
98 bool HTMLSummaryElement::supportsFocus() const 98 bool HTMLSummaryElement::supportsFocus() const
99 { 99 {
100 return isMainSummary(); 100 return isMainSummary();
101 } 101 }
102 102
103 void HTMLSummaryElement::defaultEventHandler(Event* event) 103 void HTMLSummaryElement::defaultEventHandler(Event* event)
104 { 104 {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 142
143 bool HTMLSummaryElement::willRespondToMouseClickEvents() 143 bool HTMLSummaryElement::willRespondToMouseClickEvents()
144 { 144 {
145 if (isMainSummary() && layoutObject()) 145 if (isMainSummary() && layoutObject())
146 return true; 146 return true;
147 147
148 return HTMLElement::willRespondToMouseClickEvents(); 148 return HTMLElement::willRespondToMouseClickEvents();
149 } 149 }
150 150
151 } // namespace blink 151 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698