New issue
Advanced search Search tips
Starred by 4 users

Issue metadata

Status: Untriaged
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

<script defer> not deferred in XHTML

Reported by typhoonh...@gmail.com, Aug 16

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134

Example URL:

Steps to reproduce the problem:
1. Create a file named test.xhtml and a file named test.html, both with the content below:
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Script Defer Test</title><script src="test.js" defer="defer"></script></head><body><div id="test"></div></body></html>

2. Create a file named test.js with the content below:
console.log(document.getElementById("test"));

3. Open each file and compare the console log

What is the expected behavior?
Both have <div id="test"></div>

What went wrong?
The HTML file has the expected output while the XHTML file has null

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? No 

Does this work in other browsers? Yes

Chrome version: 64.0.3282.140  Channel: n/a
OS Version: 10.0
Flash Version: 

This bug was first reported in #611136, which is closed as "won't fix". More than 2 years have passed and the bug remains. Microsoft Edge and Firefox do not have the same bug. I hope the team will reconsider fixing this bug.
 
Components: -Blink Blink>Loader
Components: Blink>HTML
Labels: Needs-Milestone
Cc: hirosh...@chromium.org kouhei@chromium.org
Components: -Blink>HTML Blink>HTML>Script
Owner: kouhei@chromium.org
Status: Untriaged (was: Unconfirmed)
I can reproduce the issue. Kouhei, can you take a look?

Sign in to add a comment