html5lib / html5lib-tests

Testsuite data for html5lib, including the de-facto standard HTML parsing tests.
MIT License
188 stars 61 forks source link

Tree-construction ruby test #14 #54

Closed nostrademons closed 9 years ago

nostrademons commented 9 years ago

Input is "ab", expected output is:

<html html>
  <html head>
  <html body>
    <html ruby>
      "a"
      <html rtc>
        "b"
      <html rp>

However, the W3C spec text for tags is "If the stack of open elements has a ruby element in scope, then generate implied end tags, except for rtc elements." Shouldn't the element not be implicitly closed by the , since it falls under the exception?

nolanw commented 9 years ago

The WHATWG spec does not agree with the W3C spec, and I think these tests aim to conform with WHATWG. By my reading the test accurately reflects the current WHTAWG spec.

As an aside, it's probably worth prominently mentioning somewhere (a readme, maybe) which spec these tests aim to, well, test.

gsnedders commented 9 years ago

@nolanw AFAICT, there's not really any de-facto agreement as to what to do with Ruby, whether browsers are going to implement it (and whether the WHATWG spec will then follow).

nostrademons commented 9 years ago

I'd asked in #51 which version of the spec I should be following for , and was told that the W3C version has been implemented in Webkit and Gecko and was underway in Blink, and the WhatWG version would presumably be updated to match shortly. This is a one-off exception from the general guidelines that the WhatWG spec is more current.

My main concern is that there are 9 other html5lib ruby tests that follow the W3C version, and so it seems like we should at least be consistent within the same file.

gsnedders commented 9 years ago

Oh, sorry, I've obviously not been paying enough attention to what's been implemented. :)

As far as I can tell, re: your question above, the expectation should be:

<html html>
  <html head>
  <html body>
    <html ruby>
      "a"
      <html rtc>
        "b"
        <html rp>

So yes, I agree the test is wrong. (This is also the tree a UA would produce with no Ruby support!)