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

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

Issue 27183013: Use [ImplementedAs=domWindow] for Document.defaultView() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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/NamedFlow.cpp ('k') | Source/core/dom/custom/CustomElement.cpp » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 2267 matching lines...) Expand 10 before | Expand all | Expand 10 after
2278 2278
2279 if (!document().hasListenerType(Document::DOMSUBTREEMODIFIED_LISTENER)) 2279 if (!document().hasListenerType(Document::DOMSUBTREEMODIFIED_LISTENER))
2280 return; 2280 return;
2281 2281
2282 dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMSubtreeModified , true)); 2282 dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMSubtreeModified , true));
2283 } 2283 }
2284 2284
2285 bool Node::dispatchDOMActivateEvent(int detail, PassRefPtr<Event> underlyingEven t) 2285 bool Node::dispatchDOMActivateEvent(int detail, PassRefPtr<Event> underlyingEven t)
2286 { 2286 {
2287 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); 2287 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
2288 RefPtr<UIEvent> event = UIEvent::create(EventTypeNames::DOMActivate, true, t rue, document().defaultView(), detail); 2288 RefPtr<UIEvent> event = UIEvent::create(EventTypeNames::DOMActivate, true, t rue, document().domWindow(), detail);
2289 event->setUnderlyingEvent(underlyingEvent); 2289 event->setUnderlyingEvent(underlyingEvent);
2290 dispatchScopedEvent(event); 2290 dispatchScopedEvent(event);
2291 return event->defaultHandled(); 2291 return event->defaultHandled();
2292 } 2292 }
2293 2293
2294 bool Node::dispatchKeyEvent(const PlatformKeyboardEvent& event) 2294 bool Node::dispatchKeyEvent(const PlatformKeyboardEvent& event)
2295 { 2295 {
2296 return EventDispatcher::dispatchEvent(this, KeyboardEventDispatchMediator::c reate(KeyboardEvent::create(event, document().defaultView()))); 2296 return EventDispatcher::dispatchEvent(this, KeyboardEventDispatchMediator::c reate(KeyboardEvent::create(event, document().domWindow())));
2297 } 2297 }
2298 2298
2299 bool Node::dispatchMouseEvent(const PlatformMouseEvent& event, const AtomicStrin g& eventType, 2299 bool Node::dispatchMouseEvent(const PlatformMouseEvent& event, const AtomicStrin g& eventType,
2300 int detail, Node* relatedTarget) 2300 int detail, Node* relatedTarget)
2301 { 2301 {
2302 return EventDispatcher::dispatchEvent(this, MouseEventDispatchMediator::crea te(MouseEvent::create(eventType, document().defaultView(), event, detail, relate dTarget))); 2302 return EventDispatcher::dispatchEvent(this, MouseEventDispatchMediator::crea te(MouseEvent::create(eventType, document().domWindow(), event, detail, relatedT arget)));
2303 } 2303 }
2304 2304
2305 bool Node::dispatchGestureEvent(const PlatformGestureEvent& event) 2305 bool Node::dispatchGestureEvent(const PlatformGestureEvent& event)
2306 { 2306 {
2307 RefPtr<GestureEvent> gestureEvent = GestureEvent::create(document().defaultV iew(), event); 2307 RefPtr<GestureEvent> gestureEvent = GestureEvent::create(document().domWindo w(), event);
2308 if (!gestureEvent.get()) 2308 if (!gestureEvent.get())
2309 return false; 2309 return false;
2310 return EventDispatcher::dispatchEvent(this, GestureEventDispatchMediator::cr eate(gestureEvent)); 2310 return EventDispatcher::dispatchEvent(this, GestureEventDispatchMediator::cr eate(gestureEvent));
2311 } 2311 }
2312 2312
2313 bool Node::dispatchTouchEvent(PassRefPtr<TouchEvent> event) 2313 bool Node::dispatchTouchEvent(PassRefPtr<TouchEvent> event)
2314 { 2314 {
2315 return EventDispatcher::dispatchEvent(this, TouchEventDispatchMediator::crea te(event)); 2315 return EventDispatcher::dispatchEvent(this, TouchEventDispatchMediator::crea te(event));
2316 } 2316 }
2317 2317
2318 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve ntOptions eventOptions, SimulatedClickVisualOptions visualOptions) 2318 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve ntOptions eventOptions, SimulatedClickVisualOptions visualOptions)
2319 { 2319 {
2320 EventDispatcher::dispatchSimulatedClick(this, underlyingEvent, eventOptions, visualOptions); 2320 EventDispatcher::dispatchSimulatedClick(this, underlyingEvent, eventOptions, visualOptions);
2321 } 2321 }
2322 2322
2323 bool Node::dispatchBeforeLoadEvent(const String& sourceURL) 2323 bool Node::dispatchBeforeLoadEvent(const String& sourceURL)
2324 { 2324 {
2325 if (!document().hasListenerType(Document::BEFORELOAD_LISTENER)) 2325 if (!document().hasListenerType(Document::BEFORELOAD_LISTENER))
2326 return true; 2326 return true;
2327 2327
2328 RefPtr<Node> protector(this); 2328 RefPtr<Node> protector(this);
2329 RefPtr<BeforeLoadEvent> beforeLoadEvent = BeforeLoadEvent::create(sourceURL) ; 2329 RefPtr<BeforeLoadEvent> beforeLoadEvent = BeforeLoadEvent::create(sourceURL) ;
2330 dispatchEvent(beforeLoadEvent.get()); 2330 dispatchEvent(beforeLoadEvent.get());
2331 return !beforeLoadEvent->defaultPrevented(); 2331 return !beforeLoadEvent->defaultPrevented();
2332 } 2332 }
2333 2333
2334 bool Node::dispatchWheelEvent(const PlatformWheelEvent& event) 2334 bool Node::dispatchWheelEvent(const PlatformWheelEvent& event)
2335 { 2335 {
2336 return EventDispatcher::dispatchEvent(this, WheelEventDispatchMediator::crea te(event, document().defaultView())); 2336 return EventDispatcher::dispatchEvent(this, WheelEventDispatchMediator::crea te(event, document().domWindow()));
2337 } 2337 }
2338 2338
2339 void Node::dispatchChangeEvent() 2339 void Node::dispatchChangeEvent()
2340 { 2340 {
2341 dispatchScopedEvent(Event::createBubble(EventTypeNames::change)); 2341 dispatchScopedEvent(Event::createBubble(EventTypeNames::change));
2342 } 2342 }
2343 2343
2344 void Node::dispatchInputEvent() 2344 void Node::dispatchInputEvent()
2345 { 2345 {
2346 dispatchScopedEvent(Event::createBubble(EventTypeNames::input)); 2346 dispatchScopedEvent(Event::createBubble(EventTypeNames::input));
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
2632 node->showTreeForThis(); 2632 node->showTreeForThis();
2633 } 2633 }
2634 2634
2635 void showNodePath(const WebCore::Node* node) 2635 void showNodePath(const WebCore::Node* node)
2636 { 2636 {
2637 if (node) 2637 if (node)
2638 node->showNodePathForThis(); 2638 node->showNodePathForThis();
2639 } 2639 }
2640 2640
2641 #endif 2641 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/NamedFlow.cpp ('k') | Source/core/dom/custom/CustomElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698