[whatwg/dom] `thead` and `tbody` are being ignored when querying its table row element (#956)

I am not sure if this is the right place to report this. I came across this weird behavior and wonder if it is the desired or not.

Given I have the following HTML structure:

```html
<table id="outer-table">
  <thead>
    <tr>
      <th>outer-table-column-header</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>outer-table-first-row-cell</td>
    </tr>
    <tr>
      <td>
        <table id="inner-table">
          <thead>
            <tr>
              <th>inner-table-column-header</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>inner-table-first-row-cell</td>
            </tr>
          </tbody>
        </table>
      </td>
    </tr>
  </tbody>
</table>
```

There seems to be a funky behavior when trying to query the first row cell from the inner vs outer table:

```js
> $('#outer-table').querySelector('tbody tr').innerText
"outer-table-first-row-cell"
> $('#inner-table tbody tr').innerText
"inner-table-first-row-cell"

// whereas
> $('#inner-table').querySelector('tbody tr').innerText
"inner-table-column-header"
```

Is this expected?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/956

Received on Wednesday, 3 March 2021 14:26:28 UTC