New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 793728 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 1
Type: Bug

Blocking:
issue 788610
issue 787717



Sign in to add a comment

Converting UA shadows to use V1 needs non-standard mechanism for pulling host children

Project Member Reported by kochi@chromium.org, Dec 11 2017

Issue description

Blink's user-agent shadow roots use Shadow DOM V0 machinery,
especially <content> element.

It is used by elements
- to pull all the host's children (e.g. <marquee>)
- to pull some of the host's children (e.g. <details> pulls
  only the first <summary> in its children, or <select> pulls
  only <option>, <optgroup>, <hr>)
- to pull the rest of children that are not pulled for the other
  children (<details> pulls non-first <summary> elements for the
  "detail" contents)

Even for <details> element, V0 APIs are not sufficient to implement
the speced behavior, and its own special element filter for it.

We need to have mechanism that fullfills the above requirements
for convert UA shadows to V1.
 

Comment 1 by kochi@chromium.org, Dec 11 2017

Blocking: 787717

Comment 2 by kochi@chromium.org, Dec 11 2017

Blocking: 788610

Comment 3 by kochi@chromium.org, Dec 14 2017

Design doc:
https://goo.gl/Rcw1Nt

CL (and also convert <summary> and <details>)
https://chromium-review.googlesource.com/c/chromium/src/+/817716
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 11 2018

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

commit 56f2d861c19897381a5ad3bf1db19bf9a8fdac6a
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Thu Jan 11 17:02:27 2018

Convert V0 UA shadow in <summary> and <details> to V1

This CL introduces basis for the rest of elements that use
V0 UA shadow to be converted to V1 UA shadow, and uses it
for converting <summary> and <details>.

For V1 UA shadow root, we don't use the normal slot assignment
mechanism for V1 shadow roots, but use assignment filter, which
is similar to what we had internally for <details> element.
Design doc: https://goo.gl/Rcw1Nt

Convert <details> and <summary> to use V1 UA shadow root
will cover the use cases of <slot> usage in V1 UA shadow
root.  CLs for converting other elements will follow.

<summary> and <details>'s UA shadow internals are like this:

<summary>
  #shadow-root
    <div pseudo="-webkit-details-marker" id="details-marker"></div>
    <slot name="user-agent-default-slot"></slot>

<details>
  #shadow-root
    <slot name="user-agent-custom-assign-slot" id="details-summary">
      <summary>Details</summary>
    </slot>
    <div id="details-content">
      <slot name="user-agent-default-slot"></slot>
    </div>

Bug:  787717 ,  788610 ,  793728 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I67b11cb82174463581f66ec5e98e609737148aa2
Reviewed-on: https://chromium-review.googlesource.com/817716
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Reviewed-by: Hayato Ito <hayato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528645}
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/LayoutTests/TestExpectations
[delete] https://crrev.com/4b57e0551c56f232f64c95b6d92b480bfbbad8af/third_party/WebKit/LayoutTests/fast/dom/shadow/details-summary-distributed-expected.html
[delete] https://crrev.com/4b57e0551c56f232f64c95b6d92b480bfbbad8af/third_party/WebKit/LayoutTests/fast/dom/shadow/details-summary-distributed.html
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/LayoutTests/fast/dom/shadow/offset-parent-does-not-leak-ua-shadow.html
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/LayoutTests/platform/linux/html/details_summary/details-remove-summary-1-and-click-expected.txt
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/LayoutTests/platform/linux/html/details_summary/details-remove-summary-4-and-click-expected.txt
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/LayoutTests/platform/mac/html/details_summary/details-remove-summary-1-and-click-expected.txt
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/LayoutTests/platform/mac/html/details_summary/details-remove-summary-4-and-click-expected.txt
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/LayoutTests/platform/win/html/details_summary/details-remove-summary-1-and-click-expected.txt
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/LayoutTests/platform/win/html/details_summary/details-remove-summary-4-and-click-expected.txt
[add] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/LayoutTests/shadow-dom/ua/summary-details-and-ua-shadow.html
[add] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/LayoutTests/shadow-dom/ua/summary-details-distribution-expected.html
[add] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/LayoutTests/shadow-dom/ua/summary-details-distribution.html
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/Source/core/dom/Node.h
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/Source/core/dom/ShadowRoot.h
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/Source/core/dom/SlotAssignment.cpp
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/Source/core/dom/SlotAssignment.h
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/Source/core/html/HTMLContentElement.cpp
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/Source/core/html/HTMLContentElement.h
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/Source/core/html/HTMLDetailsElement.h
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/Source/core/html/HTMLSlotElement.h
[modify] https://crrev.com/56f2d861c19897381a5ad3bf1db19bf9a8fdac6a/third_party/WebKit/Source/core/html/HTMLSummaryElement.cpp

Project Member

Comment 5 by bugdroid1@chromium.org, Jan 12 2018

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

commit 4f17bd28170e9cfb6b67bc1c37828ce99bc211d9
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Fri Jan 12 11:46:11 2018

Convert V0 UA shadow in <select>, <option>, <optgroup> to use V1

<select> and <optgroup> used <content select="..."> in the V0
UA shadow implementation, thus it needed to have custom assignment
logic for them.  They only had to filter some kinds of HTML elements
(<option>, <optgroup>, <hr>) and not that complex.

<select>'s UA shadow root has only <slot> that captures
<option>, <optgroup>, and <hr> elements.

<optgroup>'s UA shadow root has a <div> for its label and a
<slot> that captures <option> and <hr> elements.

<option>'s UA shadow root is empty, so it is irrelevant whether
it's V0 or V1.

Bug:  787717 ,  793728 
Change-Id: I0bef45bbd99c8c783014a6a105a71fe2c19db8fe
Reviewed-on: https://chromium-review.googlesource.com/822560
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Reviewed-by: Hayato Ito <hayato@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528927}
[modify] https://crrev.com/4f17bd28170e9cfb6b67bc1c37828ce99bc211d9/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/4f17bd28170e9cfb6b67bc1c37828ce99bc211d9/third_party/WebKit/LayoutTests/fast/forms/suggested-value-after-empty-suggested-value-expected.txt
[modify] https://crrev.com/4f17bd28170e9cfb6b67bc1c37828ce99bc211d9/third_party/WebKit/LayoutTests/fast/forms/suggested-value-expected.txt
[modify] https://crrev.com/4f17bd28170e9cfb6b67bc1c37828ce99bc211d9/third_party/WebKit/Source/core/dom/SlotAssignment.cpp
[modify] https://crrev.com/4f17bd28170e9cfb6b67bc1c37828ce99bc211d9/third_party/WebKit/Source/core/html/forms/HTMLOptGroupElement.cpp
[modify] https://crrev.com/4f17bd28170e9cfb6b67bc1c37828ce99bc211d9/third_party/WebKit/Source/core/html/forms/HTMLOptGroupElement.h
[modify] https://crrev.com/4f17bd28170e9cfb6b67bc1c37828ce99bc211d9/third_party/WebKit/Source/core/html/forms/HTMLOptionElement.cpp
[modify] https://crrev.com/4f17bd28170e9cfb6b67bc1c37828ce99bc211d9/third_party/WebKit/Source/core/html/forms/HTMLSelectElement.cpp
[modify] https://crrev.com/4f17bd28170e9cfb6b67bc1c37828ce99bc211d9/third_party/WebKit/Source/core/html/forms/HTMLSelectElement.h

Comment 6 by kochi@chromium.org, Jan 12 2018

Status: Fixed (was: Started)

Sign in to add a comment