Backed out changeset 4a4d5e64aec5 (bug 1846178) for causing mochitest failures on test_script_loader_js_cache.html/cache_module.html CLOSED TREE

This commit is contained in:
Norisz Fay 2023-08-23 11:19:39 +03:00
Родитель 6449bea3b8
Коммит c5e74dfe84
23 изменённых файлов: 142 добавлений и 373 удалений

Просмотреть файл

@ -10894,7 +10894,7 @@ _ZN5style7stylist7Stylist17remove_stylesheet17hfe4c712439a88006E
?FireScrollPortEvent@ScrollFrameHelper@mozilla@@QAE?AW4nsresult@@XZ
??$RemoveElement@PAVnsAPostRefreshObserver@@@?$nsAutoTObserverArray@PAVnsAPostRefreshObserver@@$0A@@@QAE_NABQAVnsAPostRefreshObserver@@@Z
?ToJSValue@dom@mozilla@@YA_NPAUJSContext@@ABV?$Rooted@VValue@JS@@@JS@@V?$MutableHandle@VValue@JS@@@5@@Z
??$destroy@V?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScriptThatMayDocumentWriteOrBlock@@UopRunScriptThatCannotDocumentWriteOrBlock@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@mozilla@@@?$VariantImplementation@E$0BG@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@detail@mozilla@@SAXAAV?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScriptThatMayDocumentWriteOrBlock@@UopRunScriptThatCannotDocumentWriteOrBlock@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCre
??$destroy@V?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScript@@UopRunScriptAsyncDefer@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@mozilla@@@?$VariantImplementation@E$0BG@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@detail@mozilla@@SAXAAV?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScript@@UopRunScriptAsyncDefer@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCre
?UnbindFromTree@SVGSVGElement@dom@mozilla@@UAEX_N@Z
?ClearMilestones@SMILTimeContainer@mozilla@@QAEXXZ
?AnimationNeedsResample@SVGElement@dom@mozilla@@QAEXXZ
@ -13354,7 +13354,7 @@ _ZN5style10properties9longhands9fill_rule16cascade_property17h9aad254200b7c674E
?EnsureBufferSpace@nsHtml5Tokenizer@@QAE_NH@Z
?tokenizeBuffer@nsHtml5Tokenizer@@QAE_NPAVnsHtml5UTF16Buffer@@@Z
?ParseDocument@nsHtml5StringParser@@QAE?AW4nsresult@@ABV?$nsTSubstring@_S@@PAVDocument@dom@mozilla@@_N@Z
??4?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScriptThatMayDocumentWriteOrBlock@@UopRunScriptThatCannotDocumentWriteOrBlock@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@mozilla@@QAEAAV01@ABV01@@Z
??4?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScript@@UopRunScriptAsyncDefer@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@mozilla@@QAEAAV01@ABV01@@Z
?newLocalNameFromBuffer@nsHtml5Portability@@SAPAVnsAtom@@PA_SHPAVnsHtml5AtomTable@@@Z
?newStringFromBuffer@nsHtml5Portability@@SA?AVnsHtml5String@@PA_SHHPAVnsHtml5TreeBuilder@@_N@Z
?FromBuffer@nsHtml5String@@SA?AV1@PA_SHPAVnsHtml5TreeBuilder@@@Z
@ -13362,7 +13362,7 @@ _ZN5style10properties9longhands9fill_rule16cascade_property17h9aad254200b7c674E
?Active@DOMMediaStream@mozilla@@QBE_NXZ
??0nsHtml5HtmlAttributes@@QAE@H@Z
?addAttribute@nsHtml5HtmlAttributes@@QAEXPAVnsHtml5AttributeName@@VnsHtml5String@@H@Z
??$copyConstruct@V?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScriptThatMayDocumentWriteOrBlock@@UopRunScriptThatCannotDocumentWriteOrBlock@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@mozilla@@@?$VariantImplementation@E$0BC@UopGetFosterParent@@UopMarkAsBroken@@UopRunScriptThatMayDocumentWriteOrBlock@@UopRunScriptThatCannotDocumentWriteOrBlock@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@detail@mozilla@@SAXPAXABV?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScriptThatMayDocumentWriteOrBlock@@
??$copyConstruct@V?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScript@@UopRunScriptAsyncDefer@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@mozilla@@@?$VariantImplementation@E$0BC@UopGetFosterParent@@UopMarkAsBroken@@UopRunScript@@UopRunScriptAsyncDefer@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@detail@mozilla@@SAXPAXABV?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScript@@
?_Target_type@?$_Func_impl_no_alloc@P6A_NVTimeStamp@mozilla@@@Z_NV12@@std@@EBEABVtype_info@@XZ
?eof@nsHtml5Tokenizer@@QAEXXZ
?StreamEnded@nsHtml5TreeBuilder@@QAEXXZ

Просмотреть файл

@ -12409,7 +12409,7 @@ skcms_TransferFunction_invert
?NS_NewSVGCircleElement@@YA?AW4nsresult@@PEAPEAVnsIContent@@$$QEAU?$already_AddRefed@VNodeInfo@dom@mozilla@@@@@Z
?GetLengthInfo@SVGCircleElement@dom@mozilla@@MEAA?AULengthAttributesInfo@SVGElement@23@XZ
?ToString@SVGAttrValueWrapper@mozilla@@SAXPEBVSVGTransformList@2@AEAV?$nsTSubstring@_S@@@Z
??$destroy@V?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScriptThatMayDocumentWriteOrBlock@@UopRunScriptThatCannotDocumentWriteOrBlock@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@mozilla@@@?$VariantImplementation@E$0BG@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@detail@mozilla@@SAXAEAV?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScriptThatMayDocumentWriteOrBlock@@UopRunScriptThatCannotDocumentWriteOrBlock@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCr
??$destroy@V?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScript@@UopRunScriptAsyncDefer@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@mozilla@@@?$VariantImplementation@E$0BG@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@detail@mozilla@@SAXAEAV?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScript@@UopRunScriptAsyncDefer@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCr
?UnbindFromTree@SVGSVGElement@dom@mozilla@@UEAAX_N@Z
?GetParentTime@SMILTimeContainer@mozilla@@UEBA_JXZ
?AnimationNeedsResample@SVGElement@dom@mozilla@@QEAAXXZ
@ -13486,13 +13486,13 @@ ZN5style10properties9longhands9fill_rule16cascade_property17hb0caefa465b1b9f9E
?Start@nsHtml5TreeOpExecutor@@QEAAXXZ
?tokenizeBuffer@nsHtml5Tokenizer@@QEAA_NPEAVnsHtml5UTF16Buffer@@@Z
?ParseDocument@nsHtml5StringParser@@QEAA?AW4nsresult@@AEBV?$nsTSubstring@_S@@PEAVDocument@dom@mozilla@@_N@Z
??4?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScriptThatMayDocumentWriteOrBlock@@UopRunScriptThatCannotDocumentWriteOrBlock@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@mozilla@@QEAAAEAV01@AEBV01@@Z
??4?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScript@@UopRunScriptAsyncDefer@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@mozilla@@QEAAAEAV01@AEBV01@@Z
?newLocalNameFromBuffer@nsHtml5Portability@@SAPEAVnsAtom@@PEA_SHPEAVnsHtml5AtomTable@@@Z
?newStringFromBuffer@nsHtml5Portability@@SA?AVnsHtml5String@@PEA_SHHPEAVnsHtml5TreeBuilder@@_N@Z
?CopyFrom@?$Buffer@E@mozilla@@SA?AV?$Maybe@V?$Buffer@E@mozilla@@@2@V?$Span@$$CBE$0?0@2@@Z
?PassThrough@AudioNode@dom@mozilla@@QEBA_NXZ
?addAttribute@nsHtml5HtmlAttributes@@QEAAXPEAVnsHtml5AttributeName@@VnsHtml5String@@H@Z
??$copyConstruct@V?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScriptThatMayDocumentWriteOrBlock@@UopRunScriptThatCannotDocumentWriteOrBlock@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@mozilla@@@?$VariantImplementation@E$0BB@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScriptThatMayDocumentWriteOrBlock@@UopRunScriptThatCannotDocumentWriteOrBlock@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@detail@mozilla@@SAXPEAXAEBV?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterPa
??$copyConstruct@V?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScript@@UopRunScriptAsyncDefer@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@mozilla@@@?$VariantImplementation@E$0BB@UopGetDocumentFragmentForTemplate@@UopGetFosterParent@@UopMarkAsBroken@@UopRunScript@@UopRunScriptAsyncDefer@@UopPreventScriptExecution@@UopDoneAddingChildren@@UopDoneCreatingElement@@UopSetDocumentCharset@@UopCharsetSwitchTo@@UopUpdateStyleSheet@@UopProcessOfflineManifest@@UopMarkMalformedIfScript@@UopStreamEnded@@UopSetStyleLineNumber@@UopSetScriptLineAndColumnNumberAndFreeze@@UopSvgLoad@@UopMaybeComplainAboutCharset@@UopMaybeComplainAboutDeepTree@@UopAddClass@@UopAddViewSourceHref@@UopAddViewSourceBase@@UopAddErrorType@@UopAddLineNumberId@@UopStartLayout@@UopEnableEncodingMenu@@@detail@mozilla@@SAXPEAXAEBV?$Variant@Uuninitialized@@UopAppend@@UopDetach@@UopAppendChildrenToNewParent@@UopFosterParent@@UopAppendToDocument@@UopAddAttributes@@W4nsHtml5DocumentMode@@UopCreateHTMLElement@@UopCreateSVGElement@@UopCreateMathMLElement@@UopSetFormElement@@UopAppendText@@UopFosterParentText@@UopAppendComment@@UopAppendCommentToDocument@@UopAppendDoctypeToDocument@@UopGetDocumentFragmentForTemplate@@UopGetFosterPa
?_Target_type@?$_Func_impl_no_alloc@P6A_NVTimeStamp@mozilla@@@Z_NV12@@std@@EEBAAEBVtype_info@@XZ
?eof@nsHtml5Tokenizer@@QEAAXXZ
?StreamEnded@nsHtml5TreeBuilder@@QEAAXXZ

Просмотреть файл

@ -21,8 +21,6 @@
#include "js/loader/ScriptLoadRequest.h"
#include "js/loader/ModuleLoaderBase.h"
#include "js/loader/ModuleLoadRequest.h"
#include "mozilla/Assertions.h"
#include "nsError.h"
#include "xpcpublic.h"
#include "GeckoProfiler.h"
#include "nsContentSecurityManager.h"
@ -129,15 +127,6 @@ nsresult ModuleLoader::StartFetch(ModuleLoadRequest* aRequest) {
return NS_OK;
}
void ModuleLoader::AsyncExecuteInlineModule(ModuleLoadRequest* aRequest) {
MOZ_ASSERT(aRequest->IsFinished());
MOZ_ASSERT(aRequest->IsTopLevel());
MOZ_ASSERT(aRequest->GetScriptLoadContext()->mIsInline);
GetScriptLoader()->MaybeMoveToLoadedList(aRequest);
GetScriptLoader()->ProcessPendingRequests();
aRequest->GetScriptLoadContext()->MaybeUnblockOnload();
}
void ModuleLoader::OnModuleLoadComplete(ModuleLoadRequest* aRequest) {
MOZ_ASSERT(aRequest->IsFinished());
@ -146,25 +135,6 @@ void ModuleLoader::OnModuleLoadComplete(ModuleLoadRequest* aRequest) {
aRequest->GetScriptLoadContext()->GetParserCreated() ==
NOT_FROM_PARSER) {
GetScriptLoader()->RunScriptWhenSafe(aRequest);
} else if (aRequest->GetScriptLoadContext()->mIsInline &&
aRequest->GetScriptLoadContext()->GetParserCreated() !=
NOT_FROM_PARSER &&
!nsContentUtils::IsSafeToRunScript()) {
// Avoid giving inline async module scripts that don't have
// external dependencies a guaranteed execution time relative
// to the HTML parse. That is, deliberately avoid guaranteeing
// that the script would always observe a DOM shape where the
// parser has not added further elements to the DOM.
// (If `nsContentUtils::IsSafeToRunScript()` returns `true`,
// we come here synchronously from the parser. If it returns
// `false` we come here from an external dependency completing
// its fetch, in which case we already are at an unspecific
// point relative to the parse.)
MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(
mozilla::NewRunnableMethod<RefPtr<ModuleLoadRequest>>(
"ModuleLoader::AsyncExecuteInlineModule", this,
&ModuleLoader::AsyncExecuteInlineModule, aRequest)));
return;
} else {
GetScriptLoader()->MaybeMoveToLoadedList(aRequest);
GetScriptLoader()->ProcessPendingRequestsAsync();

Просмотреть файл

@ -80,8 +80,6 @@ class ModuleLoader final : public JS::loader::ModuleLoaderBase {
return static_cast<ModuleLoader*>(aLoader);
}
void AsyncExecuteInlineModule(ModuleLoadRequest* aRequest);
private:
const Kind mKind;
};

Просмотреть файл

@ -28,19 +28,6 @@ ScriptElement::ScriptAvailable(nsresult aResult, nsIScriptElement* aElement,
uint32_t aLineNo) {
if (!aIsInlineClassicScript && NS_FAILED(aResult)) {
nsCOMPtr<nsIParser> parser = do_QueryReferent(mCreatorParser);
if (parser) {
nsCOMPtr<nsIContentSink> sink = parser->GetContentSink();
if (sink) {
nsCOMPtr<Document> parserDoc = do_QueryInterface(sink->GetTarget());
if (GetAsContent()->OwnerDoc() != parserDoc) {
// Suppress errors when we've moved between docs.
// /html/semantics/scripting-1/the-script-element/moving-between-documents/move-back-iframe-fetch-error-external-module.html
// See also https://bugzilla.mozilla.org/show_bug.cgi?id=1849107
return NS_OK;
}
}
}
if (parser) {
parser->IncrementScriptNestingLevel();
}
@ -185,7 +172,7 @@ bool ScriptElement::MaybeProcessScript() {
if (sink) {
nsCOMPtr<Document> parserDoc = do_QueryInterface(sink->GetTarget());
if (ownerDoc != parserDoc) {
// Refactor this: https://bugzilla.mozilla.org/show_bug.cgi?id=1849107
// Willful violation of HTML5 as of 2010-12-01
return false;
}
}

Просмотреть файл

@ -1091,8 +1091,7 @@ bool ScriptLoader::ProcessExternalScript(nsIScriptElement* aElement,
if (request->GetScriptLoadContext()->IsDeferredScript()) {
// We don't want to run this yet.
// If we come here, the script is a parser-created script and it has
// the defer attribute but not the async attribute OR it is a module
// script without the async attribute. Since a
// the defer attribute but not the async attribute. Since a
// a parser-inserted script is being run, we came here by the parser
// running the script, which means the parser is still alive and the
// parse is ongoing.
@ -3545,14 +3544,12 @@ void ScriptLoader::ParsingComplete(bool aTerminated) {
}
}
void ScriptLoader::PreloadURI(nsIURI* aURI, const nsAString& aCharset,
const nsAString& aType,
const nsAString& aCrossOrigin,
const nsAString& aNonce,
const nsAString& aIntegrity, bool aScriptFromHead,
bool aAsync, bool aDefer, bool aLinkPreload,
const ReferrerPolicy aReferrerPolicy,
uint64_t aEarlyHintPreloaderId) {
void ScriptLoader::PreloadURI(
nsIURI* aURI, const nsAString& aCharset, const nsAString& aType,
const nsAString& aCrossOrigin, const nsAString& aNonce,
const nsAString& aIntegrity, bool aScriptFromHead, bool aAsync, bool aDefer,
bool aNoModule, bool aLinkPreload, const ReferrerPolicy aReferrerPolicy,
uint64_t aEarlyHintPreloaderId) {
NS_ENSURE_TRUE_VOID(mDocument);
// Check to see if scripts has been turned off.
if (!mEnabled || !mDocument->IsScriptEnabled()) {
@ -3561,6 +3558,11 @@ void ScriptLoader::PreloadURI(nsIURI* aURI, const nsAString& aCharset,
ScriptKind scriptKind = ScriptKind::eClassic;
// Don't load nomodule scripts.
if (aNoModule) {
return;
}
static const char kASCIIWhitespace[] = "\t\n\f\r ";
nsAutoString type(aType);

Просмотреть файл

@ -380,7 +380,7 @@ class ScriptLoader final : public JS::loader::ScriptLoaderInterface {
const nsAString& aType, const nsAString& aCrossOrigin,
const nsAString& aNonce, const nsAString& aIntegrity,
bool aScriptFromHead, bool aAsync, bool aDefer,
bool aLinkPreload,
bool aNoModule, bool aLinkPreload,
const ReferrerPolicy aReferrerPolicy,
uint64_t aEarlyHintPreloaderId);

Просмотреть файл

@ -6048,7 +6048,7 @@ public abstract class TreeBuilder<T> implements TokenHandler,
@SuppressWarnings("unchecked") public void loadState(
TreeBuilderState<T> snapshot)
throws SAXException {
// CPPONLY: mCurrentHtmlScriptCannotDocumentWriteOrBlock = false;
// CPPONLY: mCurrentHtmlScriptIsAsyncOrDefer = false;
StackNode<T>[] stackCopy = snapshot.getStack();
int stackLen = snapshot.getStackLength();
StackNode<T>[] listCopy = snapshot.getListOfActiveFormattingElements();

Просмотреть файл

@ -335,7 +335,7 @@ nsresult nsHtml5Parser::Parse(const nsAString& aSourceBuffer, void* aKey,
mTokenizer->setLineNumber(lineNumberSave);
}
if (mTreeBuilder->HasScriptThatMayDocumentWriteOrBlock()) {
if (mTreeBuilder->HasScript()) {
auto r = mTreeBuilder->Flush(); // Move ops to the executor
if (r.isErr()) {
return executor->MarkAsBroken(r.unwrapErr());
@ -626,7 +626,7 @@ nsresult nsHtml5Parser::ParseUntilBlocked() {
if (inRootContext) {
mRootContextLineNumber = mTokenizer->getLineNumber();
}
if (mTreeBuilder->HasScriptThatMayDocumentWriteOrBlock()) {
if (mTreeBuilder->HasScript()) {
auto r = mTreeBuilder->Flush();
if (r.isErr()) {
return mExecutor->MarkAsBroken(r.unwrapErr());

Просмотреть файл

@ -64,14 +64,32 @@ void nsHtml5SpeculativeLoad::Perform(nsHtml5TreeOpExecutor* aExecutor) {
mUrlOrSizes, mCharsetOrSrcset,
mTypeOrCharsetSourceOrDocumentModeOrMetaCSPOrSizesOrIntegrity,
mCrossOrigin, mMedia, mNonce, mReferrerPolicyOrIntegrity,
mScriptReferrerPolicy, false, mIsAsync, mIsDefer, mIsLinkPreload);
mScriptReferrerPolicy, false, mIsAsync, mIsDefer, false,
mIsLinkPreload);
break;
case eSpeculativeLoadScriptFromHead:
aExecutor->PreloadScript(
mUrlOrSizes, mCharsetOrSrcset,
mTypeOrCharsetSourceOrDocumentModeOrMetaCSPOrSizesOrIntegrity,
mCrossOrigin, mMedia, mNonce, mReferrerPolicyOrIntegrity,
mScriptReferrerPolicy, true, mIsAsync, mIsDefer, mIsLinkPreload);
mScriptReferrerPolicy, true, mIsAsync, mIsDefer, false,
mIsLinkPreload);
break;
case eSpeculativeLoadNoModuleScript:
aExecutor->PreloadScript(
mUrlOrSizes, mCharsetOrSrcset,
mTypeOrCharsetSourceOrDocumentModeOrMetaCSPOrSizesOrIntegrity,
mCrossOrigin, mMedia, mNonce, mReferrerPolicyOrIntegrity,
mScriptReferrerPolicy, false, mIsAsync, mIsDefer, true,
mIsLinkPreload);
break;
case eSpeculativeLoadNoModuleScriptFromHead:
aExecutor->PreloadScript(
mUrlOrSizes, mCharsetOrSrcset,
mTypeOrCharsetSourceOrDocumentModeOrMetaCSPOrSizesOrIntegrity,
mCrossOrigin, mMedia, mNonce, mReferrerPolicyOrIntegrity,
mScriptReferrerPolicy, true, mIsAsync, mIsDefer, true,
mIsLinkPreload);
break;
case eSpeculativeLoadStyle:
aExecutor->PreloadStyle(

Просмотреть файл

@ -24,6 +24,8 @@ enum eHtml5SpeculativeLoad {
eSpeculativeLoadPictureSource,
eSpeculativeLoadScript,
eSpeculativeLoadScriptFromHead,
eSpeculativeLoadNoModuleScript,
eSpeculativeLoadNoModuleScriptFromHead,
eSpeculativeLoadStyle,
eSpeculativeLoadManifest,
eSpeculativeLoadSetDocumentCharset,
@ -169,11 +171,17 @@ class nsHtml5SpeculativeLoad {
nsHtml5String aMedia, nsHtml5String aNonce,
nsHtml5String aIntegrity,
nsHtml5String aReferrerPolicy, bool aParserInHead,
bool aAsync, bool aDefer, bool aLinkPreload) {
bool aAsync, bool aDefer, bool aNoModule,
bool aLinkPreload) {
MOZ_ASSERT(mOpCode == eSpeculativeLoadUninitialized,
"Trying to reinitialize a speculative load!");
mOpCode =
aParserInHead ? eSpeculativeLoadScriptFromHead : eSpeculativeLoadScript;
if (aNoModule) {
mOpCode = aParserInHead ? eSpeculativeLoadNoModuleScriptFromHead
: eSpeculativeLoadNoModuleScript;
} else {
mOpCode = aParserInHead ? eSpeculativeLoadScriptFromHead
: eSpeculativeLoadScript;
}
aUrl.ToString(mUrlOrSizes);
aCharset.ToString(mCharsetOrSrcset);
aType.ToString(

Просмотреть файл

@ -2479,9 +2479,9 @@ void nsHtml5StreamParser::ParseAvailableData() {
MarkAsBroken(rv);
return;
}
if (mTreeBuilder->HasScriptThatMayDocumentWriteOrBlock()) {
// `HasScriptThatMayDocumentWriteOrBlock()` cannot return true if the
// tree builder is preventing script execution.
if (mTreeBuilder->HasScript()) {
// HasScript() cannot return true if the tree builder is preventing
// script execution.
MOZ_ASSERT(mMode == NORMAL);
mozilla::MutexAutoLock speculationAutoLock(mSpeculationMutex);
nsHtml5Speculation* speculation = new nsHtml5Speculation(

Просмотреть файл

@ -4615,7 +4615,7 @@ bool nsHtml5TreeBuilder::snapshotMatches(nsAHtml5TreeBuilderState* snapshot) {
}
void nsHtml5TreeBuilder::loadState(nsAHtml5TreeBuilderState* snapshot) {
mCurrentHtmlScriptCannotDocumentWriteOrBlock = false;
mCurrentHtmlScriptIsAsyncOrDefer = false;
jArray<nsHtml5StackNode*, int32_t> stackCopy = snapshot->getStack();
int32_t stackLen = snapshot->getStackLength();
jArray<nsHtml5StackNode*, int32_t> listCopy =

Просмотреть файл

@ -42,7 +42,7 @@ nsHtml5TreeBuilder::nsHtml5TreeBuilder(nsHtml5OplessBuilder* aBuilder)
mHandlesUsed(0),
mSpeculativeLoadStage(nullptr),
mBroken(NS_OK),
mCurrentHtmlScriptCannotDocumentWriteOrBlock(false),
mCurrentHtmlScriptIsAsyncOrDefer(false),
mPreventScriptExecution(false),
mGenerateSpeculativeLoads(false),
mHasSeenImportMap(false)
@ -84,7 +84,7 @@ nsHtml5TreeBuilder::nsHtml5TreeBuilder(nsAHtml5TreeOpSink* aOpSink,
mHandlesUsed(0),
mSpeculativeLoadStage(aStage),
mBroken(NS_OK),
mCurrentHtmlScriptCannotDocumentWriteOrBlock(false),
mCurrentHtmlScriptIsAsyncOrDefer(false),
mPreventScriptExecution(false),
mGenerateSpeculativeLoads(aGenerateSpeculativeLoads),
mHasSeenImportMap(false)
@ -232,111 +232,41 @@ nsIContentHandle* nsHtml5TreeBuilder::createElement(
aAttributes->getValue(nsHtml5AttributeName::ATTR_TYPE);
nsAutoString typeString;
type.ToString(typeString);
// Since `typeString` after trimming and lowercasing is only checked
// for "module" and " importmap", we don't need to remember
// pre-trimming emptiness here.
// ASCII whitespace https://infra.spec.whatwg.org/#ascii-whitespace:
// U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, or U+0020 SPACE.
static const char kASCIIWhitespace[] = "\t\n\f\r ";
typeString.Trim(kASCIIWhitespace);
bool isModule = typeString.LowerCaseEqualsASCII("module");
bool importmap = typeString.LowerCaseEqualsASCII("importmap");
bool async = false;
bool defer = false;
bool nomodule =
aAttributes->contains(nsHtml5AttributeName::ATTR_NOMODULE);
// For microtask semantics, we need to queue either
// `opRunScriptThatMayDocumentWriteOrBlock` or
// `opRunScriptThatCannotDocumentWriteOrBlock` for every script
// element--even ones that we already know won't run.
// `mCurrentHtmlScriptCannotDocumentWriteOrBlock` controls which
// kind of operation is used for an HTML script, and this is the
// place where `mCurrentHtmlScriptCannotDocumentWriteOrBlock`
// needs to be set correctly.
//
// Non-async, non-defer classic scripts that will run MUST use
// `opRunScriptThatMayDocumentWriteOrBlock` in order to run
// the more complex code that
// 1. is able to resume the HTML parse after a parser-blocking
// scripts no longer blocks the parser
// 2. is able to receive more content to parse on the main thread
// via document.write
// 3. is able to throw away off-the-main-thread parsing results
// if what's document.written on the main thread invalidates
// the speculation.
//
// Async and defer classic scripts as well as module scripts and
// importmaps MUST use `opRunScriptThatCannotDocumentWriteOrBlock`.
// This is necessary particularly because the relevant main-thread
// code assumes it doesn't need to deal with resuming the HTML
// parse some time afterwards, so using a tree operation with
// mismatching expectations regarding that responsibility may
// cause the HTML parse to stall.
//
// Various scripts that won't actually run work with either type
// of tree op in the sense that the HTML parse won't stall.
// However, in the case where a script cannot block or insert
// data to the HTML parser via document.write, unnecessary use
// of `opRunScriptThatMayDocumentWriteOrBlock` instead of
// `opRunScriptThatCannotDocumentWriteOrBlock` causes the HTML
// parser to enter the speculative mode when doing so isn't
// actually required.
//
// Ideally, we would check for `type`/`language` attribute
// combinations that are known to cause non-execution as well as
// ScriptLoader::IsScriptEventHandler equivalent. That way, we
// wouldn't unnecessarily speculate after scripts that won't
// execute. https://bugzilla.mozilla.org/show_bug.cgi?id=1848311
if (importmap) {
if (!mHasSeenImportMap) {
// If we see an importmap, we don't want to later start speculative
// loads for modulepreloads, since such load might finish before
// the importmap is created. This also applies to module scripts so
// that any modulepreload integrity checks can be performed before
// the modules scripts are loaded.
// This state is not part of speculation rollback: If an importmap
// is seen speculatively and the speculation is rolled back, the
// importmap is still considered seen.
// TODO: Sync importmap seenness between the main thread and the
// parser thread.
// https://bugzilla.mozilla.org/show_bug.cgi?id=1848312
mHasSeenImportMap = true;
mHasSeenImportMap =
typeString.LowerCaseFindASCII("importmap") != kNotFound;
}
nsHtml5String url =
aAttributes->getValue(nsHtml5AttributeName::ATTR_SRC);
if (url) {
async = aAttributes->contains(nsHtml5AttributeName::ATTR_ASYNC);
defer = aAttributes->contains(nsHtml5AttributeName::ATTR_DEFER);
if ((isModule && !mHasSeenImportMap) ||
(!isModule && !importmap && !nomodule)) {
nsHtml5String charset =
aAttributes->getValue(nsHtml5AttributeName::ATTR_CHARSET);
nsHtml5String crossOrigin =
aAttributes->getValue(nsHtml5AttributeName::ATTR_CROSSORIGIN);
nsHtml5String nonce =
aAttributes->getValue(nsHtml5AttributeName::ATTR_NONCE);
nsHtml5String integrity =
aAttributes->getValue(nsHtml5AttributeName::ATTR_INTEGRITY);
nsHtml5String referrerPolicy = aAttributes->getValue(
nsHtml5AttributeName::ATTR_REFERRERPOLICY);
mSpeculativeLoadQueue.AppendElement()->InitScript(
url, charset, type, crossOrigin, /* aMedia = */ nullptr,
nonce, integrity, referrerPolicy,
mode == nsHtml5TreeBuilder::IN_HEAD, async, defer, false);
}
if (url && !(mHasSeenImportMap &&
typeString.LowerCaseFindASCII("module") != kNotFound)) {
nsHtml5String charset =
aAttributes->getValue(nsHtml5AttributeName::ATTR_CHARSET);
nsHtml5String crossOrigin =
aAttributes->getValue(nsHtml5AttributeName::ATTR_CROSSORIGIN);
nsHtml5String nonce =
aAttributes->getValue(nsHtml5AttributeName::ATTR_NONCE);
nsHtml5String integrity =
aAttributes->getValue(nsHtml5AttributeName::ATTR_INTEGRITY);
nsHtml5String referrerPolicy = aAttributes->getValue(
nsHtml5AttributeName::ATTR_REFERRERPOLICY);
bool async =
aAttributes->contains(nsHtml5AttributeName::ATTR_ASYNC);
bool defer =
aAttributes->contains(nsHtml5AttributeName::ATTR_DEFER);
bool noModule =
aAttributes->contains(nsHtml5AttributeName::ATTR_NOMODULE);
mSpeculativeLoadQueue.AppendElement()->InitScript(
url, charset, type, crossOrigin, /* aMedia = */ nullptr, nonce,
integrity, referrerPolicy, mode == nsHtml5TreeBuilder::IN_HEAD,
async, defer, noModule, false);
mCurrentHtmlScriptIsAsyncOrDefer = async || defer;
}
// `mCurrentHtmlScriptCannotDocumentWriteOrBlock` MUST be computed to
// match the ScriptLoader-perceived kind of the script regardless of
// enqueuing a speculative load. Scripts with the `nomodule` attribute
// never block or document.write: Either the attribute prevents a
// classic script execution or is ignored on a module script or
// importmap.
mCurrentHtmlScriptCannotDocumentWriteOrBlock =
isModule || importmap || async || defer || nomodule;
} else if (nsGkAtoms::link == aName) {
nsHtml5String rel =
aAttributes->getValue(nsHtml5AttributeName::ATTR_REL);
@ -404,7 +334,7 @@ nsIContentHandle* nsHtml5TreeBuilder::createElement(
mSpeculativeLoadQueue.AppendElement()->InitScript(
url, charset, type, crossOrigin, media, nonce, integrity,
referrerPolicy, mode == nsHtml5TreeBuilder::IN_HEAD,
false, false, true);
false, false, false, true);
} else if (as.LowerCaseEqualsASCII("style")) {
mSpeculativeLoadQueue.AppendElement()->InitStyle(
url, charset, crossOrigin, media, referrerPolicy, nonce,
@ -455,7 +385,7 @@ nsIContentHandle* nsHtml5TreeBuilder::createElement(
mSpeculativeLoadQueue.AppendElement()->InitScript(
url, charset, type, crossOrigin, media, nonce, integrity,
referrerPolicy, mode == nsHtml5TreeBuilder::IN_HEAD,
false, false, true);
false, false, false, true);
}
}
}
@ -555,7 +485,7 @@ nsIContentHandle* nsHtml5TreeBuilder::createElement(
mSpeculativeLoadQueue.AppendElement()->InitScript(
url, nullptr, type, crossOrigin, /* aMedia = */ nullptr, nonce,
integrity, referrerPolicy, mode == nsHtml5TreeBuilder::IN_HEAD,
false, false, false);
false, false, false, false);
}
} else if (nsGkAtoms::style == aName) {
mImportScanner.Start();
@ -591,44 +521,10 @@ nsIContentHandle* nsHtml5TreeBuilder::createElement(
content, tokenizer->getLineNumber(), tokenizer->getColumnNumber());
treeOp->Init(mozilla::AsVariant(operation));
if (aNamespace == kNameSpaceID_XHTML) {
// Although we come here in cases where the value of
// `mCurrentHtmlScriptCannotDocumentWriteOrBlock` doesn't actually
// matter, we also come here when parsing document.written content on
// the main thread. In that case, IT MATTERS that
// `mCurrentHtmlScriptCannotDocumentWriteOrBlock` is set correctly,
// so let's just always set it correctly even if it a bit of wasted work
// in the scenarios where no scripts execute and it doesn't matter.
//
// See the comments around generating speculative loads for HTML scripts
// elements for the details of when
// `mCurrentHtmlScriptCannotDocumentWriteOrBlock` needs to be set to
// `true` and when to `false`.
nsHtml5String type =
aAttributes->getValue(nsHtml5AttributeName::ATTR_TYPE);
nsAutoString typeString;
type.ToString(typeString);
// Since `typeString` after trimming and lowercasing is only checked
// for "module" and " importmap", we don't need to remember
// pre-trimming emptiness here.
// ASCII whitespace https://infra.spec.whatwg.org/#ascii-whitespace:
// U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, or U+0020 SPACE.
static const char kASCIIWhitespace[] = "\t\n\f\r ";
typeString.Trim(kASCIIWhitespace);
mCurrentHtmlScriptCannotDocumentWriteOrBlock =
typeString.LowerCaseEqualsASCII("module") ||
typeString.LowerCaseEqualsASCII("nomodule") ||
typeString.LowerCaseEqualsASCII("importmap");
if (!mCurrentHtmlScriptCannotDocumentWriteOrBlock &&
aAttributes->contains(nsHtml5AttributeName::ATTR_SRC)) {
mCurrentHtmlScriptCannotDocumentWriteOrBlock =
(aAttributes->contains(nsHtml5AttributeName::ATTR_ASYNC) ||
aAttributes->contains(nsHtml5AttributeName::ATTR_DEFER));
}
mCurrentHtmlScriptIsAsyncOrDefer =
aAttributes->contains(nsHtml5AttributeName::ATTR_SRC) &&
(aAttributes->contains(nsHtml5AttributeName::ATTR_ASYNC) ||
aAttributes->contains(nsHtml5AttributeName::ATTR_DEFER));
}
} else if (aNamespace == kNameSpaceID_XHTML) {
if (nsGkAtoms::html == aName) {
@ -1060,7 +956,7 @@ void nsHtml5TreeBuilder::markMalformedIfScript(nsIContentHandle* aElement) {
}
void nsHtml5TreeBuilder::start(bool fragment) {
mCurrentHtmlScriptCannotDocumentWriteOrBlock = false;
mCurrentHtmlScriptIsAsyncOrDefer = false;
#ifdef DEBUG
mActive = true;
#endif
@ -1192,7 +1088,7 @@ void nsHtml5TreeBuilder::elementPopped(int32_t aNamespace, nsAtom* aName,
if (mBuilder) {
return;
}
if (mCurrentHtmlScriptCannotDocumentWriteOrBlock) {
if (mCurrentHtmlScriptIsAsyncOrDefer) {
NS_ASSERTION(aNamespace == kNameSpaceID_XHTML,
"Only HTML scripts may be async/defer.");
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement(mozilla::fallible);
@ -1200,9 +1096,9 @@ void nsHtml5TreeBuilder::elementPopped(int32_t aNamespace, nsAtom* aName,
MarkAsBrokenAndRequestSuspensionWithoutBuilder(NS_ERROR_OUT_OF_MEMORY);
return;
}
opRunScriptThatCannotDocumentWriteOrBlock operation(aElement);
opRunScriptAsyncDefer operation(aElement);
treeOp->Init(mozilla::AsVariant(operation));
mCurrentHtmlScriptCannotDocumentWriteOrBlock = false;
mCurrentHtmlScriptIsAsyncOrDefer = false;
return;
}
requestSuspension();
@ -1211,7 +1107,7 @@ void nsHtml5TreeBuilder::elementPopped(int32_t aNamespace, nsAtom* aName,
MarkAsBrokenAndRequestSuspensionWithoutBuilder(NS_ERROR_OUT_OF_MEMORY);
return;
}
opRunScriptThatMayDocumentWriteOrBlock operation(aElement, nullptr);
opRunScript operation(aElement, nullptr);
treeOp->Init(mozilla::AsVariant(operation));
return;
}
@ -1356,12 +1252,12 @@ nsIContentHandle* nsHtml5TreeBuilder::AllocateContentHandle() {
return &mHandles[mHandlesUsed++];
}
bool nsHtml5TreeBuilder::HasScriptThatMayDocumentWriteOrBlock() {
bool nsHtml5TreeBuilder::HasScript() {
uint32_t len = mOpQueue.Length();
if (!len) {
return false;
}
return mOpQueue.ElementAt(len - 1).IsRunScriptThatMayDocumentWriteOrBlock();
return mOpQueue.ElementAt(len - 1).IsRunScript();
}
mozilla::Result<bool, nsresult> nsHtml5TreeBuilder::Flush(bool aDiscretionary) {
@ -1498,8 +1394,7 @@ void nsHtml5TreeBuilder::AddSnapshotToScript(
MOZ_ASSERT_UNREACHABLE("Must never use snapshots with builder.");
return;
}
MOZ_ASSERT(HasScriptThatMayDocumentWriteOrBlock(),
"No script to add a snapshot to!");
MOZ_ASSERT(HasScript(), "No script to add a snapshot to!");
MOZ_ASSERT(aSnapshot, "Got null snapshot.");
mOpQueue.ElementAt(mOpQueue.Length() - 1).SetSnapshot(aSnapshot, aLine);
}

Просмотреть файл

@ -23,18 +23,7 @@ int32_t mHandlesUsed;
nsTArray<mozilla::UniquePtr<nsIContent*[]>> mOldHandles;
nsHtml5TreeOpStage* mSpeculativeLoadStage;
nsresult mBroken;
// Controls whether the current HTML script goes through the more complex
// path that accommodates the possibility of the script becoming a
// parser-blocking script and the possibility of the script inserting
// content into this parse using document.write (as it is observable from
// the Web).
//
// Notably, in some cases scripts that do NOT NEED the more complex path
// BREAK the parse if they incorrectly go onto the complex path as their
// other handling doesn't necessarily take care of the responsibilities
// associated with the more complex path. See comments in
// `nsHtml5TreeBuilder::createElement` in the CppSupplement for details.
bool mCurrentHtmlScriptCannotDocumentWriteOrBlock;
bool mCurrentHtmlScriptIsAsyncOrDefer;
bool mPreventScriptExecution;
/**
* Whether to actually generate speculative load operations that actually
@ -117,7 +106,7 @@ void StartPlainText();
void StartPlainTextBody();
bool HasScriptThatMayDocumentWriteOrBlock();
bool HasScript();
void SetOpSink(nsAHtml5TreeOpSink* aOpSink) { mOpSink = aOpSink; }

Просмотреть файл

@ -738,7 +738,7 @@ void nsHtml5TreeOpExecutor::RunFlushLoop() {
#endif
} else if (scriptElement) {
// must be tail call when mFlushState is eNotFlushing
RunScript(scriptElement, true);
RunScript(scriptElement);
// Always check the clock in nsContentSink right after a script
StopDeflecting();
@ -843,7 +843,7 @@ nsresult nsHtml5TreeOpExecutor::FlushDocumentWrite() {
#endif
} else if (scriptElement) {
// must be tail call when mFlushState is eNotFlushing
RunScript(scriptElement, true);
RunScript(scriptElement);
}
return rv;
}
@ -909,13 +909,12 @@ void nsHtml5TreeOpExecutor::PauseDocUpdate(bool* aInterrupted) {
* before scripts run. This way, the tokenizer is not invoked re-entrantly
* although the parser is.
*
* The reason why this is called with `aMayDocumentWriteOrBlock=true` as a
* tail call when `mFlushState` is set to `eNotFlushing` is to allow re-entry
* to `Flush()` but only after the current `Flush()` has cleared the op queue
* and is otherwise done cleaning up after itself.
* The reason why this is called as a tail call when mFlushState is set to
* eNotFlushing is to allow re-entry to Flush() but only after the current
* Flush() has cleared the op queue and is otherwise done cleaning up after
* itself.
*/
void nsHtml5TreeOpExecutor::RunScript(nsIContent* aScriptElement,
bool aMayDocumentWriteOrBlock) {
void nsHtml5TreeOpExecutor::RunScript(nsIContent* aScriptElement) {
if (mRunsToCompletion) {
// We are in createContextualFragment() or in the upcoming document.parse().
// Do nothing. Let's not even mark scripts malformed here, because that
@ -932,24 +931,19 @@ void nsHtml5TreeOpExecutor::RunScript(nsIContent* aScriptElement,
return;
}
sele->SetCreatorParser(GetParser());
if (!aMayDocumentWriteOrBlock) {
MOZ_ASSERT(sele->GetScriptDeferred() || sele->GetScriptAsync() ||
sele->GetScriptIsModule() || sele->GetScriptIsImportMap() ||
aScriptElement->AsElement()->HasAttr(nsGkAtoms::nomodule));
if (sele->GetScriptDeferred() || sele->GetScriptAsync()) {
DebugOnly<bool> block = sele->AttemptToExecute();
MOZ_ASSERT(!block,
"Defer, async, module, importmap, or nomodule tried to block.");
NS_ASSERTION(!block, "Defer or async script tried to block.");
return;
}
MOZ_RELEASE_ASSERT(
mFlushState == eNotFlushing,
"Tried to run a potentially-blocking script while flushing.");
MOZ_RELEASE_ASSERT(mFlushState == eNotFlushing,
"Tried to run script while flushing.");
mReadingFromStage = false;
sele->SetCreatorParser(GetParser());
// Copied from nsXMLContentSink
// Now tell the script that it's ready to go. This may execute the script
// or return true, or neither if the script doesn't need executing.
@ -1213,7 +1207,7 @@ void nsHtml5TreeOpExecutor::PreloadScript(
const nsAString& aCrossOrigin, const nsAString& aMedia,
const nsAString& aNonce, const nsAString& aIntegrity,
dom::ReferrerPolicy aReferrerPolicy, bool aScriptFromHead, bool aAsync,
bool aDefer, bool aLinkPreload) {
bool aDefer, bool aNoModule, bool aLinkPreload) {
nsCOMPtr<nsIURI> uri = ConvertIfNotPreloadedYetAndMediaApplies(aURL, aMedia);
if (!uri) {
return;
@ -1224,8 +1218,8 @@ void nsHtml5TreeOpExecutor::PreloadScript(
}
mDocument->ScriptLoader()->PreloadURI(
uri, aCharset, aType, aCrossOrigin, aNonce, aIntegrity, aScriptFromHead,
aAsync, aDefer, aLinkPreload, GetPreloadReferrerPolicy(aReferrerPolicy),
0);
aAsync, aDefer, aNoModule, aLinkPreload,
GetPreloadReferrerPolicy(aReferrerPolicy), 0);
}
void nsHtml5TreeOpExecutor::PreloadStyle(

Просмотреть файл

@ -216,7 +216,7 @@ class nsHtml5TreeOpExecutor final
bool IsInFlushLoop() { return mRunFlushLoopOnStack; }
#endif
void RunScript(nsIContent* aScriptElement, bool aMayDocumentWriteOrBlock);
void RunScript(nsIContent* aScriptElement);
/**
* Flush the operations from the tree operations from the argument
@ -248,7 +248,8 @@ class nsHtml5TreeOpExecutor final
const nsAString& aMedia, const nsAString& aNonce,
const nsAString& aIntegrity,
ReferrerPolicy aReferrerPolicy, bool aScriptFromHead,
bool aAsync, bool aDefer, bool aLinkPreload);
bool aAsync, bool aDefer, bool aNoModule,
bool aLinkPreload);
void PreloadStyle(const nsAString& aURL, const nsAString& aCharset,
const nsAString& aCrossOrigin, const nsAString& aMedia,

Просмотреть файл

@ -138,10 +138,9 @@ nsHtml5TreeOperation::~nsHtml5TreeOperation() {
void operator()(const opMarkAsBroken& aOperation) {}
void operator()(const opRunScriptThatMayDocumentWriteOrBlock& aOperation) {}
void operator()(const opRunScript& aOperation) {}
void operator()(
const opRunScriptThatCannotDocumentWriteOrBlock& aOperation) {}
void operator()(const opRunScriptAsyncDefer& aOperation) {}
void operator()(const opPreventScriptExecution& aOperation) {}
@ -914,8 +913,7 @@ nsresult nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
return aOperation.mResult;
}
nsresult operator()(
const opRunScriptThatMayDocumentWriteOrBlock& aOperation) {
nsresult operator()(const opRunScript& aOperation) {
nsIContent* node = *(aOperation.mElement);
nsAHtml5TreeBuilderState* snapshot = aOperation.mBuilderState;
if (snapshot) {
@ -926,9 +924,8 @@ nsresult nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
return NS_OK;
}
nsresult operator()(
const opRunScriptThatCannotDocumentWriteOrBlock& aOperation) {
mBuilder->RunScript(*(aOperation.mElement), false);
nsresult operator()(const opRunScriptAsyncDefer& aOperation) {
mBuilder->RunScript(*(aOperation.mElement));
return NS_OK;
}

Просмотреть файл

@ -285,23 +285,22 @@ struct opMarkAsBroken {
explicit opMarkAsBroken(nsresult aResult) : mResult(aResult){};
};
struct opRunScriptThatMayDocumentWriteOrBlock {
struct opRunScript {
nsIContent** mElement;
nsAHtml5TreeBuilderState* mBuilderState;
int32_t mLineNumber;
explicit opRunScriptThatMayDocumentWriteOrBlock(
nsIContentHandle* aElement, nsAHtml5TreeBuilderState* aBuilderState)
explicit opRunScript(nsIContentHandle* aElement,
nsAHtml5TreeBuilderState* aBuilderState)
: mBuilderState(aBuilderState), mLineNumber(0) {
mElement = static_cast<nsIContent**>(aElement);
};
};
struct opRunScriptThatCannotDocumentWriteOrBlock {
struct opRunScriptAsyncDefer {
nsIContent** mElement;
explicit opRunScriptThatCannotDocumentWriteOrBlock(
nsIContentHandle* aElement) {
explicit opRunScriptAsyncDefer(nsIContentHandle* aElement) {
mElement = static_cast<nsIContent**>(aElement);
};
};
@ -494,12 +493,11 @@ typedef mozilla::Variant<
opAppendCommentToDocument, opAppendDoctypeToDocument,
opGetDocumentFragmentForTemplate, opGetFosterParent,
// Gecko-specific on-pop ops
opMarkAsBroken, opRunScriptThatMayDocumentWriteOrBlock,
opRunScriptThatCannotDocumentWriteOrBlock, opPreventScriptExecution,
opDoneAddingChildren, opDoneCreatingElement, opUpdateCharsetSource,
opCharsetSwitchTo, opUpdateStyleSheet, opProcessOfflineManifest,
opMarkMalformedIfScript, opStreamEnded, opSetStyleLineNumber,
opSetScriptLineAndColumnNumberAndFreeze, opSvgLoad,
opMarkAsBroken, opRunScript, opRunScriptAsyncDefer,
opPreventScriptExecution, opDoneAddingChildren, opDoneCreatingElement,
opUpdateCharsetSource, opCharsetSwitchTo, opUpdateStyleSheet,
opProcessOfflineManifest, opMarkMalformedIfScript, opStreamEnded,
opSetStyleLineNumber, opSetScriptLineAndColumnNumberAndFreeze, opSvgLoad,
opMaybeComplainAboutCharset, opMaybeComplainAboutDeepTree, opAddClass,
opAddViewSourceHref, opAddViewSourceBase, opAddErrorType, opAddLineNumberId,
opStartLayout, opEnableEncodingMenu>
@ -611,19 +609,16 @@ class nsHtml5TreeOperation final {
mOperation = aOperation;
}
inline bool IsRunScriptThatMayDocumentWriteOrBlock() {
return mOperation.is<opRunScriptThatMayDocumentWriteOrBlock>();
}
inline bool IsRunScript() { return mOperation.is<opRunScript>(); }
inline bool IsMarkAsBroken() { return mOperation.is<opMarkAsBroken>(); }
inline void SetSnapshot(nsAHtml5TreeBuilderState* aSnapshot, int32_t aLine) {
MOZ_ASSERT(
IsRunScriptThatMayDocumentWriteOrBlock(),
NS_ASSERTION(
IsRunScript(),
"Setting a snapshot for a tree operation other than eTreeOpRunScript!");
MOZ_ASSERT(aSnapshot, "Initialized tree op with null snapshot.");
opRunScriptThatMayDocumentWriteOrBlock data =
mOperation.as<opRunScriptThatMayDocumentWriteOrBlock>();
opRunScript data = mOperation.as<opRunScript>();
data.mBuilderState = aSnapshot;
data.mLineNumber = aLine;
mOperation = mozilla::AsVariant(data);

Просмотреть файл

@ -1,28 +0,0 @@
<html>
<head>
<title>Inline async module script without external deps onload blocking</title>
<meta name=timeout content=long>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
let loadFired = false;
let moduleRan = false
let test = async_test("Inline async module script vs. onload");
window.addEventListener("load", test.step_func(function() {
loadFired = true;
assert_true(moduleRan, "Module should have run before the load event");
test.step_timeout(function() {
test.done();
}, 0);
}));
</script>
<script type="module" async>
moduleRan = true;
test.step_func(function() {
assert_false(loadFired, "onload should not have fired yet");
});
</script>
</body>
</html>

Просмотреть файл

@ -1,29 +0,0 @@
<html>
<head>
<title>Inline defer module script without external deps onload blocking</title>
<meta name=timeout content=long>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
let loadFired = false;
let moduleRan = false
let test = async_test("Inline defer module script vs. onload");
window.addEventListener("load", test.step_func(function() {
loadFired = true;
assert_true(moduleRan, "Module should have run before the load event");
test.step_timeout(function() {
test.done();
}, 0);
}));
</script>
<!-- defer should be equivalent to neither defer nor async specified -->
<script type="module" defer>
moduleRan = true;
test.step_func(function() {
assert_false(loadFired, "onload should not have fired yet");
});
</script>
</body>
</html>

Просмотреть файл

@ -1,28 +0,0 @@
<html>
<head>
<title>Inline module script without external deps onload blocking</title>
<meta name=timeout content=long>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
let loadFired = false;
let moduleRan = false
let test = async_test("Inline module script vs. onload");
window.addEventListener("load", test.step_func(function() {
loadFired = true;
assert_true(moduleRan, "Module should have run before the load event");
test.step_timeout(function() {
test.done();
}, 0);
}));
</script>
<script type="module">
moduleRan = true;
test.step_func(function() {
assert_false(loadFired, "onload should not have fired yet");
});
</script>
</body>
</html>

Просмотреть файл

@ -210,7 +210,7 @@ void PreloadService::PreloadScript(
uint64_t aEarlyHintPreloaderId) {
mDocument->ScriptLoader()->PreloadURI(
aURI, aCharset, aType, aCrossOrigin, aNonce, aIntegrity, aScriptFromHead,
false, false, true, PreloadReferrerPolicy(aReferrerPolicy),
false, false, false, true, PreloadReferrerPolicy(aReferrerPolicy),
aEarlyHintPreloaderId);
}