OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 static inline bool inTheSameScope(ShadowRoot* shadowRoot, EventTarget* target) | 77 static inline bool inTheSameScope(ShadowRoot* shadowRoot, EventTarget* target) |
78 { | 78 { |
79 return target->toNode() && target->toNode()->treeScope().rootNode() == shado
wRoot; | 79 return target->toNode() && target->toNode()->treeScope().rootNode() == shado
wRoot; |
80 } | 80 } |
81 | 81 |
82 static inline EventDispatchBehavior determineDispatchBehavior(Event* event, Shad
owRoot* shadowRoot, EventTarget* target) | 82 static inline EventDispatchBehavior determineDispatchBehavior(Event* event, Shad
owRoot* shadowRoot, EventTarget* target) |
83 { | 83 { |
84 // Video-only full screen is a mode where we use the shadow DOM as an implem
entation | 84 // Video-only full screen is a mode where we use the shadow DOM as an implem
entation |
85 // detail that should not be detectable by the web content. | 85 // detail that should not be detectable by the web content. |
86 if (Element* element = FullscreenElementStack::currentFullScreenElementFrom(
&target->toNode()->document())) { | 86 if (Element* element = FullscreenElementStack::currentFullScreenElementFrom(
target->toNode()->document())) { |
87 // FIXME: We assume that if the full screen element is a media element t
hat it's | 87 // FIXME: We assume that if the full screen element is a media element t
hat it's |
88 // the video-only full screen. Both here and elsewhere. But that is prob
ably wrong. | 88 // the video-only full screen. Both here and elsewhere. But that is prob
ably wrong. |
89 if (element->isMediaElement() && shadowRoot && shadowRoot->host() == ele
ment) | 89 if (element->isMediaElement() && shadowRoot && shadowRoot->host() == ele
ment) |
90 return StayInsideShadowDOM; | 90 return StayInsideShadowDOM; |
91 } | 91 } |
92 | 92 |
93 // WebKit never allowed selectstart event to cross the the shadow DOM bounda
ry. | 93 // WebKit never allowed selectstart event to cross the the shadow DOM bounda
ry. |
94 // Changing this breaks existing sites. | 94 // Changing this breaks existing sites. |
95 // See https://bugs.webkit.org/show_bug.cgi?id=52195 for details. | 95 // See https://bugs.webkit.org/show_bug.cgi?id=52195 for details. |
96 const AtomicString eventType = event->type(); | 96 const AtomicString eventType = event->type(); |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 368 |
369 #ifndef NDEBUG | 369 #ifndef NDEBUG |
370 void EventPath::checkReachability(TreeScope& treeScope, TouchList& touchList) | 370 void EventPath::checkReachability(TreeScope& treeScope, TouchList& touchList) |
371 { | 371 { |
372 for (size_t i = 0; i < touchList.length(); ++i) | 372 for (size_t i = 0; i < touchList.length(); ++i) |
373 ASSERT(touchList.item(i)->target()->toNode()->treeScope().isInclusiveOld
erSiblingShadowRootOrAncestorTreeScopeOf(treeScope)); | 373 ASSERT(touchList.item(i)->target()->toNode()->treeScope().isInclusiveOld
erSiblingShadowRootOrAncestorTreeScopeOf(treeScope)); |
374 } | 374 } |
375 #endif | 375 #endif |
376 | 376 |
377 } // namespace | 377 } // namespace |
OLD | NEW |