| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 ASSERT(document); | 783 ASSERT(document); |
| 784 if (!document->touchEventTargets()) | 784 if (!document->touchEventTargets()) |
| 785 return; | 785 return; |
| 786 | 786 |
| 787 const TouchEventTargetSet* targets = document->touchEventTargets(); | 787 const TouchEventTargetSet* targets = document->touchEventTargets(); |
| 788 | 788 |
| 789 // If there's a handler on the document, html or body element (fairly common
in practice), | 789 // If there's a handler on the document, html or body element (fairly common
in practice), |
| 790 // then we can quickly mark the entire document and skip looking at any othe
r handlers. | 790 // then we can quickly mark the entire document and skip looking at any othe
r handlers. |
| 791 // Note that technically a handler on the body doesn't cover the whole docum
ent, but it's | 791 // Note that technically a handler on the body doesn't cover the whole docum
ent, but it's |
| 792 // reasonable to be conservative and report the whole document anyway. | 792 // reasonable to be conservative and report the whole document anyway. |
| 793 for (TouchEventTargetSet::const_iterator iter = targets->begin(); iter != ta
rgets->end(); ++iter) { | 793 // |
| 794 Node* target = iter->key; | 794 // Fullscreen HTML5 video when OverlayFullscreenVideo is enabled is implemen
ted by replacing the |
| 795 if (target == document || target == document->documentElement() || targe
t == document->body()) { | 795 // root cc::layer with the video layer so doing this optimization causes the
compositor to think |
| 796 if (RenderView* rendererView = document->renderView()) { | 796 // that there are no handlers, therefore skip it. |
| 797 rendererView->computeLayerHitTestRects(rects); | 797 if (!document->renderView()->compositor()->inOverlayFullscreenVideo()) { |
| 798 for (TouchEventTargetSet::const_iterator iter = targets->begin(); iter !
= targets->end(); ++iter) { |
| 799 Node* target = iter->key; |
| 800 if (target == document || target == document->documentElement() || t
arget == document->body()) { |
| 801 if (RenderView* rendererView = document->renderView()) { |
| 802 rendererView->computeLayerHitTestRects(rects); |
| 803 } |
| 804 return; |
| 798 } | 805 } |
| 799 return; | |
| 800 } | 806 } |
| 801 } | 807 } |
| 802 | 808 |
| 803 for (TouchEventTargetSet::const_iterator iter = targets->begin(); iter != ta
rgets->end(); ++iter) { | 809 for (TouchEventTargetSet::const_iterator iter = targets->begin(); iter != ta
rgets->end(); ++iter) { |
| 804 const Node* target = iter->key; | 810 const Node* target = iter->key; |
| 805 if (!target->inDocument()) | 811 if (!target->inDocument()) |
| 806 continue; | 812 continue; |
| 807 | 813 |
| 808 if (target->isDocumentNode()) { | 814 if (target->isDocumentNode() && target != document) { |
| 809 ASSERT(target != document); | |
| 810 accumulateDocumentTouchEventTargetRects(rects, toDocument(target)); | 815 accumulateDocumentTouchEventTargetRects(rects, toDocument(target)); |
| 811 } else if (RenderObject* renderer = target->renderer()) { | 816 } else if (RenderObject* renderer = target->renderer()) { |
| 812 // If the set also contains one of our ancestor nodes then processin
g | 817 // If the set also contains one of our ancestor nodes then processin
g |
| 813 // this node would be redundant. | 818 // this node would be redundant. |
| 814 bool hasTouchEventTargetAncestor = false; | 819 bool hasTouchEventTargetAncestor = false; |
| 815 for (Node* ancestor = target->parentNode(); ancestor && !hasTouchEve
ntTargetAncestor; ancestor = ancestor->parentNode()) { | 820 for (Node* ancestor = target->parentNode(); ancestor && !hasTouchEve
ntTargetAncestor; ancestor = ancestor->parentNode()) { |
| 816 if (targets->contains(ancestor)) | 821 if (targets->contains(ancestor)) |
| 817 hasTouchEventTargetAncestor = true; | 822 hasTouchEventTargetAncestor = true; |
| 818 } | 823 } |
| 819 if (!hasTouchEventTargetAncestor) { | 824 if (!hasTouchEventTargetAncestor) { |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 bool frameIsScrollable = frameView && frameView->isScrollable(); | 982 bool frameIsScrollable = frameView && frameView->isScrollable(); |
| 978 if (frameIsScrollable != m_wasFrameScrollable) | 983 if (frameIsScrollable != m_wasFrameScrollable) |
| 979 return true; | 984 return true; |
| 980 | 985 |
| 981 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : 0) | 986 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : 0) |
| 982 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); | 987 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); |
| 983 return false; | 988 return false; |
| 984 } | 989 } |
| 985 | 990 |
| 986 } // namespace WebCore | 991 } // namespace WebCore |
| OLD | NEW |