| 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 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1406 PaintLayer* layer = toLayoutBox(m_layoutObject)->layer(); | 1406 PaintLayer* layer = toLayoutBox(m_layoutObject)->layer(); |
| 1407 | 1407 |
| 1408 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active); | 1408 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active); |
| 1409 HitTestResult hitTestResult = HitTestResult(request, point); | 1409 HitTestResult hitTestResult = HitTestResult(request, point); |
| 1410 layer->hitTest(hitTestResult); | 1410 layer->hitTest(hitTestResult); |
| 1411 if (!hitTestResult.innerNode()) | 1411 if (!hitTestResult.innerNode()) |
| 1412 return 0; | 1412 return 0; |
| 1413 | 1413 |
| 1414 Node* node = hitTestResult.innerNode(); | 1414 Node* node = hitTestResult.innerNode(); |
| 1415 | 1415 |
| 1416 // MediaDocument has a special shadow root for displaying the save button. | |
| 1417 bool allowNodeInShadowTree = node->document().isMediaDocument() && RuntimeEn
abledFeatures::mediaDocumentDownloadButtonEnabled(); | |
| 1418 | |
| 1419 // Allow the hit test to return media control buttons. | |
| 1420 if (node->isInShadowTree() && (!isHTMLInputElement(*node) || !node->isMediaC
ontrolElement()) && !allowNodeInShadowTree) | |
| 1421 node = node->shadowHost(); | |
| 1422 | |
| 1423 if (isHTMLAreaElement(node)) | 1416 if (isHTMLAreaElement(node)) |
| 1424 return accessibilityImageMapHitTest(toHTMLAreaElement(node), point); | 1417 return accessibilityImageMapHitTest(toHTMLAreaElement(node), point); |
| 1425 | 1418 |
| 1426 if (isHTMLOptionElement(node)) | 1419 if (isHTMLOptionElement(node)) |
| 1427 node = toHTMLOptionElement(*node).ownerSelectElement(); | 1420 node = toHTMLOptionElement(*node).ownerSelectElement(); |
| 1428 | 1421 |
| 1429 LayoutObject* obj = node->layoutObject(); | 1422 LayoutObject* obj = node->layoutObject(); |
| 1430 if (!obj) | 1423 if (!obj) |
| 1431 return 0; | 1424 return 0; |
| 1432 | 1425 |
| (...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2474 if (label && label->layoutObject()) { | 2467 if (label && label->layoutObject()) { |
| 2475 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); | 2468 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); |
| 2476 result.unite(labelRect); | 2469 result.unite(labelRect); |
| 2477 } | 2470 } |
| 2478 } | 2471 } |
| 2479 | 2472 |
| 2480 return result; | 2473 return result; |
| 2481 } | 2474 } |
| 2482 | 2475 |
| 2483 } // namespace blink | 2476 } // namespace blink |
| OLD | NEW |