Embedded object not loaded when "display:none" style property is added
my application (on linux desktop for now) is based on Qt 4.8 and displays a web page using the Webview object. I also have an NPAPI plug-in to handle objects like
Everything works fine and my plug-in gets called to create such objects as expected until I add
to the object tag, in which case it seems that the object is not loaded at all and the browser doesn't call my plug-in.
At http://www.w3schools.com/jsref/prop_style_display.asp it is said "display:none hides an element, and it will not take up any space. The element will be hidden, and the page will be displayed as if the element is not there", therefore I would expect my plug-in to be called for the creation of the object. Is my understanding correct?
Is there a bug or it is the expected behaviour?
I try this code in QT5.2:
var doc = document, s = "http://www.w3schools.com/html/bookmark.swf?"+(new Date().getTime());
'<object id="a1" width="400" height="40"'+
'<param name="SRC" value="'+s+'">'+
'<embed src="'+s+'" width="400" height="40"></embed>'+
worked perfectly equal in Firefox and Chrome.
Hi Guilherme, could you explain your example code? All I can see is that the display property is set to block after 5 seconds. My problem seems to be the browser does not load an object (or the plug in is not invoked) when display:none. How is your example related to this?
My code need test with WebInspector, you will see that the plugins only carry after 5 seconds (use the WebInspector in QWebView/Chrome/Safari and Firebug in Firefox).
far we have tested the plugins work the same way in GoogleChrome, Firefox, Safari and QWebView.
Best you put an example to make it easier to understand the situation in which failure happens.
With some delay I managed to go back to this issue. To better explain my problem, I copied the example at:
I added a print at the beginning of
@QObject *CSVFactory::create(const QString &mimeType, const QUrl &url,
const QStringList &argumentNames,
const QStringList &argumentValues) const
qDebug() << "CSVFactory::createm mimeType: " << mimeType;
To be able to detect on console when the browser loads the plugin.
My index.html looks like this:
<object id = "plugin"
document.getElementById("msg1").textContent = "Display is set to block";
This should prove that the plugin object is not loaded unless visible, which doesn't seem to be what w3c specifies, as display:none should only hide the object.
I hope my question is now clearer and somebody will be able to answer it.