From kde-commits Sat Apr 24 19:21:13 2010 From: Maks Orlovich Date: Sat, 24 Apr 2010 19:21:13 +0000 To: kde-commits Subject: branches/KDE/4.4/kdelibs/khtml/html Message-Id: <20100424192113.92408AC8A4 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=127213680516059 SVN commit 1118443 by orlovich: Merged revision:r1116645 | orlovich | 2010-04-19 19:55:23 -0400 (Mon, 19 Apr 2010) | 10 lines Some fixes for handling: - Properly attempt part creation when no src set if we have datatype; needed for a part of new youtube skin's probe sequence; for now only kmplayer's nsp support is capable enough for running it though. (khtmlpart's portion also needs some tweaks) - Properly destroy plugin when object removed from document, should fix the 'ghost sound' problem on youtube. M +16 -3 html_objectimpl.cpp --- branches/KDE/4.4/kdelibs/khtml/html/html_objectimpl.cpp #1118442:1118443 @@ -239,13 +239,20 @@ void HTMLObjectBaseElementImpl::removedFromDocument() { document()->underDocNamedCache().remove(m_name, this); - HTMLElementImpl::removedFromDocument(); + + // When removed from document, we destroy the widget/plugin. + // We have to do it here and not just call setNeedComputeContent(), + // since khtml will not try to restyle changed() things not in document. + clearChildWidget(); + + HTMLPartContainerElementImpl::removedFromDocument(); } void HTMLObjectBaseElementImpl::insertedIntoDocument() { document()->underDocNamedCache().add(m_name, this); - HTMLElementImpl::insertedIntoDocument(); + setNeedComputeContent(); + HTMLPartContainerElementImpl::insertedIntoDocument(); } void HTMLObjectBaseElementImpl::removeId(const DOMString& id) @@ -364,6 +371,12 @@ return; } + // Not in document => no plugin. + if (!inDocument()) { + clearChildWidget(); + return; + } + // Collect information from children for ... // It also sometimes supplements or replaces some of the element's attributes for (NodeImpl* child = firstChild(); child; child = child->nextSibling()) { @@ -500,7 +513,7 @@ // If there is no (here or as a child), and we don't have a type + url to go on, // we need to render alternative as well - if (!embed && effectiveURL.isEmpty() && (effectiveServiceType.isEmpty() || classId.isEmpty())) + if (!embed && effectiveURL.isEmpty() && effectiveServiceType.isEmpty()) newRenderAlternative = true; if (newRenderAlternative != m_renderAlternative) {