Bug 172446 - Ordered list and Shadow DOM have broken order
Summary: Ordered list and Shadow DOM have broken order
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Mac macOS 10.12
: P2 Major
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 148695
  Show dependency treegraph
 
Reported: 2017-05-22 06:41 PDT by Mattia Astorino
Modified: 2022-07-18 14:23 PDT (History)
12 users (show)

See Also:


Attachments
Reproduction (915 bytes, text/html)
2018-09-18 01:06 PDT, Ryosuke Niwa
no flags Details
WIP (8.73 KB, patch)
2022-07-17 14:48 PDT, Ryosuke Niwa
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP2 (8.83 KB, patch)
2022-07-17 23:50 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mattia Astorino 2017-05-22 06:41:30 PDT
When an ordered list is composed by custom elements and shadow dom (open and slot) the list counter restart each <li> element, so every <li> have the 1. number:

This is the output:

1. Lorem ipsum
1. Dolor Sit amet
1. Consecutor adipiscing
   1. Lorem ipsum
   1. Dolor Sit amet
1. Dolor Sit amet

This is the source code:
<oa-list>
   <oa-list-item>Lorem ipsum</oa-list-item>
   <oa-list-item>Dolor Sit amet</oa-list-item>
   <oa-list-item>
      Consecutor adipiscing
      <oa-list>
          <oa-list-item>Lorem ipsum</oa-list-item>
          <oa-list-item>Dolor Sit amet</oa-list-item>
      </oa-list>
   </oa-list-item>
   <oa-list-item>Dolor Sit amet</oa-list-item>
</oa-list>




<oa-list> shadow root:

<ol>
  <slot></slot>
</ol>



<oa-list-item> shadow root:

<li>
  <slot></slot>
</li>
Comment 1 Mattia Astorino 2017-06-06 00:20:31 PDT
Now with the latest WebKit Nightly release the there is no bullet indicators for orderered and unordered lists. Are you working on that? This is the output, same source code:

http://i.imgur.com/aEaaMBc.png
Comment 2 Antti Koivisto 2017-11-03 05:19:58 PDT
A full test case would be helpful.
Comment 3 Radar WebKit Bug Importer 2018-08-01 22:40:47 PDT
<rdar://problem/42842990>
Comment 4 Ryosuke Niwa 2018-09-18 01:06:26 PDT
Created attachment 350010 [details]
Reproduction

This works in Chrome & Firefox but fails in Safari.
Comment 5 Ryosuke Niwa 2022-07-17 14:48:00 PDT
Created attachment 460965 [details]
WIP
Comment 6 Ryosuke Niwa 2022-07-17 23:50:20 PDT
Created attachment 460967 [details]
WIP2
Comment 7 Ryosuke Niwa 2022-07-18 14:23:14 PDT
Hm... attached patch fixes the order number issue but there is some kind of weird padding / margin added to the list. Not sure where that's coming from.