OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/glue/dom_operations.h" | 5 #include "webkit/glue/dom_operations.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "base/utf_string_conversions.h" | |
MAD
2012/09/27 20:19:44
Did you try to also remove it from chrome/renderer
| |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAnimationControlle r.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAnimationControlle r.h" |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" |
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h" |
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNodeCollection.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNodeCollection.h" |
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNodeList.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNodeList.h" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
302 return -1; | 303 return -1; |
303 | 304 |
304 WebAnimationController* controller = web_frame->animationController(); | 305 WebAnimationController* controller = web_frame->animationController(); |
305 if (!controller) | 306 if (!controller) |
306 return -1; | 307 return -1; |
307 | 308 |
308 return controller->numberOfActiveAnimations(); | 309 return controller->numberOfActiveAnimations(); |
309 } | 310 } |
310 | 311 |
311 void GetMetaElementsWithAttribute(WebDocument* document, | 312 void GetMetaElementsWithAttribute(WebDocument* document, |
312 const string16& attribute_name, | 313 const char* attribute_name, |
313 const string16& attribute_value, | 314 const char* attribute_value, |
314 std::vector<WebElement>* meta_elements) { | 315 std::vector<WebElement>* meta_elements) { |
315 DCHECK(document); | 316 DCHECK(document); |
316 DCHECK(meta_elements); | 317 DCHECK(meta_elements); |
317 meta_elements->clear(); | 318 meta_elements->clear(); |
318 WebElement head = document->head(); | 319 WebElement head = document->head(); |
319 if (head.isNull() || !head.hasChildNodes()) | 320 if (head.isNull() || !head.hasChildNodes()) |
320 return; | 321 return; |
321 | 322 |
323 string16 attribute_name16(ASCIIToUTF16(attribute_name)); | |
324 | |
322 WebNodeList children = head.childNodes(); | 325 WebNodeList children = head.childNodes(); |
323 for (size_t i = 0; i < children.length(); ++i) { | 326 for (size_t i = 0; i < children.length(); ++i) { |
324 WebNode node = children.item(i); | 327 WebNode node = children.item(i); |
325 if (!node.isElementNode()) | 328 if (!node.isElementNode()) |
326 continue; | 329 continue; |
327 WebElement element = node.to<WebElement>(); | 330 WebElement element = node.to<WebElement>(); |
328 if (!element.hasTagName("meta")) | 331 if (!element.hasTagName("meta")) |
329 continue; | 332 continue; |
330 WebString value = element.getAttribute(attribute_name); | 333 WebString value = element.getAttribute(attribute_name16); |
331 if (value.isNull() || value != attribute_value) | 334 if (value.isNull() || !LowerCaseEqualsASCII(value, attribute_value)) |
332 continue; | 335 continue; |
333 meta_elements->push_back(element); | 336 meta_elements->push_back(element); |
334 } | 337 } |
335 } | 338 } |
336 | 339 |
337 } // webkit_glue | 340 } // webkit_glue |
OLD | NEW |