| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 HTMLImageElement* imageElement = nullptr; | 159 HTMLImageElement* imageElement = nullptr; |
| 160 if (isHTMLImageElement(m_innerNode)) { | 160 if (isHTMLImageElement(m_innerNode)) { |
| 161 imageElement = toHTMLImageElement(m_innerNode); | 161 imageElement = toHTMLImageElement(m_innerNode); |
| 162 } else if (m_innerNode->isInShadowTree()) { | 162 } else if (m_innerNode->isInShadowTree()) { |
| 163 if (m_innerNode->containingShadowRoot()->type() == ShadowRoot::UserAgent
ShadowRoot) { | 163 if (m_innerNode->containingShadowRoot()->type() == ShadowRoot::UserAgent
ShadowRoot) { |
| 164 if (isHTMLImageElement(m_innerNode->shadowHost())) | 164 if (isHTMLImageElement(m_innerNode->shadowHost())) |
| 165 imageElement = toHTMLImageElement(m_innerNode->shadowHost()); | 165 imageElement = toHTMLImageElement(m_innerNode->shadowHost()); |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 | 168 |
| 169 if (!imageElement || !imageElement->layoutObject()) | 169 if (!imageElement || !imageElement->layoutObject() || !imageElement->layoutO
bject()->isBox()) |
| 170 return nullptr; | 170 return nullptr; |
| 171 | 171 |
| 172 HTMLMapElement* map = imageElement->treeScope().getImageMap(imageElement->fa
stGetAttribute(usemapAttr)); | 172 HTMLMapElement* map = imageElement->treeScope().getImageMap(imageElement->fa
stGetAttribute(usemapAttr)); |
| 173 if (!map) | 173 if (!map) |
| 174 return nullptr; | 174 return nullptr; |
| 175 | 175 |
| 176 LayoutBox* box = toLayoutBox(imageElement->layoutObject()); | 176 LayoutBox* box = toLayoutBox(imageElement->layoutObject()); |
| 177 LayoutRect contentBox = box->contentBoxRect(); | 177 LayoutRect contentBox = box->contentBoxRect(); |
| 178 float scaleFactor = 1 / box->style()->effectiveZoom(); | 178 float scaleFactor = 1 / box->style()->effectiveZoom(); |
| 179 LayoutPoint location = localPoint(); | 179 LayoutPoint location = localPoint(); |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 else if (isHTMLMapElement(m_innerNode)) | 509 else if (isHTMLMapElement(m_innerNode)) |
| 510 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); | 510 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); |
| 511 | 511 |
| 512 if (!imageMapImageElement) | 512 if (!imageMapImageElement) |
| 513 return m_innerNode.get(); | 513 return m_innerNode.get(); |
| 514 | 514 |
| 515 return imageMapImageElement; | 515 return imageMapImageElement; |
| 516 } | 516 } |
| 517 | 517 |
| 518 } // namespace blink | 518 } // namespace blink |
| OLD | NEW |