New issue
Advanced search Search tips

Issue 658605 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

slotchange doesn't fire when replacing a single TextNode with another single TextNode (via setting innerHTML)

Reported by fitchmi...@gmail.com, Oct 23 2016

Issue description

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

Steps to reproduce the problem:
1. Load an instance of a web component with a slot element in its shadow DOM. 
2. Attach a slotchange listener to the slot.
3. Set innerHTML on the web component instance to a single line of text.
4. Repeat step (3).
5. Set innerHTML to a multiline string. (notice the difference)

I have created a jsbin example here: https://jsbin.com/xivunad/edit?html,js,console,output
Notice the difference between console output (showing slotchange events) and innerHTML changes rendered to the screen.

What is the expected behavior?
slotchange should fire every time innerHTML is set, including cases when a single line of text (1 TextNode) is being replaced by another single line of text (1 TextNode).

What went wrong?
slotchange only fires consistently when innerHTML is set to multiple lines of text or to text with HTML in it.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 53.0.2785.143  Channel: n/a
OS Version: 
Flash Version: Shockwave Flash 21.0 r0

See discussion here: https://github.com/w3c/webcomponents/issues/592
 
jsbin.xivunad.15.html
1.6 KB View Download

Comment 1 by hayato@chromium.org, Oct 24 2016

Components: -Blink>WebComponents Blink>DOM>ShadowDOM

Comment 2 by hayato@chromium.org, Oct 24 2016

Interesting bug. I doubt that innterHTML passes our normal code path where slotchange is checked.
Let me triage later.

Comment 3 by hayato@chromium.org, Oct 24 2016

Owner: hayato@chromium.org
Status: Assigned (was: Unconfirmed)

Comment 4 by hayato@chromium.org, Nov 28 2016

Labels: -Pri-2 Pri-1

Comment 5 by hayato@chromium.org, Nov 28 2016

Status: Started (was: Assigned)
Project Member

Comment 6 by bugdroid1@chromium.org, Dec 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3bc6c4619f272fb08cb4ca1520b4f20bf2cd9ee8

commit 3bc6c4619f272fb08cb4ca1520b4f20bf2cd9ee8
Author: wangxianzhu <wangxianzhu@chromium.org>
Date: Fri Dec 02 22:14:43 2016

Manually rebaseline some paint/invalidation tests

For  bug 636271 , rebaseline the test to produce new format, but still
keep the failure line in case it's still flaky.

For  bug 658605 , NeedsRebaseline didn't work because of  bug 660580 .
Manually rebaseline it to ensure test coverage.

BUG= 636271 , 658605 

Review-Url: https://codereview.chromium.org/2543073004
Cr-Commit-Position: refs/heads/master@{#436047}

[modify] https://crrev.com/3bc6c4619f272fb08cb4ca1520b4f20bf2cd9ee8/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/3bc6c4619f272fb08cb4ca1520b4f20bf2cd9ee8/third_party/WebKit/LayoutTests/paint/invalidation/flexbox/scrollbars-changed-expected.txt
[modify] https://crrev.com/3bc6c4619f272fb08cb4ca1520b4f20bf2cd9ee8/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/multicol-repaint-expected.txt
[modify] https://crrev.com/3bc6c4619f272fb08cb4ca1520b4f20bf2cd9ee8/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/resize-iframe-text-expected.png
[modify] https://crrev.com/3bc6c4619f272fb08cb4ca1520b4f20bf2cd9ee8/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/resize-iframe-text-expected.txt
[delete] https://crrev.com/c0dc6f499d681885a9fd7bea1aac680e0b8ac716/third_party/WebKit/LayoutTests/platform/mac-mac10.10/paint/invalidation/resize-iframe-text-expected.png
[delete] https://crrev.com/c0dc6f499d681885a9fd7bea1aac680e0b8ac716/third_party/WebKit/LayoutTests/platform/mac-mac10.10/paint/invalidation/resize-iframe-text-expected.txt
[modify] https://crrev.com/3bc6c4619f272fb08cb4ca1520b4f20bf2cd9ee8/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/resize-iframe-text-expected.png
[modify] https://crrev.com/3bc6c4619f272fb08cb4ca1520b4f20bf2cd9ee8/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/resize-iframe-text-expected.txt
[modify] https://crrev.com/3bc6c4619f272fb08cb4ca1520b4f20bf2cd9ee8/third_party/WebKit/LayoutTests/platform/mac-retina/paint/invalidation/resize-iframe-text-expected.png
[modify] https://crrev.com/3bc6c4619f272fb08cb4ca1520b4f20bf2cd9ee8/third_party/WebKit/LayoutTests/platform/mac-retina/paint/invalidation/resize-iframe-text-expected.txt
[modify] https://crrev.com/3bc6c4619f272fb08cb4ca1520b4f20bf2cd9ee8/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/multicol-repaint-expected.txt
[modify] https://crrev.com/3bc6c4619f272fb08cb4ca1520b4f20bf2cd9ee8/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/resize-iframe-text-expected.png
[modify] https://crrev.com/3bc6c4619f272fb08cb4ca1520b4f20bf2cd9ee8/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/resize-iframe-text-expected.txt
[modify] https://crrev.com/3bc6c4619f272fb08cb4ca1520b4f20bf2cd9ee8/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/multicol-repaint-expected.txt
[modify] https://crrev.com/3bc6c4619f272fb08cb4ca1520b4f20bf2cd9ee8/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/resize-iframe-text-expected.png
[modify] https://crrev.com/3bc6c4619f272fb08cb4ca1520b4f20bf2cd9ee8/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/resize-iframe-text-expected.txt

Labels: -OS-Linux
Status: Fixed (was: Started)

Sign in to add a comment