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

Side by Side Diff: Source/core/html/HTMLPlugInElement.cpp

Issue 212893005: Revert "Change event handling order in HTMLPlugInElement." (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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
« no previous file with comments | « Source/core/html/HTMLPlugInElement.h ('k') | Source/web/WebPluginContainerImpl.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) 2000 Stefan Schimanski (1Stein@gmx.de) 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de)
5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. 5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 } else if (name == hspaceAttr) { 271 } else if (name == hspaceAttr) {
272 addHTMLLengthToStyle(style, CSSPropertyMarginLeft, value); 272 addHTMLLengthToStyle(style, CSSPropertyMarginLeft, value);
273 addHTMLLengthToStyle(style, CSSPropertyMarginRight, value); 273 addHTMLLengthToStyle(style, CSSPropertyMarginRight, value);
274 } else if (name == alignAttr) { 274 } else if (name == alignAttr) {
275 applyAlignmentAttributeToStyle(value, style); 275 applyAlignmentAttributeToStyle(value, style);
276 } else { 276 } else {
277 HTMLFrameOwnerElement::collectStyleForPresentationAttribute(name, value, style); 277 HTMLFrameOwnerElement::collectStyleForPresentationAttribute(name, value, style);
278 } 278 }
279 } 279 }
280 280
281 void HTMLPlugInElement::handleLocalEvents(Event* event) 281 void HTMLPlugInElement::defaultEventHandler(Event* event)
282 { 282 {
283 HTMLFrameOwnerElement::handleLocalEvents(event);
284
285 // Firefox seems to use a fake event listener to dispatch events to plug-in 283 // Firefox seems to use a fake event listener to dispatch events to plug-in
286 // (tested with mouse events only). This is observable via different order 284 // (tested with mouse events only). This is observable via different order
287 // of events - in Firefox, event listeners specified in HTML attributes 285 // of events - in Firefox, event listeners specified in HTML attributes
288 // fires first, then an event gets dispatched to plug-in, and only then 286 // fires first, then an event gets dispatched to plug-in, and only then
289 // other event listeners fire. Hopefully, this difference does not matter in 287 // other event listeners fire. Hopefully, this difference does not matter in
290 // practice. 288 // practice.
289
290 // FIXME: Mouse down and scroll events are passed down to plug-in via custom
291 // code in EventHandler; these code paths should be united.
292
291 RenderObject* r = renderer(); 293 RenderObject* r = renderer();
292 if (!r || !r->isWidget()) 294 if (!r || !r->isWidget())
293 return; 295 return;
294 if (r->isEmbeddedObject()) { 296 if (r->isEmbeddedObject()) {
295 if (toRenderEmbeddedObject(r)->showsUnavailablePluginIndicator()) 297 if (toRenderEmbeddedObject(r)->showsUnavailablePluginIndicator())
296 return; 298 return;
297 if (displayState() < Playing) 299 if (displayState() < Playing)
298 return; 300 return;
299 } 301 }
300 RefPtr<Widget> widget = toRenderWidget(r)->widget(); 302 RefPtr<Widget> widget = toRenderWidget(r)->widget();
301 if (!widget) 303 if (!widget)
302 return; 304 return;
303 widget->handleEvent(event); 305 widget->handleEvent(event);
306 if (event->defaultHandled())
307 return;
308 HTMLFrameOwnerElement::defaultEventHandler(event);
304 } 309 }
305 310
306 RenderWidget* HTMLPlugInElement::renderWidgetForJSBindings() const 311 RenderWidget* HTMLPlugInElement::renderWidgetForJSBindings() const
307 { 312 {
308 // Needs to load the plugin immediatedly because this function is called 313 // Needs to load the plugin immediatedly because this function is called
309 // when JavaScript code accesses the plugin. 314 // when JavaScript code accesses the plugin.
310 // FIXME: Check if dispatching events here is safe. 315 // FIXME: Check if dispatching events here is safe.
311 document().updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasks Synchronously); 316 document().updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasks Synchronously);
312 return existingRenderWidget(); 317 return existingRenderWidget();
313 } 318 }
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 if (root.isOldestAuthorShadowRoot()) 529 if (root.isOldestAuthorShadowRoot())
525 lazyReattachIfAttached(); 530 lazyReattachIfAttached();
526 } 531 }
527 532
528 bool HTMLPlugInElement::useFallbackContent() const 533 bool HTMLPlugInElement::useFallbackContent() const
529 { 534 {
530 return hasAuthorShadowRoot(); 535 return hasAuthorShadowRoot();
531 } 536 }
532 537
533 } 538 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLPlugInElement.h ('k') | Source/web/WebPluginContainerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698