Closed Bug 984220 Opened 10 years ago Closed 10 years ago

Document rules applying to cloned content imported from a different SVG document with <use>

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 265894

People

(Reporter: wandererm, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0 (Beta/Release)
Build ID: 20140224132736

Steps to reproduce:

img, svg {
  opacity: .3;
}

<img src="image.svg">
<svg>
…
</svg>


Actual results:

compared to img, the inline svg looks paler.


Expected results:

They should be rendered in the same appearance.
Could you add a simple testcase?
Flags: needinfo?(wandererm)
Keywords: testcase-wanted
See this page.

http://osdc.tw/2014/news.html

The feed icon beside news block title looks paler in Firefox than in Chrome.
Flags: needinfo?(wandererm)
Keywords: testcase-wanted
Confirm with a screenshot.
The focused windows it's chromium 34, the big window it's firefox 30a2

http://imgur.com/HwEk2OB
Component: Untriaged → Layout: View Rendering
Product: Firefox → Core
OS: Linux → All
Hardware: x86_64 → All
Version: 27 Branch → Trunk
The style on the page styles every "svg" element with opacity 0.3.

The icon is an <svg> which has a <use> which references _another_ <svg>.  Both are styled with opacity 0.3, which means the overall opacity of the content inside the inner <svg> ends up being 0.09, no?
That said, it's not clear to me whether in this case (cross-document <use>) the selector "#news h2 svg" should be applying to the cloned <svg>.  The SVG spec has flip-flopped several times on exactly how styling and <use> interact, and I'm no longer sure what the behavior it specifies for this case is.
Component: Layout: View Rendering → SVG
Summary: Inline SVG opacity rendered different with embeded in img tag → Document rules applying to cloned content imported from a different SVG document with <use>
https://svgwg.org/svg2-draft/struct.html#UseElement says "CSS2 selectors cannot be applied to the (conceptually) cloned DOM tree because its contents are not part of the formal document structure."

We definitely don't seem to be doing that?
Flags: needinfo?(jwatt)
This is probably a version of bug 265894. (See bug 265894 comment 5 in particular, where that bug's current testcase was attached.)
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Flags: needinfo?(jwatt)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: