Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(643)

Side by Side Diff: Source/core/dom/EventRetargeter.cpp

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/EventPathWalker.cpp ('k') | Source/core/dom/EventTarget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « Source/core/dom/EventPathWalker.cpp ('k') | Source/core/dom/EventTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698