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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 198 |
199 HTMLMapElement* TreeScope::getImageMap(const String& url) const | 199 HTMLMapElement* TreeScope::getImageMap(const String& url) const |
200 { | 200 { |
201 if (url.isNull()) | 201 if (url.isNull()) |
202 return 0; | 202 return 0; |
203 if (!m_imageMapsByName) | 203 if (!m_imageMapsByName) |
204 return 0; | 204 return 0; |
205 size_t hashPos = url.find('#'); | 205 size_t hashPos = url.find('#'); |
206 String name = (hashPos == notFound ? url : url.substring(hashPos + 1)).impl(
); | 206 String name = (hashPos == notFound ? url : url.substring(hashPos + 1)).impl(
); |
207 if (rootNode()->document()->isHTMLDocument()) | 207 if (rootNode()->document()->isHTMLDocument()) |
208 return static_cast<HTMLMapElement*>(m_imageMapsByName->getElementByLower
casedMapName(AtomicString(name.lower()).impl(), this)); | 208 return toHTMLMapElement(m_imageMapsByName->getElementByLowercasedMapName
(AtomicString(name.lower()).impl(), this)); |
209 return static_cast<HTMLMapElement*>(m_imageMapsByName->getElementByMapName(A
tomicString(name).impl(), this)); | 209 return toHTMLMapElement(m_imageMapsByName->getElementByMapName(AtomicString(
name).impl(), this)); |
210 } | 210 } |
211 | 211 |
212 Node* nodeFromPoint(Document* document, int x, int y, LayoutPoint* localPoint) | 212 Node* nodeFromPoint(Document* document, int x, int y, LayoutPoint* localPoint) |
213 { | 213 { |
214 Frame* frame = document->frame(); | 214 Frame* frame = document->frame(); |
215 | 215 |
216 if (!frame) | 216 if (!frame) |
217 return 0; | 217 return 0; |
218 FrameView* frameView = frame->view(); | 218 FrameView* frameView = frame->view(); |
219 if (!frameView) | 219 if (!frameView) |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 result = element; | 506 result = element; |
507 for (ShadowRoot* shadowRoot = element->youngestShadowRoot(); shadowRoot;
shadowRoot = shadowRoot->olderShadowRoot()) { | 507 for (ShadowRoot* shadowRoot = element->youngestShadowRoot(); shadowRoot;
shadowRoot = shadowRoot->olderShadowRoot()) { |
508 if (Element* shadowResult = shadowRoot->getElementByAccessKey(key)) | 508 if (Element* shadowResult = shadowRoot->getElementByAccessKey(key)) |
509 result = shadowResult; | 509 result = shadowResult; |
510 } | 510 } |
511 } | 511 } |
512 return result; | 512 return result; |
513 } | 513 } |
514 | 514 |
515 } // namespace WebCore | 515 } // namespace WebCore |
OLD | NEW |