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

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

Issue 2630693002: Make ScriptController inherit LocalWindowProxyManager
Patch Set: rebase 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
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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights
5 * reserved. 5 * reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 // -------------------------------------------------------------------------- 147 // --------------------------------------------------------------------------
148 // not part of the DOM 148 // not part of the DOM
149 // -------------------------------------------------------------------------- 149 // --------------------------------------------------------------------------
150 150
151 void HTMLDocument::addItemToMap(HashCountedSet<AtomicString>& map, 151 void HTMLDocument::addItemToMap(HashCountedSet<AtomicString>& map,
152 const AtomicString& name) { 152 const AtomicString& name) {
153 if (name.isEmpty()) 153 if (name.isEmpty())
154 return; 154 return;
155 map.add(name); 155 map.add(name);
156 if (LocalFrame* f = frame()) { 156 if (LocalFrame* f = frame()) {
157 f->script() 157 f->script().namedItemAdded(this, name);
158 .windowProxy(DOMWrapperWorld::mainWorld())
159 ->namedItemAdded(this, name);
160 } 158 }
161 } 159 }
162 160
163 void HTMLDocument::removeItemFromMap(HashCountedSet<AtomicString>& map, 161 void HTMLDocument::removeItemFromMap(HashCountedSet<AtomicString>& map,
164 const AtomicString& name) { 162 const AtomicString& name) {
165 if (name.isEmpty()) 163 if (name.isEmpty())
166 return; 164 return;
167 map.remove(name); 165 map.remove(name);
168 if (LocalFrame* f = frame()) { 166 if (LocalFrame* f = frame()) {
169 f->script() 167 f->script().namedItemRemoved(this, name);
170 .windowProxy(DOMWrapperWorld::mainWorld())
171 ->namedItemRemoved(this, name);
172 } 168 }
173 } 169 }
174 170
175 void HTMLDocument::addNamedItem(const AtomicString& name) { 171 void HTMLDocument::addNamedItem(const AtomicString& name) {
176 addItemToMap(m_namedItemCounts, name); 172 addItemToMap(m_namedItemCounts, name);
177 } 173 }
178 174
179 void HTMLDocument::removeNamedItem(const AtomicString& name) { 175 void HTMLDocument::removeNamedItem(const AtomicString& name) {
180 removeItemFromMap(m_namedItemCounts, name); 176 removeItemFromMap(m_namedItemCounts, name);
181 } 177 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 static HashSet<StringImpl*>* htmlCaseInsensitiveAttributesSet = 216 static HashSet<StringImpl*>* htmlCaseInsensitiveAttributesSet =
221 createHtmlCaseInsensitiveAttributesSet(); 217 createHtmlCaseInsensitiveAttributesSet();
222 bool isPossibleHTMLAttr = 218 bool isPossibleHTMLAttr =
223 !attributeName.hasPrefix() && (attributeName.namespaceURI() == nullAtom); 219 !attributeName.hasPrefix() && (attributeName.namespaceURI() == nullAtom);
224 return !isPossibleHTMLAttr || 220 return !isPossibleHTMLAttr ||
225 !htmlCaseInsensitiveAttributesSet->contains( 221 !htmlCaseInsensitiveAttributesSet->contains(
226 attributeName.localName().impl()); 222 attributeName.localName().impl());
227 } 223 }
228 224
229 } // namespace blink 225 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/Window.idl ('k') | third_party/WebKit/Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698