[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.4/kdelibs/khtml/html
From:       Maks Orlovich <maksim () kde ! org>
Date:       2010-04-24 19:21:13
Message-ID: 20100424192113.92408AC8A4 () svn ! kde ! org
[Download RAW message or body]

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 <object> 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 <param> 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 <embed> (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) {
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic