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

Issue 787717 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug


Sign in to add a comment

Convert all V0 shadow usages for user-agent shadow roots to V1

Project Member Reported by hayato@chromium.org, Nov 22 2017

Issue description

I've found that <select> element still uses a <content> element in its implementation.

https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/forms/HTMLSelectElement.cpp?l=1824

I guess HTMLSelectElements are not only elements which use Shadow DOM v0 feature.

We should rewrite every built-in elements so that they don't use Shadow DOM v0 feature.

 

Comment 1 by hayato@chromium.org, Nov 22 2017

Blocking: 776656
Cc: rakina@chromium.org
kochi@, you might want to work on this before starting deprecating Shadow DOM v0.

This is a blocking issue for Incremental Shadow DOM.

Comment 2 by kochi@chromium.org, Nov 22 2017

Status: Started (was: Assigned)

Comment 3 by hayato@chromium.org, Nov 27 2017

Blockedon: 788608

Comment 4 by hayato@chromium.org, Nov 27 2017

Blockedon: 788617

Comment 5 by hayato@chromium.org, Nov 27 2017

Blockedon: 788610

Comment 6 by hayato@chromium.org, Nov 27 2017

Blockedon: 788623

Comment 7 by hayato@chromium.org, Nov 27 2017

Blockedon: 788625

Comment 8 by hayato@chromium.org, Nov 27 2017

Blockedon: 788635
Project Member

Comment 9 by bugdroid1@chromium.org, Nov 27 2017

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

commit dfa2cf8cf5a7c188e3962801ece398406dae4ecf
Author: Hayato Ito <hayato@chromium.org>
Date: Mon Nov 27 10:48:38 2017

[IncrementalShadowDOM] Update bug id for fast/dom/shadow/ tests which crash with the flag

TBR=kochi

Bug:  787717 , 788608 , 788610 , 788623 , 788635 
Change-Id: I82f8502fc336739022f7de36cb7aaf6dd7934b90
Reviewed-on: https://chromium-review.googlesource.com/790042
Commit-Queue: Hayato Ito <hayato@chromium.org>
Reviewed-by: Hayato Ito <hayato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519270}
[modify] https://crrev.com/dfa2cf8cf5a7c188e3962801ece398406dae4ecf/third_party/WebKit/LayoutTests/TestExpectations

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

Blockedon: 793728
Project Member

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

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

commit 7064677daf7d84d442fd60124d59f6d6a618638e
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Thu Jan 11 11:58:10 2018

Add UserAgent V1 Shadow Root type

This change adds a new UserAgent V1 shadow root type.
I'll convert all existing UserAgent shadow users from V0
to V1 one by one.

As the change becomes too big if all elements using UA shadow
are converted to use V1 at once, I split the change into pieces,
and this is the first one.

This change splits |ShadowRootType::kUserAgent| into
|ShadowRootType::kLegacyUserAgentV0| and |ShadowRootType::kUserAgentV1|
and the latter will use V1 shadow root machinery (slot assignment etc.)
Eventually once all V0 UA shadow users are converted to V1 UA shadow,
I'll remove kUserAgentV0 and EnsureLegacyUserAgentShadowRootV0().

This change itself should not change any behavior.

Bug:  787717 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I259e283eb49bb654bf9602f2bc889cb534b85c10
Reviewed-on: https://chromium-review.googlesource.com/796191
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: Hayato Ito <hayato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528601}
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/css/SelectorChecker.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/css/StyleElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/dom/ContainerNode.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/dom/Element.h
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/dom/ElementShadow.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/dom/NodeTest.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/dom/ShadowRoot.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/dom/ShadowRoot.h
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializer.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/exported/WebFrameSerializer.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/exported/WebFrameSerializerSanitizationTest.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/HTMLElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/HTMLImageFallbackHelper.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/HTMLMeterElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/HTMLProgressElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/HTMLSummaryElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/ImageDocument.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/custom/V0CustomElementCallbackQueue.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/forms/HTMLInputElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/forms/HTMLOptGroupElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/forms/HTMLOptionElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/forms/HTMLSelectElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/forms/HTMLTextAreaElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/forms/TextControlElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/media/HTMLAudioElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/media/HTMLMediaElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/html/media/HTMLVideoElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/layout/HitTestResult.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/layout/LayoutObject.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/paint/SelectionPaintingUtils.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/core/testing/Internals.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/modules/media_controls/elements/MediaControlInputElement.cpp
[modify] https://crrev.com/7064677daf7d84d442fd60124d59f6d6a618638e/third_party/WebKit/Source/modules/media_controls/elements/MediaControlOverlayPlayButtonElement.cpp

Project Member

Comment 12 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 13 by bugdroid1@chromium.org, Jan 12 2018

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

commit f3853c0b84da0994c4d28ca8c38737d257e95075
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Fri Jan 12 05:23:19 2018

Convert V0 UA shadow in <meter> to use V1

In <meter> element, <content> in V0 UA shadow was used to
hold its fallback contents, and the contents will become
visible when it gets styled as '-webkit-appearance: none'.

This CL changes the <content> with <slot> which has
"user agent default slot" semantics.

The <meter>'s V1 UA shadow root looks like:

<meter>
 #shadow-root
   <div pseudo="-webkit-meter-inner-element">
    <div pseudo="-webkit-meter-bar">
     <div pseudo="-webkit-meter-optimum-value" style="width: 0%;">
     </div>
    </div>
   </div>
   <div pseudo="-internal-fallback">
    <slot></slot>
   </div>
</meter>

Bug:  787717 ,  788635 
Change-Id: I820996da7b6ba0c053dbf6117cadc6a6c3a9a76f
Reviewed-on: https://chromium-review.googlesource.com/799516
Reviewed-by: Hayato Ito <hayato@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528884}
[modify] https://crrev.com/f3853c0b84da0994c4d28ca8c38737d257e95075/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/f3853c0b84da0994c4d28ca8c38737d257e95075/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-element-markup-expected.txt
[add] https://crrev.com/f3853c0b84da0994c4d28ca8c38737d257e95075/third_party/WebKit/LayoutTests/shadow-dom/ua/meter-and-ua-shadow.html
[add] https://crrev.com/f3853c0b84da0994c4d28ca8c38737d257e95075/third_party/WebKit/LayoutTests/shadow-dom/ua/meter-fallback-expected.html
[add] https://crrev.com/f3853c0b84da0994c4d28ca8c38737d257e95075/third_party/WebKit/LayoutTests/shadow-dom/ua/meter-fallback.html
[modify] https://crrev.com/f3853c0b84da0994c4d28ca8c38737d257e95075/third_party/WebKit/Source/core/html/HTMLMeterElement.cpp

Project Member

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

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

commit bb4692c0babd2fdd7f54e6f4f876a6e060d9bb8a
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Fri Jan 12 08:24:30 2018

Convert V0 UA shadow in <object> and <embed> to use V1

<object> and <embed> are both sharing the same UA shadow
implementation defined in HTMLPluginElement.cpp, and
their UA shadow root contains only a user agent default <slot>.

Bug:  787717 ,  788608 
Change-Id: I5d8289b3c8a096020a20352102d0a098286f67d3
Reviewed-on: https://chromium-review.googlesource.com/799611
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Reviewed-by: Hayato Ito <hayato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528906}
[modify] https://crrev.com/bb4692c0babd2fdd7f54e6f4f876a6e060d9bb8a/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/bb4692c0babd2fdd7f54e6f4f876a6e060d9bb8a/third_party/WebKit/LayoutTests/editing/editability/ignored-content-expected.txt
[modify] https://crrev.com/bb4692c0babd2fdd7f54e6f4f876a6e060d9bb8a/third_party/WebKit/LayoutTests/editing/pasteboard/paste-noplugin-expected.txt
[modify] https://crrev.com/bb4692c0babd2fdd7f54e6f4f876a6e060d9bb8a/third_party/WebKit/LayoutTests/fast/parser/object-with-textarea-fallback-expected.txt
[modify] https://crrev.com/bb4692c0babd2fdd7f54e6f4f876a6e060d9bb8a/third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp
[modify] https://crrev.com/bb4692c0babd2fdd7f54e6f4f876a6e060d9bb8a/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp
[modify] https://crrev.com/bb4692c0babd2fdd7f54e6f4f876a6e060d9bb8a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp

Project Member

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

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

commit ed092dad033cebbbaea03aac3470ee1282acd814
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Fri Jan 12 11:17:21 2018

Convert V0 UA shadow in ImageDocument to use V1

ImageDocument creates <body> with a UA shadow, and the shadow
works as a container for image to support resizing etc.

Bug:  787717 
Change-Id: I4c220263828a8860440bfff7a3f4fef897e2682e
Reviewed-on: https://chromium-review.googlesource.com/798935
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Hayato Ito <hayato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528925}
[modify] https://crrev.com/ed092dad033cebbbaea03aac3470ee1282acd814/third_party/WebKit/Source/core/html/ImageDocument.cpp

Project Member

Comment 16 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

Project Member

Comment 17 by bugdroid1@chromium.org, Jan 14 2018

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

commit 424117308e9bccac62578de511eeaebfeded3199
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Sun Jan 14 01:22:10 2018

Convert V0 UA shadow in <marquee> to use V1

<marquee> was implemented in V0 UA shadowroot with <content>
element, obviously for wrapping the moving parts inside its
element, and used style/animation to move.

This CL replaces <content> with <slot> to use V1 UA shadowroot.

Bug:  787717 ,  788625 
Change-Id: Ic2bbd8e1536a4736fe0f1e761eecbf7841e8a596
Reviewed-on: https://chromium-review.googlesource.com/798871
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Reviewed-by: Hayato Ito <hayato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529178}
[modify] https://crrev.com/424117308e9bccac62578de511eeaebfeded3199/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/424117308e9bccac62578de511eeaebfeded3199/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp

Project Member

Comment 18 by bugdroid1@chromium.org, Jan 15 2018

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

commit a064b39bd3c9e2be6df1f41b656e10249524f62c
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Mon Jan 15 07:28:34 2018

Convert V0 UA shadow in <progress> to use V1

This is a part of conversion from V0 UA shadow to V1.
<progress> element doesn't have any <contents> element,
thus the conversion is straightforward to set V1 type.

The internal of <progress>'s UA shadow looks like this:

<progress>
  #shadow-root
    <div pseudo="-webkit-progress-inner-element">
      <div pseudo="-webkit-progress-bar">
        <div pseudo="-webkit-progress-value">
        </div>
      </div>
    </div>

Bug:  788635 ,  787717 
Change-Id: I743f5c99a8273f29cefe18a9e8789c43eec47f4a
Reviewed-on: https://chromium-review.googlesource.com/866276
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@{#529218}
[modify] https://crrev.com/a064b39bd3c9e2be6df1f41b656e10249524f62c/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/a064b39bd3c9e2be6df1f41b656e10249524f62c/third_party/WebKit/Source/core/html/HTMLProgressElement.cpp

Project Member

Comment 19 by bugdroid1@chromium.org, Jan 16 2018

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

commit 2ce1fe0f2b58d9eeb7d2bf78d988f618b56d31e9
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Tue Jan 16 09:36:46 2018

Covnert internals.createUserAgehtShadowRoot() to create V1 shadow

This is a part of V0 UA shadow root conversion to V1.
 crbug.com/788617  drag and drop layout test is also fixed
with this CL.

Bug:  788617 ,  787717 
Change-Id: I4fcc6b6ebe017d443c486108209993e4f8bf39f4
Reviewed-on: https://chromium-review.googlesource.com/863843
Reviewed-by: Hayato Ito <hayato@chromium.org>
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529389}
[modify] https://crrev.com/2ce1fe0f2b58d9eeb7d2bf78d988f618b56d31e9/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/2ce1fe0f2b58d9eeb7d2bf78d988f618b56d31e9/third_party/WebKit/LayoutTests/fast/dom/shadow/drag-and-drop-in-user-agent-shadow.html
[modify] https://crrev.com/2ce1fe0f2b58d9eeb7d2bf78d988f618b56d31e9/third_party/WebKit/Source/core/testing/Internals.cpp

Project Member

Comment 20 by bugdroid1@chromium.org, Jan 16 2018

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

commit 08081e9fad00265948da5a29cbe52788e06992ae
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Tue Jan 16 10:17:50 2018

Convert V0 UA shadow for media elements to use V1

<audio> and <video> elements used V0 UA shadows.
They don't use <content> element, and they are straightfoward
conversion.

Bug:  787717 
Change-Id: Ia835ee5d94d1a587f3387a48b4c7dc4b7eccfe86
Reviewed-on: https://chromium-review.googlesource.com/866288
Reviewed-by: Hayato Ito <hayato@chromium.org>
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529393}
[modify] https://crrev.com/08081e9fad00265948da5a29cbe52788e06992ae/third_party/WebKit/Source/core/html/media/HTMLAudioElement.cpp
[modify] https://crrev.com/08081e9fad00265948da5a29cbe52788e06992ae/third_party/WebKit/Source/core/html/media/HTMLMediaElement.cpp
[modify] https://crrev.com/08081e9fad00265948da5a29cbe52788e06992ae/third_party/WebKit/Source/core/html/media/HTMLVideoElement.cpp

Comment 21 by kochi@chromium.org, Jan 17 2018

Blockedon: 802009

Comment 22 by kochi@chromium.org, Jan 17 2018

Summary: Convert all V0 shadow usages for user-agent shadow roots to V1 (was: Don't use <content> elements in user agent shadow roots.)
Project Member

Comment 23 by bugdroid1@chromium.org, Jan 17 2018

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

commit da22deb65697129580484e1061e64d65ada45eca
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Wed Jan 17 07:13:48 2018

Use V1 UA shadow root in NodeTest.cpp

NodeTest.* in webkit_unit_tests used V0 UA shadow roots, but it doesn't
depend on any feature on V0 shadow, and it is safe to migrate to use
V1 UA shadow roots.

Bug:  787717 
Change-Id: I171434742f78e2553304e1c3de992b280e005296
Reviewed-on: https://chromium-review.googlesource.com/869692
Reviewed-by: Hayato Ito <hayato@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529662}
[modify] https://crrev.com/da22deb65697129580484e1061e64d65ada45eca/third_party/WebKit/Source/core/dom/NodeTest.cpp

Project Member

Comment 24 by bugdroid1@chromium.org, Jan 18 2018

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

commit c50697e7f73eb926ac0a2e4dabce7804306e19f1
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Thu Jan 18 09:27:10 2018

Convert V0 UA shadow in <textarea> to use V1

<textarea> creates its UA shadow root and uses for a container
for its editor, which does not contain <content>.

ClipboardEvents have its composed flag false by default, while
they used to be not scoped in V0 shadow.
Therefore events dispatched inside UA shadow tree cannot propagate
outside shadow tree for V1 UA shadow.

This CL changes the dispatching target of these events from an
element inside UA shadow tree to its shadow host, so that events
can properly be observed outside UA shadow tree.

Non-synthetic ClipboardEvents are dispatched only in
core/editing/Editor.cpp.

Bug:  787717 
Change-Id: I499e97601dc21b8f8408df91450736e8ca3469fe
Reviewed-on: https://chromium-review.googlesource.com/866613
Reviewed-by: Hayato Ito <hayato@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530097}
[modify] https://crrev.com/c50697e7f73eb926ac0a2e4dabce7804306e19f1/third_party/WebKit/Source/core/editing/Editor.cpp
[modify] https://crrev.com/c50697e7f73eb926ac0a2e4dabce7804306e19f1/third_party/WebKit/Source/core/html/forms/HTMLTextAreaElement.cpp

Project Member

Comment 25 by bugdroid1@chromium.org, Jan 18 2018

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

commit 60e9c910417b9685d5a782526d50ea3523421eb3
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Thu Jan 18 10:53:02 2018

Convert V0 UA shadows in <input> and media control elements to use V1

This CL is the last in the series of changes to convert V0 UA shadow
to V1.

Some media control elements inherit from <input> and ImageFallbackHelper
also depends on <input type="image">, changes for them have to be submitted
at once.

This CL depends on
https://chromium-review.googlesource.com/c/chromium/src/+/866613
for the workaround of clipboard events' default composed flag to
pass all tests.

Bug:  787717 
Change-Id: Iccae96ceb63e1de9d76cdf736cebe32169244605
Reviewed-on: https://chromium-review.googlesource.com/869553
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: Hayato Ito <hayato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530115}
[modify] https://crrev.com/60e9c910417b9685d5a782526d50ea3523421eb3/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
[modify] https://crrev.com/60e9c910417b9685d5a782526d50ea3523421eb3/third_party/WebKit/Source/core/html/HTMLImageFallbackHelper.cpp
[modify] https://crrev.com/60e9c910417b9685d5a782526d50ea3523421eb3/third_party/WebKit/Source/core/html/forms/HTMLInputElement.cpp
[modify] https://crrev.com/60e9c910417b9685d5a782526d50ea3523421eb3/third_party/WebKit/Source/modules/media_controls/elements/MediaControlInputElement.cpp
[modify] https://crrev.com/60e9c910417b9685d5a782526d50ea3523421eb3/third_party/WebKit/Source/modules/media_controls/elements/MediaControlOverlayPlayButtonElement.cpp

Project Member

Comment 26 by bugdroid1@chromium.org, Jan 18 2018

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

commit 071deb5db0adcbbc4b49cc53a231d5baa03bb70a
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Thu Jan 18 15:01:41 2018

Clean up unused *LegacyUserAgentV0 code.

Now all legacy V0 UA shadow roots are gone to V1.
Code that handles V0 UA shadow is no longer necessary.

A CL for mechanical renames to *UserAgentV1 to *UserAgent
will follow this.

Bug:  787717 
Change-Id: I3fdec19df270aa321bd9839972a642d04c0a09fa
Reviewed-on: https://chromium-review.googlesource.com/869632
Reviewed-by: Hayato Ito <hayato@chromium.org>
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530142}
[modify] https://crrev.com/071deb5db0adcbbc4b49cc53a231d5baa03bb70a/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/071deb5db0adcbbc4b49cc53a231d5baa03bb70a/third_party/WebKit/Source/core/dom/Element.h
[modify] https://crrev.com/071deb5db0adcbbc4b49cc53a231d5baa03bb70a/third_party/WebKit/Source/core/dom/ElementShadow.cpp
[modify] https://crrev.com/071deb5db0adcbbc4b49cc53a231d5baa03bb70a/third_party/WebKit/Source/core/dom/ShadowRoot.cpp
[modify] https://crrev.com/071deb5db0adcbbc4b49cc53a231d5baa03bb70a/third_party/WebKit/Source/core/dom/ShadowRoot.h
[modify] https://crrev.com/071deb5db0adcbbc4b49cc53a231d5baa03bb70a/third_party/WebKit/Source/core/exported/WebFrameSerializer.cpp
[modify] https://crrev.com/071deb5db0adcbbc4b49cc53a231d5baa03bb70a/third_party/WebKit/Source/core/exported/WebFrameSerializerSanitizationTest.cpp
[modify] https://crrev.com/071deb5db0adcbbc4b49cc53a231d5baa03bb70a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
[modify] https://crrev.com/071deb5db0adcbbc4b49cc53a231d5baa03bb70a/third_party/WebKit/Source/core/testing/Internals.cpp

Comment 27 by kochi@chromium.org, Jan 19 2018

Blockedon: -802009
Project Member

Comment 28 by bugdroid1@chromium.org, Jan 20 2018

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

commit c773e5725d02c7a1cf9291a33360a5fb0a17cbe2
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Sat Jan 20 03:17:29 2018

Do not switch to V1 cascade order if shadow root is UA shadow

Once V1 shadow root is attached to a document, we switch
cascading order to V1-compliant mode from V0-legacy mode,
but recent migration of UA shadows from V0 to V1 caused
the cascading order switch without explicitly creating
author V1 shadow root.

This happens only in the following scenario:
1. An element with V1 UA shadow is created in another document
2. The element with V1 UA shadow is adopted to the document.

In other cases, internal APIs such as EnsureUserAgentShadowRoot()
or CreateUserAgentShadowRoot() does not share the same code path
for web-facing Element.attachShadow(), the cascading order is not
affected.

Bug:  801938 ,  787717 
Change-Id: I93e41e8f6f0acda4f3804e1ef316da205454b62f
Reviewed-on: https://chromium-review.googlesource.com/875585
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530738}
[modify] https://crrev.com/c773e5725d02c7a1cf9291a33360a5fb0a17cbe2/third_party/WebKit/LayoutTests/shadow-dom/css-cascade-upgrade-from-v0-to-v1.html
[modify] https://crrev.com/c773e5725d02c7a1cf9291a33360a5fb0a17cbe2/third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp

Project Member

Comment 29 by bugdroid1@chromium.org, Jan 22 2018

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

commit aeec06742be0acf94cd2d337006b9a256dce6a5a
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Mon Jan 22 07:02:16 2018

Mechanical renames from *UserAgentV1 to *UserAgent

Now all user agent shadows are using V1 shadow root,
we no longer need V1 suffix for constants and method names.

Bug:  787717 
Change-Id: I3a2d0a4ecb5c486645f4ecb2792ed112a6e5e4af
Reviewed-on: https://chromium-review.googlesource.com/869634
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Reviewed-by: Hayato Ito <hayato@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530819}
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/dom/Element.h
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/dom/NodeTest.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/dom/ShadowRoot.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/dom/ShadowRoot.h
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/exported/WebFrameSerializer.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/HTMLImageFallbackHelper.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/HTMLMeterElement.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/HTMLProgressElement.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/HTMLSummaryElement.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/ImageDocument.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/forms/HTMLInputElement.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/forms/HTMLOptGroupElement.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/forms/HTMLOptionElement.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/forms/HTMLSelectElement.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/forms/HTMLTextAreaElement.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/media/HTMLAudioElement.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/media/HTMLMediaElement.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/html/media/HTMLVideoElement.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/core/testing/Internals.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/modules/media_controls/elements/MediaControlInputElement.cpp
[modify] https://crrev.com/aeec06742be0acf94cd2d337006b9a256dce6a5a/third_party/WebKit/Source/modules/media_controls/elements/MediaControlOverlayPlayButtonElement.cpp

Comment 30 by kochi@chromium.org, Jan 22 2018

Status: Fixed (was: Started)
Project Member

Comment 31 by bugdroid1@chromium.org, Jan 23 2018

Labels: merge-merged-3325
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b72f6df15e00d0d0846936a9b9fd1b1f6b235f46

commit b72f6df15e00d0d0846936a9b9fd1b1f6b235f46
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Tue Jan 23 13:47:14 2018

Do not switch to V1 cascade order if shadow root is UA shadow

Once V1 shadow root is attached to a document, we switch
cascading order to V1-compliant mode from V0-legacy mode,
but recent migration of UA shadows from V0 to V1 caused
the cascading order switch without explicitly creating
author V1 shadow root.

This happens only in the following scenario:
1. An element with V1 UA shadow is created in another document
2. The element with V1 UA shadow is adopted to the document.

In other cases, internal APIs such as EnsureUserAgentShadowRoot()
or CreateUserAgentShadowRoot() does not share the same code path
for web-facing Element.attachShadow(), the cascading order is not
affected.

TBR=kochi@chromium.org

(cherry picked from commit c773e5725d02c7a1cf9291a33360a5fb0a17cbe2)

Bug:  801938 ,  787717 
Change-Id: I93e41e8f6f0acda4f3804e1ef316da205454b62f
Reviewed-on: https://chromium-review.googlesource.com/875585
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#530738}
Reviewed-on: https://chromium-review.googlesource.com/881123
Reviewed-by: Takayoshi Kochi <kochi@chromium.org>
Cr-Commit-Position: refs/branch-heads/3325@{#28}
Cr-Branched-From: bc084a8b5afa3744a74927344e304c02ae54189f-refs/heads/master@{#530369}
[modify] https://crrev.com/b72f6df15e00d0d0846936a9b9fd1b1f6b235f46/third_party/WebKit/LayoutTests/shadow-dom/css-cascade-upgrade-from-v0-to-v1.html
[modify] https://crrev.com/b72f6df15e00d0d0846936a9b9fd1b1f6b235f46/third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp

Comment 32 by kochi@chromium.org, Jan 26 2018

Blocking: 806159
Project Member

Comment 33 by bugdroid1@chromium.org, Feb 16 2018

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

commit de687559b553287d29cf6f13d86724b83afcb909
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Fri Feb 16 10:56:34 2018

Shrink bits used for ShadowRoot type.

kLegacyUserAgentV0 type is gone, and now 2 bits are enough to
hold the type for ShadowRoot, instead of 3.

Bug:  787717 
Change-Id: I64b00c9ac79d8d43830ac94cb5bd013a9043dcca
Reviewed-on: https://chromium-review.googlesource.com/923783
Reviewed-by: Hayato Ito <hayato@chromium.org>
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537280}
[modify] https://crrev.com/de687559b553287d29cf6f13d86724b83afcb909/third_party/WebKit/Source/core/dom/ShadowRoot.h

Project Member

Comment 34 by bugdroid1@chromium.org, May 14 2018

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

commit 1681b460fbbe11f1e8fa2f24e8cae56c27826b28
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Mon May 14 12:20:52 2018

Convert media elements to use UA shadow instead of V0 shadow

Found some media control elements accidentally using V0 shadow
root instead of User-Agent shadow root, and this fixes the cases.

To avoid further misuses, I'll rename the API in the following CL
https://chromium-review.googlesource.com/c/chromium/src/+/1057047

Bug:  787717 ,  776656 
Change-Id: I45274ccb399ae57ea7207402323f49efd2188d9c
Reviewed-on: https://chromium-review.googlesource.com/1056939
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558266}
[modify] https://crrev.com/1681b460fbbe11f1e8fa2f24e8cae56c27826b28/third_party/blink/renderer/modules/media_controls/elements/media_control_loading_panel_element.cc
[modify] https://crrev.com/1681b460fbbe11f1e8fa2f24e8cae56c27826b28/third_party/blink/renderer/modules/media_controls/elements/media_control_scrubbing_message_element.cc

Project Member

Comment 35 by bugdroid1@chromium.org, May 14 2018

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

commit b1a5907f04f0ad4b76a3840eb2793e1524e2c5a1
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Mon May 14 23:15:48 2018

Rename CreateShadowRootInernal() to CreateV0ShadowRootForTesting()

Now V0 UA shadow root are already gone and to avoid accidental
misuses for creating UA shadow root via CreateShadowRootInternal(),
rename it to CreateV0ShadowRootForTesting() and move the
original CreateShadowRootInternal() to private.

Bug:  787717 
Change-Id: Idb3eae11f928d371fe102f766e54e6519f37d5db
Reviewed-on: https://chromium-review.googlesource.com/1057047
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Reviewed-by: Hayato Ito <hayato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558516}
[modify] https://crrev.com/b1a5907f04f0ad4b76a3840eb2793e1524e2c5a1/third_party/blink/renderer/core/dom/element.h
[modify] https://crrev.com/b1a5907f04f0ad4b76a3840eb2793e1524e2c5a1/third_party/blink/renderer/core/dom/flat_tree_traversal_test.cc
[modify] https://crrev.com/b1a5907f04f0ad4b76a3840eb2793e1524e2c5a1/third_party/blink/renderer/core/dom/ng/flat_tree_traversal_ng_test.cc
[modify] https://crrev.com/b1a5907f04f0ad4b76a3840eb2793e1524e2c5a1/third_party/blink/renderer/core/dom/shadow_dom_v0_test.cc
[modify] https://crrev.com/b1a5907f04f0ad4b76a3840eb2793e1524e2c5a1/third_party/blink/renderer/core/dom/tree_scope_adopter_test.cc
[modify] https://crrev.com/b1a5907f04f0ad4b76a3840eb2793e1524e2c5a1/third_party/blink/renderer/core/dom/tree_scope_test.cc
[modify] https://crrev.com/b1a5907f04f0ad4b76a3840eb2793e1524e2c5a1/third_party/blink/renderer/core/editing/finder/text_finder_test.cc
[modify] https://crrev.com/b1a5907f04f0ad4b76a3840eb2793e1524e2c5a1/third_party/blink/renderer/core/editing/testing/editing_test_base.cc
[modify] https://crrev.com/b1a5907f04f0ad4b76a3840eb2793e1524e2c5a1/third_party/blink/renderer/core/exported/web_element_test.cc
[modify] https://crrev.com/b1a5907f04f0ad4b76a3840eb2793e1524e2c5a1/third_party/blink/renderer/core/exported/web_frame_serializer_sanitization_test.cc

Sign in to add a comment