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

RESOLVED DUPLICATE of bug 265894

Status

()

RESOLVED DUPLICATE of bug 265894
5 years ago
a year ago

People

(Reporter: wandererm, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
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.

Comment 1

5 years ago
Could you add a simple testcase?
Flags: needinfo?(wandererm)
Keywords: testcase-wanted
(Reporter)

Comment 2

5 years ago
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)

Updated

5 years ago
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

Updated

5 years ago
Component: Untriaged → Layout: View Rendering
Product: Firefox → Core

Updated

5 years ago
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>
Created attachment 8419429 [details]
Single-document testcase showing the basic behavior difference
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
Last Resolved: 5 years ago
Flags: needinfo?(jwatt)
Resolution: --- → DUPLICATE
Duplicate of bug: 265894
You need to log in before you can comment on or make changes to this bug.