Open Bug 957054 Opened 11 years ago Updated 7 months ago

Don't preload scripts with unknown types

Categories

(Core :: DOM: HTML Parser, task, P3)

task

Tracking

()

People

(Reporter: hsivonen, Unassigned)

References

Details

(Keywords: good-first-bug, parity-chrome, parity-safari)

Attachments

(1 file)

Bulk-downgrade of unassigned, 4 years untouched DOM/Storage bugs' priority.

If you have reason to believe this is wrong (especially for the severity), please write a comment and ni :jstutte.

Severity: normal → S4
Priority: -- → P5

Chrome has fixed their corresponding bug: https://bugs.chromium.org/p/chromium/issues/detail?id=626321

Severity: S4 → S3
Keywords: good-first-bug
Priority: P5 → P3

If chrome as fixed their corresponding bug does it also gets fixed on mozilla? If not then i would like to work on this bug.

(In reply to yanshrey from comment #4)

If not then i would like to work on this bug.

That would be great. See https://searchfox.org/mozilla-central/rev/1ebc9745be02eebf7a694f5c527a44a045b8c97a/parser/html/nsHtml5TreeBuilderCppSupplement.h#207 for the starting point.

Hi,
Is anyone still working on this bug?
If not want to give it a shot

I was looking into but but you can also go ahead and try it.
Check comment #5

Fixing bug 1848311 would have the side effect of fixing this.

Duplicate of this bug: 1848311

Not only should we not preload unknown type, we should not create speculations when seeing unknown types.

From the bug I marked as duplicate:

We should check for IE event handler scripts and unsupported type/language combinations in the HTML parser already (not just in ScriptLoader) to avoid creating speculations or preloads for scripts that will not execute anyway.

Based on
https://html.spec.whatwg.org/multipage/scripting.html#prepare-a-script

This affects mSpeculativeLoadQueue. I didn't change the behavior of
mCurrentHtmlScriptCannotDocumentWriteOrBlock.

Assignee: nobody → mathew.hodson
Status: NEW → ASSIGNED
Type: defect → task
Attachment #9379383 - Attachment description: Bug 957054 - Don't preload scripts with unknown type r?smaug → WIP: Bug 957054 - Don't preload scripts with unknown type

I'm currently stuck trying to implement your suggestion to handle ScriptKind::eEvent like mozilla::dom::IsScriptEventHandler does. There isn't an nsHtml5AttributeName::ATTR_EVENT that I would need to detect an event attribute on a <script> element.

Flags: needinfo?(hsivonen)
Depends on: 1884108

Sorry about the delay. Indeed, ATTR_EVENT is needed and missing. I'm adding it in bug 1884108.

Flags: needinfo?(hsivonen)

This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit BugBot documentation.

Assignee: mathew.hodson → nobody
Status: ASSIGNED → NEW
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: