OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
3 * Copyright (C) 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 // as a container. | 312 // as a container. |
313 // See https://bugs.webkit.org/show_bug.cgi?id=82697 | 313 // See https://bugs.webkit.org/show_bug.cgi?id=82697 |
314 m_selection = DOMSelection::create(this); | 314 m_selection = DOMSelection::create(this); |
315 return m_selection.get(); | 315 return m_selection.get(); |
316 } | 316 } |
317 | 317 |
318 Element* TreeScope::findAnchor(const String& name) | 318 Element* TreeScope::findAnchor(const String& name) |
319 { | 319 { |
320 if (name.isEmpty()) | 320 if (name.isEmpty()) |
321 return 0; | 321 return 0; |
322 if (Element* element = getElementById(name)) | 322 if (Element* element = getElementById(AtomicString(name))) |
323 return element; | 323 return element; |
324 ASSERT(rootNode()); | 324 ASSERT(rootNode()); |
325 for (Element* element = ElementTraversal::firstWithin(*rootNode()); element;
element = ElementTraversal::next(*element)) { | 325 for (Element* element = ElementTraversal::firstWithin(*rootNode()); element;
element = ElementTraversal::next(*element)) { |
326 if (element->hasTagName(aTag)) { | 326 if (element->hasTagName(aTag)) { |
327 HTMLAnchorElement* anchor = toHTMLAnchorElement(element); | 327 HTMLAnchorElement* anchor = toHTMLAnchorElement(element); |
328 if (rootNode()->document().inQuirksMode()) { | 328 if (rootNode()->document().inQuirksMode()) { |
329 // Quirks mode, case insensitive comparison of names. | 329 // Quirks mode, case insensitive comparison of names. |
330 if (equalIgnoringCase(anchor->name(), name)) | 330 if (equalIgnoringCase(anchor->name(), name)) |
331 return anchor; | 331 return anchor; |
332 } else { | 332 } else { |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 result = element; | 501 result = element; |
502 for (ShadowRoot* shadowRoot = element->youngestShadowRoot(); shadowRoot;
shadowRoot = shadowRoot->olderShadowRoot()) { | 502 for (ShadowRoot* shadowRoot = element->youngestShadowRoot(); shadowRoot;
shadowRoot = shadowRoot->olderShadowRoot()) { |
503 if (Element* shadowResult = shadowRoot->getElementByAccessKey(key)) | 503 if (Element* shadowResult = shadowRoot->getElementByAccessKey(key)) |
504 result = shadowResult; | 504 result = shadowResult; |
505 } | 505 } |
506 } | 506 } |
507 return result; | 507 return result; |
508 } | 508 } |
509 | 509 |
510 } // namespace WebCore | 510 } // namespace WebCore |
OLD | NEW |