Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[innerText] <source> inside <audio> should always return textContent because it is never being rendered #12580

Closed
timdream opened this issue Aug 20, 2018 · 6 comments

Comments

@timdream
Copy link

I am looking at getter-tests.js at here. According to the DOM spec here it asks innerText to return the same value as the textContent IDL attribute on this element when the element is not "being rendered".

The tests here (and two lines below for <video>) however expect an empty string.

This only passes on Gecko and marked as failing on Chromium.

Should this test be corrected?

@timdream
Copy link
Author

(Context: I was trying to enable https://bugzilla.mozilla.org/show_bug.cgi?id=1484048 which changes the behavior of Gecko. It would happen to align with Chromium and fail on these two tests.)

@emilio
Copy link
Contributor

emilio commented Aug 20, 2018

I filed whatwg/html#3947 for display: contents, but I think this is just a Gecko bug in the innerText implementation. The spec uses being rendered, but gecko uses "is or has any ancestor with display: none", which is not the same for fallback content for <canvas>, for example.

I think all the tests here should output the same:

<!doctype html>
<video>
  <source style="display: block">
</video>
<audio>
  <source id="audio-source" style="display: block">
</audio>
<canvas>
  <div></div>
</canvas>
<div id="display-none" style="display: none"></div>
<pre>
<script>
  function test(selector) {
    let el = document.querySelector(selector);
    el.textContent = "abc";
    document.writeln("\"" + selector + "\" innerText: \"" + el.innerText + "\", textContent: \"" + el.textContent + "\"");
  }

  test("div");
  test("source");
  test("#audio-source");
  test("#display-none");
</script>
</pre>

@annevk do you agree?

@emilio
Copy link
Contributor

emilio commented Aug 20, 2018

TL;DR: I think that the test and Gecko should be fixed.

@emilio
Copy link
Contributor

emilio commented Aug 20, 2018

@emilio
Copy link
Contributor

emilio commented Nov 16, 2018

This is fixed there.

@annevk
Copy link
Member

annevk commented Nov 19, 2018

Thanks @emilio, sorry for missing your question!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants