OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
7 * rights reserved. | 7 * rights reserved. |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
(...skipping 3524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3535 return policy; | 3535 return policy; |
3536 } | 3536 } |
3537 LocalFrame* frame = toLocalFrame(m_frame->tree().parent()); | 3537 LocalFrame* frame = toLocalFrame(m_frame->tree().parent()); |
3538 DCHECK(frame); | 3538 DCHECK(frame); |
3539 return frame->document()->getReferrerPolicy(); | 3539 return frame->document()->getReferrerPolicy(); |
3540 } | 3540 } |
3541 | 3541 |
3542 MouseEventWithHitTestResults Document::performMouseEventHitTest( | 3542 MouseEventWithHitTestResults Document::performMouseEventHitTest( |
3543 const HitTestRequest& request, | 3543 const HitTestRequest& request, |
3544 const LayoutPoint& documentPoint, | 3544 const LayoutPoint& documentPoint, |
3545 const PlatformMouseEvent& event) { | 3545 const WebMouseEvent& event) { |
3546 DCHECK(layoutViewItem().isNull() || layoutViewItem().isLayoutView()); | 3546 DCHECK(layoutViewItem().isNull() || layoutViewItem().isLayoutView()); |
3547 | 3547 |
3548 // LayoutView::hitTest causes a layout, and we don't want to hit that until | 3548 // LayoutView::hitTest causes a layout, and we don't want to hit that until |
3549 // the first layout because until then, there is nothing shown on the screen - | 3549 // the first layout because until then, there is nothing shown on the screen - |
3550 // the user can't have intentionally clicked on something belonging to this | 3550 // the user can't have intentionally clicked on something belonging to this |
3551 // page. Furthermore, mousemove events before the first layout should not | 3551 // page. Furthermore, mousemove events before the first layout should not |
3552 // lead to a premature layout() happening, which could show a flash of white. | 3552 // lead to a premature layout() happening, which could show a flash of white. |
3553 // See also the similar code in EventHandler::hitTestResultAtPoint. | 3553 // See also the similar code in EventHandler::hitTestResultAtPoint. |
3554 if (layoutViewItem().isNull() || !view() || !view()->didFirstLayout()) | 3554 if (layoutViewItem().isNull() || !view() || !view()->didFirstLayout()) |
3555 return MouseEventWithHitTestResults(event, | 3555 return MouseEventWithHitTestResults(event, |
3556 HitTestResult(request, LayoutPoint())); | 3556 HitTestResult(request, LayoutPoint())); |
3557 | 3557 |
3558 HitTestResult result(request, documentPoint); | 3558 HitTestResult result(request, documentPoint); |
3559 layoutViewItem().hitTest(result); | 3559 layoutViewItem().hitTest(result); |
3560 | 3560 |
3561 if (!request.readOnly()) | 3561 if (!request.readOnly()) |
3562 updateHoverActiveState(request, result.innerElement(), result.scrollbar()); | 3562 updateHoverActiveState(request, result.innerElement(), result.scrollbar()); |
3563 | 3563 |
3564 if (isHTMLCanvasElement(result.innerNode())) { | 3564 if (isHTMLCanvasElement(result.innerNode())) { |
3565 PlatformMouseEvent eventWithRegion = event; | |
3566 HitTestCanvasResult* hitTestCanvasResult = | 3565 HitTestCanvasResult* hitTestCanvasResult = |
3567 toHTMLCanvasElement(result.innerNode()) | 3566 toHTMLCanvasElement(result.innerNode()) |
3568 ->getControlAndIdIfHitRegionExists(result.pointInInnerNodeFrame()); | 3567 ->getControlAndIdIfHitRegionExists(result.pointInInnerNodeFrame()); |
3569 if (hitTestCanvasResult->getControl()) { | 3568 if (hitTestCanvasResult->getControl()) { |
3570 result.setInnerNode(hitTestCanvasResult->getControl()); | 3569 result.setInnerNode(hitTestCanvasResult->getControl()); |
3571 } | 3570 } |
3572 eventWithRegion.setRegion(hitTestCanvasResult->getId()); | 3571 result.setCanvasRegionId(hitTestCanvasResult->getId()); |
3573 return MouseEventWithHitTestResults(eventWithRegion, result); | |
3574 } | 3572 } |
3575 | 3573 |
3576 return MouseEventWithHitTestResults(event, result); | 3574 return MouseEventWithHitTestResults(event, result); |
3577 } | 3575 } |
3578 | 3576 |
3579 // DOM Section 1.1.1 | 3577 // DOM Section 1.1.1 |
3580 bool Document::childTypeAllowed(NodeType type) const { | 3578 bool Document::childTypeAllowed(NodeType type) const { |
3581 switch (type) { | 3579 switch (type) { |
3582 case kAttributeNode: | 3580 case kAttributeNode: |
3583 case kCdataSectionNode: | 3581 case kCdataSectionNode: |
(...skipping 2951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6535 } | 6533 } |
6536 | 6534 |
6537 void showLiveDocumentInstances() { | 6535 void showLiveDocumentInstances() { |
6538 WeakDocumentSet& set = liveDocumentSet(); | 6536 WeakDocumentSet& set = liveDocumentSet(); |
6539 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6537 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6540 for (Document* document : set) | 6538 for (Document* document : set) |
6541 fprintf(stderr, "- Document %p URL: %s\n", document, | 6539 fprintf(stderr, "- Document %p URL: %s\n", document, |
6542 document->url().getString().utf8().data()); | 6540 document->url().getString().utf8().data()); |
6543 } | 6541 } |
6544 #endif | 6542 #endif |
OLD | NEW |