| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 } | 189 } |
| 190 | 190 |
| 191 HTMLMapElement* TreeScope::getImageMap(const String& url) const | 191 HTMLMapElement* TreeScope::getImageMap(const String& url) const |
| 192 { | 192 { |
| 193 if (url.isNull()) | 193 if (url.isNull()) |
| 194 return nullptr; | 194 return nullptr; |
| 195 if (!m_imageMapsByName) | 195 if (!m_imageMapsByName) |
| 196 return nullptr; | 196 return nullptr; |
| 197 size_t hashPos = url.find('#'); | 197 size_t hashPos = url.find('#'); |
| 198 String name = hashPos == kNotFound ? url : url.substring(hashPos + 1); | 198 String name = hashPos == kNotFound ? url : url.substring(hashPos + 1); |
| 199 if (rootNode().document().isHTMLDocument()) | 199 HTMLMapElement* map = toHTMLMapElement(rootNode().document().isHTMLDocument(
) |
| 200 return toHTMLMapElement(m_imageMapsByName->getElementByLowercasedMapName
(AtomicString(name.lower()), this)); | 200 ? m_imageMapsByName->getElementByLowercasedMapName(AtomicString(name.low
er()), this) |
| 201 return toHTMLMapElement(m_imageMapsByName->getElementByMapName(AtomicString(
name), this)); | 201 : m_imageMapsByName->getElementByMapName(AtomicString(name), this)); |
| 202 if (!map || !rootNode().document().isHTMLDocument()) |
| 203 return map; |
| 204 const AtomicString& nameValue = map->fastGetAttribute(nameAttr); |
| 205 if (nameValue.isNull()) |
| 206 return map; |
| 207 String strippedName = nameValue; |
| 208 if (strippedName.startsWith('#')) |
| 209 strippedName = strippedName.substring(1); |
| 210 if (strippedName == name) |
| 211 UseCounter::count(rootNode().document(), UseCounter::MapNameMatchingStri
ct); |
| 212 else if (equalIgnoringASCIICase(strippedName, name)) |
| 213 UseCounter::count(rootNode().document(), UseCounter::MapNameMatchingASCI
ICaseless); |
| 214 else |
| 215 UseCounter::count(rootNode().document(), UseCounter::MapNameMatchingUnic
odeLower); |
| 216 return map; |
| 202 } | 217 } |
| 203 | 218 |
| 204 static bool pointWithScrollAndZoomIfPossible(const Document& document, IntPoint&
point) | 219 static bool pointWithScrollAndZoomIfPossible(const Document& document, IntPoint&
point) |
| 205 { | 220 { |
| 206 LocalFrame* frame = document.frame(); | 221 LocalFrame* frame = document.frame(); |
| 207 if (!frame) | 222 if (!frame) |
| 208 return false; | 223 return false; |
| 209 FrameView* frameView = frame->view(); | 224 FrameView* frameView = frame->view(); |
| 210 if (!frameView) | 225 if (!frameView) |
| 211 return false; | 226 return false; |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 visitor->trace(m_parentTreeScope); | 535 visitor->trace(m_parentTreeScope); |
| 521 visitor->trace(m_idTargetObserverRegistry); | 536 visitor->trace(m_idTargetObserverRegistry); |
| 522 visitor->trace(m_selection); | 537 visitor->trace(m_selection); |
| 523 visitor->trace(m_elementsById); | 538 visitor->trace(m_elementsById); |
| 524 visitor->trace(m_imageMapsByName); | 539 visitor->trace(m_imageMapsByName); |
| 525 visitor->trace(m_scopedStyleResolver); | 540 visitor->trace(m_scopedStyleResolver); |
| 526 visitor->trace(m_radioButtonGroupScope); | 541 visitor->trace(m_radioButtonGroupScope); |
| 527 } | 542 } |
| 528 | 543 |
| 529 } // namespace blink | 544 } // namespace blink |
| OLD | NEW |