| 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 21 matching lines...) Expand all Loading... |
| 32 #include "SVGNames.h" | 32 #include "SVGNames.h" |
| 33 #include "core/dom/FullscreenElementStack.h" | 33 #include "core/dom/FullscreenElementStack.h" |
| 34 #include "core/dom/Touch.h" | 34 #include "core/dom/Touch.h" |
| 35 #include "core/dom/TouchList.h" | 35 #include "core/dom/TouchList.h" |
| 36 #include "core/dom/shadow/InsertionPoint.h" | 36 #include "core/dom/shadow/InsertionPoint.h" |
| 37 #include "core/dom/shadow/ShadowRoot.h" | 37 #include "core/dom/shadow/ShadowRoot.h" |
| 38 #include "core/events/FocusEvent.h" | 38 #include "core/events/FocusEvent.h" |
| 39 #include "core/events/MouseEvent.h" | 39 #include "core/events/MouseEvent.h" |
| 40 #include "core/events/TouchEvent.h" | 40 #include "core/events/TouchEvent.h" |
| 41 #include "core/events/TouchEventContext.h" | 41 #include "core/events/TouchEventContext.h" |
| 42 #include "core/html/HTMLMediaElement.h" |
| 42 #include "core/svg/SVGElementInstance.h" | 43 #include "core/svg/SVGElementInstance.h" |
| 43 #include "core/svg/SVGUseElement.h" | 44 #include "core/svg/SVGUseElement.h" |
| 44 | 45 |
| 45 namespace WebCore { | 46 namespace WebCore { |
| 46 | 47 |
| 47 Node* EventPath::parent(Node* node) | 48 Node* EventPath::parent(Node* node) |
| 48 { | 49 { |
| 49 EventPath eventPath(node); | 50 EventPath eventPath(node); |
| 50 return eventPath.size() > 1 ? eventPath[1].node() : 0; | 51 return eventPath.size() > 1 ? eventPath[1].node() : 0; |
| 51 } | 52 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 79 return target->toNode() && target->toNode()->treeScope().rootNode() == shado
wRoot; | 80 return target->toNode() && target->toNode()->treeScope().rootNode() == shado
wRoot; |
| 80 } | 81 } |
| 81 | 82 |
| 82 static inline EventDispatchBehavior determineDispatchBehavior(Event* event, Shad
owRoot* shadowRoot, EventTarget* target) | 83 static inline EventDispatchBehavior determineDispatchBehavior(Event* event, Shad
owRoot* shadowRoot, EventTarget* target) |
| 83 { | 84 { |
| 84 // Video-only full screen is a mode where we use the shadow DOM as an implem
entation | 85 // 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. | 86 // detail that should not be detectable by the web content. |
| 86 if (Element* element = FullscreenElementStack::currentFullScreenElementFrom(
target->toNode()->document())) { | 87 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 | 88 // 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. | 89 // the video-only full screen. Both here and elsewhere. But that is prob
ably wrong. |
| 89 if (element->isMediaElement() && shadowRoot && shadowRoot->host() == ele
ment) | 90 if (isHTMLMediaElement(*element) && shadowRoot && shadowRoot->host() ==
element) |
| 90 return StayInsideShadowDOM; | 91 return StayInsideShadowDOM; |
| 91 } | 92 } |
| 92 | 93 |
| 93 // WebKit never allowed selectstart event to cross the the shadow DOM bounda
ry. | 94 // WebKit never allowed selectstart event to cross the the shadow DOM bounda
ry. |
| 94 // Changing this breaks existing sites. | 95 // Changing this breaks existing sites. |
| 95 // See https://bugs.webkit.org/show_bug.cgi?id=52195 for details. | 96 // See https://bugs.webkit.org/show_bug.cgi?id=52195 for details. |
| 96 const AtomicString eventType = event->type(); | 97 const AtomicString eventType = event->type(); |
| 97 if (inTheSameScope(shadowRoot, target) | 98 if (inTheSameScope(shadowRoot, target) |
| 98 && (eventType == EventTypeNames::abort | 99 && (eventType == EventTypeNames::abort |
| 99 || eventType == EventTypeNames::change | 100 || eventType == EventTypeNames::change |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 375 |
| 375 #ifndef NDEBUG | 376 #ifndef NDEBUG |
| 376 void EventPath::checkReachability(TreeScope& treeScope, TouchList& touchList) | 377 void EventPath::checkReachability(TreeScope& treeScope, TouchList& touchList) |
| 377 { | 378 { |
| 378 for (size_t i = 0; i < touchList.length(); ++i) | 379 for (size_t i = 0; i < touchList.length(); ++i) |
| 379 ASSERT(touchList.item(i)->target()->toNode()->treeScope().isInclusiveOld
erSiblingShadowRootOrAncestorTreeScopeOf(treeScope)); | 380 ASSERT(touchList.item(i)->target()->toNode()->treeScope().isInclusiveOld
erSiblingShadowRootOrAncestorTreeScopeOf(treeScope)); |
| 380 } | 381 } |
| 381 #endif | 382 #endif |
| 382 | 383 |
| 383 } // namespace | 384 } // namespace |
| OLD | NEW |