diff options
author | Moonchild <moonchild@palemoon.org> | 2020-08-24 11:11:17 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-08-30 09:47:49 +0000 |
commit | d58cb8e11b15c054f0773918cd7fd89ce2a7464e (patch) | |
tree | 380d82f3b0ad12222da2338da83408b97b402634 /parser/html/nsHtml5TreeBuilderCppSupplement.h | |
parent | 429a7bdb93e443236f4a4b04afc9a12c78f54247 (diff) | |
download | UXP-d58cb8e11b15c054f0773918cd7fd89ce2a7464e.tar UXP-d58cb8e11b15c054f0773918cd7fd89ce2a7464e.tar.gz UXP-d58cb8e11b15c054f0773918cd7fd89ce2a7464e.tar.lz UXP-d58cb8e11b15c054f0773918cd7fd89ce2a7464e.tar.xz UXP-d58cb8e11b15c054f0773918cd7fd89ce2a7464e.zip |
Issue #618 - (async, preload) Correctly pass info about async/defer to parser.
This makes sure we don't block body-referred sub-resources by head-referenced
defer and async scripts. This is important for all script loads, not just
modules, but is added here because it was run into while implementing modules.
Diffstat (limited to 'parser/html/nsHtml5TreeBuilderCppSupplement.h')
-rw-r--r-- | parser/html/nsHtml5TreeBuilderCppSupplement.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/parser/html/nsHtml5TreeBuilderCppSupplement.h b/parser/html/nsHtml5TreeBuilderCppSupplement.h index aacc5a3e0..9709396c7 100644 --- a/parser/html/nsHtml5TreeBuilderCppSupplement.h +++ b/parser/html/nsHtml5TreeBuilderCppSupplement.h @@ -167,16 +167,20 @@ nsHtml5TreeBuilder::createElement(int32_t aNamespace, nsIAtom* aName, aAttributes->getValue(nsHtml5AttributeName::ATTR_CROSSORIGIN); nsHtml5String integrity = aAttributes->getValue(nsHtml5AttributeName::ATTR_INTEGRITY); + bool async = + aAttributes->contains(nsHtml5AttributeName::ATTR_ASYNC); + bool defer = + aAttributes->contains(nsHtml5AttributeName::ATTR_DEFER); mSpeculativeLoadQueue.AppendElement()->InitScript( url, charset, type, crossOrigin, integrity, - mode == NS_HTML5TREE_BUILDER_IN_HEAD); - mCurrentHtmlScriptIsAsyncOrDefer = - aAttributes->contains(nsHtml5AttributeName::ATTR_ASYNC) || - aAttributes->contains(nsHtml5AttributeName::ATTR_DEFER); + mode == NS_HTML5TREE_BUILDER_IN_HEAD, + async, + defer); + mCurrentHtmlScriptIsAsyncOrDefer = async || defer; } } else if (nsHtml5Atoms::link == aName) { nsHtml5String rel = @@ -279,7 +283,9 @@ nsHtml5TreeBuilder::createElement(int32_t aNamespace, nsIAtom* aName, type, crossOrigin, integrity, - mode == NS_HTML5TREE_BUILDER_IN_HEAD); + mode == NS_HTML5TREE_BUILDER_IN_HEAD, + false /* async */, + false /* defer */); } } else if (nsHtml5Atoms::style == aName) { nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement(); |