fabriciocs / swfobject

Automatically exported from code.google.com/p/swfobject
0 stars 0 forks source link

CSS Explosion: Each call to embedSWF adds 2 css files to the page #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This may be a feature and may only be an issue in our non-standard use 
case, but I thought I would mention it.  

Background:
Our page is used to create charts.  As the user changes parameters we send 
the parms back via an ajax call to a server that generates a new flash 
version of the chart the user wants.  In the ajax callback we call 
swfobject.embedSWF to load up the new flash file.  Often in these sessions 
a user can load dozens of new charts.  I noticed this when I was looking 
at the css in firebug and saw way more css files than I would have 
expected.  See the attached screenshots.

What steps will reproduce the problem?
1. Make multiple calls to swfobject.embedSWF on the same page
2. Note the css list in firebug or right click on a flash element and 
inspect the dom and note that multiple overridden properties.

What is the expected output? What do you see instead?
SWFObject v1.5 doesn't load any css files and multiple calls does not have 
this issue.

What version of the product are you using? On what operating system?
SWFObject v2.0 rc4 in FireFox.

Please provide any additional information below.
Could you just use inline css to set the styles directly on the objects?  
Or else create two named styles and just set the classes on the objects?

Original issue reported on code.google.com by sbillmas...@gmail.com on 13 Mar 2008 at 3:05

Attachments:

GoogleCodeExporter commented 9 years ago
This is indeed a feature. Because we want to hide elements as quickly as 
possible, we
create a dynamic style sheet to achieve this.

In rc4 we use a dynamic style sheet to set the visibility back to visible again,
however in the next release this will be replaced for a direct manipulation via 
the
element.style attribute.

Currently I am investigating whether we can minimize the dynamic style sheets 
by only
applying them when the DOM hasn't been loaded yet, so it's already in the works 
:-)

Original comment by bobbyvandersluis on 13 Mar 2008 at 3:53

GoogleCodeExporter commented 9 years ago

Original comment by bobbyvandersluis on 14 Mar 2008 at 1:50