| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 } else if (m_innerNode->isInShadowTree()) { | 191 } else if (m_innerNode->isInShadowTree()) { |
| 192 if (m_innerNode->containingShadowRoot()->type() == ShadowRootType::UserA
gent) { | 192 if (m_innerNode->containingShadowRoot()->type() == ShadowRootType::UserA
gent) { |
| 193 if (isHTMLImageElement(m_innerNode->shadowHost())) | 193 if (isHTMLImageElement(m_innerNode->shadowHost())) |
| 194 imageElement = toHTMLImageElement(m_innerNode->shadowHost()); | 194 imageElement = toHTMLImageElement(m_innerNode->shadowHost()); |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 | 197 |
| 198 if (!imageElement || !imageElement->layoutObject() || !imageElement->layoutO
bject()->isBox()) | 198 if (!imageElement || !imageElement->layoutObject() || !imageElement->layoutO
bject()->isBox()) |
| 199 return nullptr; | 199 return nullptr; |
| 200 | 200 |
| 201 HTMLMapElement* map = imageElement->treeScope().getImageMap(imageElement->fa
stGetAttribute(usemapAttr)); | 201 HTMLMapElement* map = imageElement->treeScopeOrDocument().getImageMap(imageE
lement->fastGetAttribute(usemapAttr)); |
| 202 if (!map) | 202 if (!map) |
| 203 return nullptr; | 203 return nullptr; |
| 204 | 204 |
| 205 LayoutBox* box = toLayoutBox(imageElement->layoutObject()); | 205 LayoutBox* box = toLayoutBox(imageElement->layoutObject()); |
| 206 LayoutRect contentBox = box->contentBoxRect(); | 206 LayoutRect contentBox = box->contentBoxRect(); |
| 207 float scaleFactor = 1 / box->style()->effectiveZoom(); | 207 float scaleFactor = 1 / box->style()->effectiveZoom(); |
| 208 LayoutPoint location = localPoint(); | 208 LayoutPoint location = localPoint(); |
| 209 location.scale(scaleFactor, scaleFactor); | 209 location.scale(scaleFactor, scaleFactor); |
| 210 | 210 |
| 211 return map->areaForPoint(location, contentBox.size()); | 211 return map->areaForPoint(location, contentBox.size()); |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 else if (isHTMLMapElement(m_innerNode)) | 540 else if (isHTMLMapElement(m_innerNode)) |
| 541 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); | 541 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); |
| 542 | 542 |
| 543 if (!imageMapImageElement) | 543 if (!imageMapImageElement) |
| 544 return m_innerNode.get(); | 544 return m_innerNode.get(); |
| 545 | 545 |
| 546 return imageMapImageElement; | 546 return imageMapImageElement; |
| 547 } | 547 } |
| 548 | 548 |
| 549 } // namespace blink | 549 } // namespace blink |
| OLD | NEW |