scala-js/scala-js-dom

Add back <th> and <td>

BardurArantsson opened this issue · 6 comments

Hi!

Support for <th> and <td> was removed in cfe34f9 , but these they should never have been deprecated (and thus consequently removed) in the first place. Even the documentation linked in the comment at cfe34f9#diff-82399a036b4aa5a1e89c69f985e3a9e495526f6e101bbdccea55720f6d3fb64aL90 indicates that the elements themselves are not deprecated.

Can you advise on how to proceed? I'd be happy to do the legwork to get these elements back -- we are actively using them and this is blocking a sweeping upgrade from scala.js 0.6.x to 1.x :). (There's no rush or anything, but I'd like to get this done sooner rather than later just to avoid it becoming a critical blocker for us.)

I'd assume it should be as simple as reverting the appropriate portions of the linked diff, but I'm not well-versed in bincompat, so I'm not sure if there are pitfalls there that I need to be aware of...

sjrd commented

There is no such class in the DOM. Use HTMLElement instead.

I'm not sure I understand.

https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCellElement

seems to be saying that this is a thing that exists in the DOM?

EDIT: As far as I can tell the interface does have properties that don't appear on HTMLElement.

HTMLTableCellElement is still there, just HTMLTableDataCellElement and HTMLTableHeaderCellElement have been removed.

Ugh, I'm such a dummy... For some reason I got <dt> and <dd> confused
with the table elements and didn't double check my error messages. This is what's missing in 1.1.0:

[error] <REDACTED>: type DT is not a member of object org.scalajs.dom.html
[error]   final val dt = "dt".tag[*.DT]
[error]                             ^
[error] <REDACTED>: type DD is not a member of object org.scalajs.dom.html
[error]   final val dd = "dd".tag[*.DD]
[error]                             ^
[error] <REDACTED>: type TableHeaderCell is not a member of object org.scalajs.dom.html
[error]   final val th = "th".tag[*.TableHeaderCell]
[error]

(I should probably just have started by pasting that to avoid a lot of confusion. Sorry about the confusion.).

As far as I can tell none of these are actually deprecated (see e.g. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dd ) and they were removed in the above-mentioned commit.

sjrd commented

As you can see from the link you posted, the "DOM interface" of a <dd> element is HTMLElement. There is no HTMLDDElement or anything like that.

Sorry about the noise.