| 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 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 static inline bool inTheSameScope(ShadowRoot* shadowRoot, EventTarget* target) | 41 static inline bool inTheSameScope(ShadowRoot* shadowRoot, EventTarget* target) |
| 42 { | 42 { |
| 43 return target->toNode() && target->toNode()->treeScope()->rootNode() == shad
owRoot; | 43 return target->toNode() && target->toNode()->treeScope()->rootNode() == shad
owRoot; |
| 44 } | 44 } |
| 45 | 45 |
| 46 static inline EventDispatchBehavior determineDispatchBehavior(Event* event, Shad
owRoot* shadowRoot, EventTarget* target) | 46 static inline EventDispatchBehavior determineDispatchBehavior(Event* event, Shad
owRoot* shadowRoot, EventTarget* target) |
| 47 { | 47 { |
| 48 // Video-only full screen is a mode where we use the shadow DOM as an implem
entation | 48 // Video-only full screen is a mode where we use the shadow DOM as an implem
entation |
| 49 // detail that should not be detectable by the web content. | 49 // detail that should not be detectable by the web content. |
| 50 if (Element* element = FullscreenElementStack::currentFullScreenElementFrom(
target->toNode()->document())) { | 50 if (Element* element = FullscreenElementStack::currentFullScreenElementFrom(
&target->toNode()->document())) { |
| 51 // FIXME: We assume that if the full screen element is a media element t
hat it's | 51 // FIXME: We assume that if the full screen element is a media element t
hat it's |
| 52 // the video-only full screen. Both here and elsewhere. But that is prob
ably wrong. | 52 // the video-only full screen. Both here and elsewhere. But that is prob
ably wrong. |
| 53 if (element->isMediaElement() && shadowRoot && shadowRoot->host() == ele
ment) | 53 if (element->isMediaElement() && shadowRoot && shadowRoot->host() == ele
ment) |
| 54 return StayInsideShadowDOM; | 54 return StayInsideShadowDOM; |
| 55 } | 55 } |
| 56 | 56 |
| 57 // WebKit never allowed selectstart event to cross the the shadow DOM bounda
ry. | 57 // WebKit never allowed selectstart event to cross the the shadow DOM bounda
ry. |
| 58 // Changing this breaks existing sites. | 58 // Changing this breaks existing sites. |
| 59 // See https://bugs.webkit.org/show_bug.cgi?id=52195 for details. | 59 // See https://bugs.webkit.org/show_bug.cgi?id=52195 for details. |
| 60 const AtomicString eventType = event->type(); | 60 const AtomicString eventType = event->type(); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 break; | 272 break; |
| 273 } | 273 } |
| 274 scope = scope->parentTreeScope(); | 274 scope = scope->parentTreeScope(); |
| 275 } | 275 } |
| 276 for (Vector<TreeScope*, 32>::iterator iter = parentTreeScopes.begin(); iter
< parentTreeScopes.end(); ++iter) | 276 for (Vector<TreeScope*, 32>::iterator iter = parentTreeScopes.begin(); iter
< parentTreeScopes.end(); ++iter) |
| 277 relatedNodeMap.add(*iter, relatedNode); | 277 relatedNodeMap.add(*iter, relatedNode); |
| 278 return relatedNode; | 278 return relatedNode; |
| 279 } | 279 } |
| 280 | 280 |
| 281 } | 281 } |
| OLD | NEW |