<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Shadow DOM]: :host-context rule does not apply to matching nodes within the shadow root"
   href="https://bugs.webkit.org/show_bug.cgi?id=160038">160038</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Shadow DOM]: :host-context rule does not apply to matching nodes within the shadow root
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Safari Technology Preview
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>CSS
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>cdata&#64;google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Please consider the following test cases:

<a href="http://output.jsbin.com/menajes">http://output.jsbin.com/menajes</a> (Custom Elements &amp; Shadow DOM)
<a href="http://output.jsbin.com/gafocub">http://output.jsbin.com/gafocub</a> (Shadow DOM only)

The test cases feature two elements, each with a similar attached shadow root. The stylesheet within each shadow root contains a rule whose selector includes :host-context([dir=&quot;rtl&quot;]).

What I expected to happen:

The contents in the second shadow root match the :host-context selector, causing text to be aligned to the right.

What actually happened:

The contents in the second shadow root is incorrectly aligned to the left.

The :host-context feature is extremely useful for navigating style encapsulation in some situations. As demonstrated in the test cases, it is probably the best way to conditionally style a shadow root's elements when RTL is set by some uncertain ancestor of the host.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>