| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 LayoutObject* HitTestResult::layoutObject() const | 166 LayoutObject* HitTestResult::layoutObject() const |
| 167 { | 167 { |
| 168 return m_innerNode ? m_innerNode->layoutObject() : 0; | 168 return m_innerNode ? m_innerNode->layoutObject() : 0; |
| 169 } | 169 } |
| 170 | 170 |
| 171 void HitTestResult::setToShadowHostIfInUserAgentShadowRoot() | 171 void HitTestResult::setToShadowHostIfInUserAgentShadowRoot() |
| 172 { | 172 { |
| 173 if (Node* node = innerNode()) { | 173 if (Node* node = innerNode()) { |
| 174 if (ShadowRoot* containingShadowRoot = node->containingShadowRoot()) { | 174 if (ShadowRoot* containingShadowRoot = node->containingShadowRoot()) { |
| 175 if (containingShadowRoot->type() == ShadowRootType::UserAgent) | 175 if (containingShadowRoot->type() == ShadowRootType::UserAgent) |
| 176 setInnerNode(node->shadowHost()); | 176 setInnerNode(node->ownerShadowHost()); |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 | 180 |
| 181 HTMLAreaElement* HitTestResult::imageAreaForImage() const | 181 HTMLAreaElement* HitTestResult::imageAreaForImage() const |
| 182 { | 182 { |
| 183 ASSERT(m_innerNode); | 183 ASSERT(m_innerNode); |
| 184 HTMLImageElement* imageElement = nullptr; | 184 HTMLImageElement* imageElement = nullptr; |
| 185 if (isHTMLImageElement(m_innerNode)) { | 185 if (isHTMLImageElement(m_innerNode)) { |
| 186 imageElement = toHTMLImageElement(m_innerNode); | 186 imageElement = toHTMLImageElement(m_innerNode); |
| 187 } else if (m_innerNode->isInShadowTree()) { | 187 } else if (m_innerNode->isInShadowTree()) { |
| 188 if (m_innerNode->containingShadowRoot()->type() == ShadowRootType::UserA
gent) { | 188 if (m_innerNode->containingShadowRoot()->type() == ShadowRootType::UserA
gent) { |
| 189 if (isHTMLImageElement(m_innerNode->shadowHost())) | 189 if (isHTMLImageElement(m_innerNode->ownerShadowHost())) |
| 190 imageElement = toHTMLImageElement(m_innerNode->shadowHost()); | 190 imageElement = toHTMLImageElement(m_innerNode->ownerShadowHost()
); |
| 191 } | 191 } |
| 192 } | 192 } |
| 193 | 193 |
| 194 if (!imageElement || !imageElement->layoutObject() || !imageElement->layoutO
bject()->isBox()) | 194 if (!imageElement || !imageElement->layoutObject() || !imageElement->layoutO
bject()->isBox()) |
| 195 return nullptr; | 195 return nullptr; |
| 196 | 196 |
| 197 HTMLMapElement* map = imageElement->treeScope().getImageMap(imageElement->fa
stGetAttribute(usemapAttr)); | 197 HTMLMapElement* map = imageElement->treeScope().getImageMap(imageElement->fa
stGetAttribute(usemapAttr)); |
| 198 if (!map) | 198 if (!map) |
| 199 return nullptr; | 199 return nullptr; |
| 200 | 200 |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 else if (isHTMLMapElement(m_innerNode)) | 513 else if (isHTMLMapElement(m_innerNode)) |
| 514 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); | 514 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); |
| 515 | 515 |
| 516 if (!imageMapImageElement) | 516 if (!imageMapImageElement) |
| 517 return m_innerNode.get(); | 517 return m_innerNode.get(); |
| 518 | 518 |
| 519 return imageMapImageElement; | 519 return imageMapImageElement; |
| 520 } | 520 } |
| 521 | 521 |
| 522 } // namespace blink | 522 } // namespace blink |
| OLD | NEW |