New issue
Advanced search Search tips

Issue 627736 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Double background images when temporarily inserting block-level content in a span

Reported by peter.kr...@mathjax.org, Jul 13 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36

Example URL:
http://codepen.io/pkra/pen/mEqwAz

Steps to reproduce the problem:
Look at the minimal example or:

1. Create a span and give it a background-image
2. inject an hr and trigger reflow (reflow is important!)
3. remove the hr
4. notice that the duplicate background persist.

What is the expected behavior?
The background image should not be duplicated.

What went wrong?
The background image was duplicated.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? No 

Does this work in other browsers? No WebKit-based browsers (e.g., Safari 9)

Chrome version: 51.0.2704.106  Channel: stable
OS Version: Ubuntu 16.04
Flash Version: Shockwave Flash 22.0 r0

This does not happen on Firefox or IE9+/Edge.
 
Components: -Blink Blink>Paint
Owner: schenney@chromium.org
Status: Assigned (was: Unconfirmed)
This might be a CSS or layout bug. I'll dig deeper.
Cc: schenney@chromium.org
Components: -Blink>Paint Blink>Layout
Labels: -OS-Linux OS-All
Owner: ----
Status: Untriaged (was: Assigned)
If you just run the "inject an hr" portion you get a result that differs from Firefox. We draw the background image for both sub-sections of the span (interrupted by the hr) while Firefox only draws it for the end of the span. Safari matches us, which is not surprising since this behavior probably hasn't changed since the WebKit days.

Now clearly we should not do something different for the same content just because it was mutated and then un-mutated. My guess is that we are modifying the layout tree in response to the <hr> and then not reverting it when the hr is removed, and that the modification in question copies the CSS to the 2 sub-portions of the span.

While superficially it seems like background image seems like it shouldn't be copied if it's not repeated, what do you do about center center positioned backgrounds? Turns out Firefox does something I would never expect and can't even figure out how to implement. Open the attached file to see.

For now I'm calling this a layout bug. We should end up in the same state when the hr is added and removed.


background-image-disappears-on-remove.html
642 bytes View Download
background-image-disappears-on-remove-original.html
626 bytes View Download

Comment 4 by e...@chromium.org, Jul 14 2016

Status: Available (was: Untriaged)
Project Member

Comment 5 by sheriffbot@chromium.org, Jul 17 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 6 by e...@chromium.org, Jul 27 2017

Cc: ikilpatrick@chromium.org
Status: Available (was: Untriaged)
Project Member

Comment 7 by sheriffbot@chromium.org, Jul 30

Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)
Still repros, both in legacy and NG.

Sign in to add a comment