I think the title is false, because it's not just a problem of default background. Even if I set a background color to my svg object, the background is still white (where in firefox 3.5 the background color is applied)
I have a xhtml page, with the svg included this way :
<object id='module_txt_1' style='z-index:10; position: absolute; top:0px; left:0px; background:red;' type='image/svg+xml' data='../accueil/module.svg'></object>
http://v1.xeolia.com/webkit_pb.png
#16
Matthieu that would be a separate bug, which may be dependent on this one.
You would need to check if the bug exists, and if not file a new one.
this bug relates to many types of object including java, svg etc....
it's not svg specific.
#17
In fact I think it's more like the 17744 bug, which has been merged with this bug... I will reopen it, I've tested the object tag in safari with another type (not svg) and everything was fine
Whole lotta arguing about which bug this is or isn't a duplicate of, and not a whole lot of people doing anything but closing all of them repeatedly for 4 years straight. Which one is the officially recognized bug?
updated reduced testcase, as broken...
#15 Jonathan,
I have widened the scope to all, as tested by me today nightly on intel leopard fails
#19 NSD,
I recognise your enthusiasm, however please bear in mind that its generally not helpful to add complaints as comments, they usually make it harder for coders to understand the issue. It is not uncommon for bugs to remain open for years.
this bug relates to the default background of the html <object> being transparent, not white.
other bugs that are not dupes, naturally differ in their descriptions.
Created attachment 68095[details]
Patch to make SVG documents embedded using <object>, <embed> have transparent backgrounds.
I'm not sure if it's correct for all object/embed frames to have a transparent background, so the attached patch only fixes this problem for SVG documents (HTML documents are already transparent). Note that this does not fix Bug 27078, which fails because the MIME type is not served as SVG in that test.
Do we need a pixel test for this? I'll need to re-learn how to do that...
Comment on attachment 68095[details]
Patch to make SVG documents embedded using <object>, <embed> have transparent backgrounds.
Looks good, but needs a pixel test and a ChangeLog etry.
Created attachment 68181[details]
This patch makes all backgrounds of SVG files served by reference in object, embed and iframes transparent.
This patch adds a test and fixes the case shown in Bug 27078 (a text/xml document with a SVG root).
Adding some Renderer guys to look at this patch as well. I'm not happy about the SVGNames include, but I guess we don't want to generalize the code to make background transparent for all document roots.
Comment on attachment 68181[details]
This patch makes all backgrounds of SVG files served by reference in object, embed and iframes transparent.
SVGNames::svgTag includes the SVG namespace, so you don't need to do that extra comparison. Other than that looks fine to me.
Comment on attachment 68181[details]
This patch makes all backgrounds of SVG files served by reference in object, embed and iframes transparent.
Actually I do have a good suggestion to make. I think you could add a method to Document to answer the question of whether or not you are an SVG document or have a document element that is <svg>. That would at least get the SVGNames stuff out of RenderBoxModelObject. You could make the Document method return a sane value even when SVG is not enabled. Then all the SVG-specific stuff could be in Document.
I liked your suggestion. The first question to answer is: If a document is served with MIME type text/xml, but it has a <svg> document root - is it a SVG Document?
If so, then it really seems that DOMImplementation::createDocument() should be modified so that, if it's an XML document but it parses out with a <svg> root, we should create a SVGDocument (and destroy the Document?). Any tips on the best way to do this without parsing the document twice?
The other option is to change isSVGDocument() to be similar to how isXHTMLDocument() is done, where a member bool can be set in the case of a Document parsing out with a <svg> root. The thing I'm worried about is returning true for isSVGDocument() and not actually _being_ a SVGDocument.
The final option is to just add a isDocumentRootSVG() function to Document() and return true when it's a <svg>. Is this what you're really suggesting? Just seems odd to have both functions returning different values...
FYI, I checked out the Document object at https://bug-10687-attachments.webkit.org/attachment.cgi?id=68238 for various browsers. Remember, this is a text/xml that happens to have a <svg> root:
WebKit: Document (not a SVGDocument)
Mozilla: Document (not a SVGDocument)
IE9: Document (not a SVGDocument)
Opera: SVGDocument
Created attachment 68511[details]
Patch for making SVG documents and XML documents with SVG root transparent when embedded by reference.
This addresses krit's and dhyatt's concern of including SVGNames in RenderBoxModelObject. This patch introduces Document::hasSVGRootNode() that can be used to determine if we are a SVG document or a XML document with a <svg> root.
Comment on attachment 68511[details]
Patch for making SVG documents and XML documents with SVG root transparent when embedded by reference.
View in context: https://bugs.webkit.org/attachment.cgi?id=68511&action=review> WebCore/dom/Document.cpp:2171
> +#endif
I don't think you need to cache this information. Asking if the documentElement() has the SVG tag name every time is fine. It's a quick check (it's AtomicString comparisons, which are very fast).
If you do still want to cache it, a better place would be in cacheDocumentElement().
> WebCore/dom/Document.h:388
> + virtual bool hasSVGRootNode() const { return m_hasSVGRootNode; }
I don't think this needs to be virtual, since the same check that works for non-SVG documents (checking the root node) should also work for SVG documents. It's faster to just do the root node tag check than it is to call a virtual function.
> WebCore/svg/SVGDocument.h:55
> + virtual bool hasSVGRootNode() const { return true; }
Just remove this.
Attachment 68556[details] did not pass style-queue:
Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
WebCore/dom/Document.h:388: Tab found; better to use spaces [whitespace/tab] [1]
WebCore/dom/Document.cpp:4030: Place brace on its own line for function definitions. [whitespace/braces] [4]
Total errors found: 2 in 8 files
If any of these errors are false positives, please file a bug against check-webkit-style.
2006-09-02 01:32 PDT, jay
2006-09-02 01:40 PDT, jay
2010-01-04 03:31 PST, jay
2010-09-20 08:00 PDT, Jeff Schiller
2010-09-20 09:22 PDT, Jeff Schiller
2010-09-20 20:44 PDT, Jeff Schiller
2010-09-21 07:26 PDT, Jeff Schiller
2010-09-23 06:50 PDT, Jeff Schiller
2010-09-23 12:00 PDT, Jeff Schiller
2010-09-23 12:17 PDT, Jeff Schiller