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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 2450853005: Don't invoke load algorithm when a media element is moved into a new document.
Patch Set: Created 4 years, 1 month 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 | « third_party/WebKit/LayoutTests/media/video-move-to-new-document.html ('k') | no next file » | 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) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 538
539 removeElementFromDocumentMap(this, &oldDocument); 539 removeElementFromDocumentMap(this, &oldDocument);
540 addElementToDocumentMap(this, &document()); 540 addElementToDocumentMap(this, &document());
541 541
542 // FIXME: This is a temporary fix to prevent this object from causing the 542 // FIXME: This is a temporary fix to prevent this object from causing the
543 // MediaPlayer to dereference LocalFrame and FrameLoader pointers from the 543 // MediaPlayer to dereference LocalFrame and FrameLoader pointers from the
544 // previous document. This restarts the load, as if the src attribute had been 544 // previous document. This restarts the load, as if the src attribute had been
545 // set. A proper fix would provide a mechanism to allow this object to 545 // set. A proper fix would provide a mechanism to allow this object to
546 // refresh the MediaPlayer's LocalFrame and FrameLoader references on document 546 // refresh the MediaPlayer's LocalFrame and FrameLoader references on document
547 // changes so that playback can be resumed properly. 547 // changes so that playback can be resumed properly.
548 m_ignorePreloadNone = false; 548 // m_ignorePreloadNone = false;
549 invokeLoadAlgorithm(); 549 // invokeLoadAlgorithm();
550 550
551 // Decrement the load event delay count on oldDocument now that 551 // Decrement the load event delay count on oldDocument now that
552 // m_webMediaPlayer has been destroyed and there is no risk of dispatching a 552 // m_webMediaPlayer has been destroyed and there is no risk of dispatching a
553 // load event from within the destructor. 553 // load event from within the destructor.
554 oldDocument.decrementLoadEventDelayCount(); 554 oldDocument.decrementLoadEventDelayCount();
555 555
556 ActiveDOMObject::didMoveToNewExecutionContext(&document()); 556 ActiveDOMObject::didMoveToNewExecutionContext(&document());
557 HTMLElement::didMoveToNewDocument(oldDocument); 557 HTMLElement::didMoveToNewDocument(oldDocument);
558 } 558 }
559 559
(...skipping 3527 matching lines...) Expand 10 before | Expand all | Expand 10 after
4087 4087
4088 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() 4088 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect()
4089 const { 4089 const {
4090 IntRect result; 4090 IntRect result;
4091 if (LayoutObject* object = m_element->layoutObject()) 4091 if (LayoutObject* object = m_element->layoutObject())
4092 result = object->absoluteBoundingBoxRect(); 4092 result = object->absoluteBoundingBoxRect();
4093 return result; 4093 return result;
4094 } 4094 }
4095 4095
4096 } // namespace blink 4096 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/media/video-move-to-new-document.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698