Skip to content
Permalink
Browse files

Rename ScriptContext to ClassicContext

  • Loading branch information...
CYBAI committed Jun 8, 2019
1 parent 47d8c57 commit 608c44f1034713023af32b7a2bebc0158872299e
Showing with 5 additions and 5 deletions.
  1. +5 −5 components/script/dom/htmlscriptelement.rs
@@ -158,7 +158,7 @@ impl ClassicScript {
pub type ScriptResult = Result<ClassicScript, NetworkError>;

/// The context required for asynchronously loading an external script source.
struct ScriptContext {
struct ClassicContext {
/// The element that initiated the request.
elem: Trusted<HTMLScriptElement>,
/// The kind of external script.
@@ -178,7 +178,7 @@ struct ScriptContext {
resource_timing: ResourceFetchTiming,
}

impl FetchResponseListener for ScriptContext {
impl FetchResponseListener for ClassicContext {
fn process_request_body(&mut self) {} // TODO(KiChjang): Perhaps add custom steps to perform fetch here?

fn process_request_eof(&mut self) {} // TODO(KiChjang): Perhaps add custom steps to perform fetch here?
@@ -265,7 +265,7 @@ impl FetchResponseListener for ScriptContext {
}
}

impl ResourceTimingListener for ScriptContext {
impl ResourceTimingListener for ClassicContext {
fn resource_timing_information(&self) -> (InitiatorType, ServoUrl) {
let initiator_type = InitiatorType::LocalName(
self.elem
@@ -282,7 +282,7 @@ impl ResourceTimingListener for ScriptContext {
}
}

impl PreInvoke for ScriptContext {}
impl PreInvoke for ClassicContext {}

/// <https://html.spec.whatwg.org/multipage/#fetch-a-classic-script>
fn fetch_a_classic_script(
@@ -318,7 +318,7 @@ fn fetch_a_classic_script(

// TODO: Step 3, Add custom steps to perform fetch

let context = Arc::new(Mutex::new(ScriptContext {
let context = Arc::new(Mutex::new(ClassicContext {
elem: Trusted::new(script),
kind: kind,
character_encoding: character_encoding,

0 comments on commit 608c44f

Please sign in to comment.
You can’t perform that action at this time.