| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 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 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1409 PaintLayer* layer = toLayoutBox(m_layoutObject)->layer(); | 1409 PaintLayer* layer = toLayoutBox(m_layoutObject)->layer(); |
| 1410 | 1410 |
| 1411 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active); | 1411 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active); |
| 1412 HitTestResult hitTestResult = HitTestResult(request, point); | 1412 HitTestResult hitTestResult = HitTestResult(request, point); |
| 1413 layer->hitTest(hitTestResult); | 1413 layer->hitTest(hitTestResult); |
| 1414 if (!hitTestResult.innerNode()) | 1414 if (!hitTestResult.innerNode()) |
| 1415 return 0; | 1415 return 0; |
| 1416 | 1416 |
| 1417 Node* node = hitTestResult.innerNode(); | 1417 Node* node = hitTestResult.innerNode(); |
| 1418 | 1418 |
| 1419 // MediaDocument has a special shadow root for displaying the save button. | |
| 1420 bool allowNodeInShadowTree = node->document().isMediaDocument() && RuntimeEn
abledFeatures::mediaDocumentDownloadButtonEnabled(); | |
| 1421 | |
| 1422 // Allow the hit test to return media control buttons. | |
| 1423 if (node->isInShadowTree() && (!isHTMLInputElement(*node) || !node->isMediaC
ontrolElement()) && !allowNodeInShadowTree) | |
| 1424 node = node->shadowHost(); | |
| 1425 | |
| 1426 if (isHTMLAreaElement(node)) | 1419 if (isHTMLAreaElement(node)) |
| 1427 return accessibilityImageMapHitTest(toHTMLAreaElement(node), point); | 1420 return accessibilityImageMapHitTest(toHTMLAreaElement(node), point); |
| 1428 | 1421 |
| 1429 if (isHTMLOptionElement(node)) | 1422 if (isHTMLOptionElement(node)) |
| 1430 node = toHTMLOptionElement(*node).ownerSelectElement(); | 1423 node = toHTMLOptionElement(*node).ownerSelectElement(); |
| 1431 | 1424 |
| 1432 LayoutObject* obj = node->layoutObject(); | 1425 LayoutObject* obj = node->layoutObject(); |
| 1433 if (!obj) | 1426 if (!obj) |
| 1434 return 0; | 1427 return 0; |
| 1435 | 1428 |
| (...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2477 if (label && label->layoutObject()) { | 2470 if (label && label->layoutObject()) { |
| 2478 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); | 2471 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); |
| 2479 result.unite(labelRect); | 2472 result.unite(labelRect); |
| 2480 } | 2473 } |
| 2481 } | 2474 } |
| 2482 | 2475 |
| 2483 return result; | 2476 return result; |
| 2484 } | 2477 } |
| 2485 | 2478 |
| 2486 } // namespace blink | 2479 } // namespace blink |
| OLD | NEW |