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 // Fullscreen HTML5 video when OverlayFullscreenVideo is enabled is implemen ted by replacing the | |
795 // root cc::layer with the video layer so doing this optimization causes the compositor to think | |
796 // that there are no handlers, therefore skip it. | |
797 for (TouchEventTargetSet::const_iterator iter = targets->begin(); !document- >renderView()->compositor()->inOverlayFullscreenVideo() && iter != targets->end( ); ++iter) { | |
Rick Byers
2014/06/10 20:02:24
rather than check inOverlayFullscreenVideo on each
| |
794 Node* target = iter->key; | 798 Node* target = iter->key; |
795 if (target == document || target == document->documentElement() || targe t == document->body()) { | 799 if (target == document || target == document->documentElement() || targe t == document->body()) { |
796 if (RenderView* rendererView = document->renderView()) { | 800 if (RenderView* rendererView = document->renderView()) { |
797 rendererView->computeLayerHitTestRects(rects); | 801 rendererView->computeLayerHitTestRects(rects); |
798 } | 802 } |
799 return; | 803 return; |
800 } | 804 } |
801 } | 805 } |
802 | 806 |
803 for (TouchEventTargetSet::const_iterator iter = targets->begin(); iter != ta rgets->end(); ++iter) { | 807 for (TouchEventTargetSet::const_iterator iter = targets->begin(); iter != ta rgets->end(); ++iter) { |
804 const Node* target = iter->key; | 808 const Node* target = iter->key; |
805 if (!target->inDocument()) | 809 if (!target->inDocument()) |
806 continue; | 810 continue; |
807 | 811 |
808 if (target->isDocumentNode()) { | 812 if (target->isDocumentNode() && target != document) { |
809 ASSERT(target != document); | |
810 accumulateDocumentTouchEventTargetRects(rects, toDocument(target)); | 813 accumulateDocumentTouchEventTargetRects(rects, toDocument(target)); |
811 } else if (RenderObject* renderer = target->renderer()) { | 814 } else if (RenderObject* renderer = target->renderer()) { |
812 // If the set also contains one of our ancestor nodes then processin g | 815 // If the set also contains one of our ancestor nodes then processin g |
813 // this node would be redundant. | 816 // this node would be redundant. |
814 bool hasTouchEventTargetAncestor = false; | 817 bool hasTouchEventTargetAncestor = false; |
815 for (Node* ancestor = target->parentNode(); ancestor && !hasTouchEve ntTargetAncestor; ancestor = ancestor->parentNode()) { | 818 for (Node* ancestor = target->parentNode(); ancestor && !hasTouchEve ntTargetAncestor; ancestor = ancestor->parentNode()) { |
816 if (targets->contains(ancestor)) | 819 if (targets->contains(ancestor)) |
817 hasTouchEventTargetAncestor = true; | 820 hasTouchEventTargetAncestor = true; |
818 } | 821 } |
819 if (!hasTouchEventTargetAncestor) { | 822 if (!hasTouchEventTargetAncestor) { |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
977 bool frameIsScrollable = frameView && frameView->isScrollable(); | 980 bool frameIsScrollable = frameView && frameView->isScrollable(); |
978 if (frameIsScrollable != m_wasFrameScrollable) | 981 if (frameIsScrollable != m_wasFrameScrollable) |
979 return true; | 982 return true; |
980 | 983 |
981 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0) | 984 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0) |
982 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( ); | 985 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( ); |
983 return false; | 986 return false; |
984 } | 987 } |
985 | 988 |
986 } // namespace WebCore | 989 } // namespace WebCore |
OLD | NEW |