Bug 211640

Summary: Fix wpt shadow-dom/slots-fallback-in-document.html
Product: WebKit Reporter: Tetsuharu Ohzeki [UTC+9] <tetsuharu.ohzeki>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, darin, esprehn+autocc, ews-watchlist, gyuyoung.kim, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 148695    
Attachments:
Description Flags
Patch
none
Patch none

Description Tetsuharu Ohzeki [UTC+9] 2020-05-08 12:46:20 PDT
Today's webkit does not green: http://wpt.live/shadow-dom/slots-fallback-in-document.html
Comment 1 Tetsuharu Ohzeki [UTC+9] 2020-05-08 12:46:54 PDT
I'll attach the patch.
Comment 2 Tetsuharu Ohzeki [UTC+9] 2020-05-08 12:51:50 PDT
Created attachment 398885 [details]
Patch
Comment 3 Darin Adler 2020-05-08 14:17:39 PDT
Comment on attachment 398885 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=398885&action=review

> Source/WebCore/html/HTMLSlotElement.cpp:123
> -        if (is<HTMLSlotElement>(*node))
> +        if (is<HTMLSlotElement>(*node) && downcast<HTMLSlotElement>(*node).containingShadowRoot())

Why is this different from the code above that iterates children?
Comment 4 Tetsuharu Ohzeki [UTC+9] 2020-05-08 14:36:24 PDT
(In reply to Darin Adler from comment #3)
> Comment on attachment 398885 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=398885&action=review
> 
> > Source/WebCore/html/HTMLSlotElement.cpp:123
> > -        if (is<HTMLSlotElement>(*node))
> > +        if (is<HTMLSlotElement>(*node) && downcast<HTMLSlotElement>(*node).containingShadowRoot())
> 
> Why is this different from the code above that iterates children?

This condition changing is correspond to the spec[1], step 5-1-1.

[1]: https://dom.spec.whatwg.org/#find-flattened-slotables
Comment 5 Tetsuharu Ohzeki [UTC+9] 2020-05-08 22:36:50 PDT
As sideeffect, this change also fix http://wpt.live/shadow-dom/slots-outside-shadow-dom.html. I'll upload the patch which updates wpt results.
Comment 6 Tetsuharu Ohzeki [UTC+9] 2020-05-08 22:37:05 PDT
Created attachment 398919 [details]
Patch
Comment 7 Ryosuke Niwa 2020-05-08 22:46:33 PDT
Are you a committer? If not, can you also set cq? when your patch is ready to land. Then any committer (including myself) can set it to cq+, which allows your patch to be committed into the WebKit repository.
Comment 8 Ryosuke Niwa 2020-05-08 22:46:48 PDT
(In reply to Ryosuke Niwa from comment #7)
> Are you a committer? If not, can you also set cq? when your patch is ready
> to land. Then any committer (including myself) can set it to cq+, which
> allows your patch to be committed into the WebKit repository.

You can do this via "Details".
Comment 9 Tetsuharu Ohzeki [UTC+9] 2020-05-08 23:26:09 PDT
(In reply to Ryosuke Niwa from comment #7)
> Are you a committer? If not, can you also set cq? when your patch is ready
> to land. Then any committer (including myself) can set it to cq+, which
> allows your patch to be committed into the WebKit repository.


Thank you for your guide, niwa san.
I'm not a comitter, so I'll set cq?.
Comment 10 Ryosuke Niwa 2020-05-08 23:58:28 PDT
Comment on attachment 398919 [details]
Patch

Great. Thanks for the patch!
Comment 11 EWS 2020-05-09 00:00:45 PDT
Committed r261433: <https://trac.webkit.org/changeset/261433>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 398919 [details].
Comment 12 Radar WebKit Bug Importer 2020-05-09 00:01:19 PDT
<rdar://problem/63048867>