Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify initiatorType #80

Merged
merged 2 commits into from
Nov 30, 2016
Merged

Clarify initiatorType #80

merged 2 commits into from
Nov 30, 2016

Conversation

igrigorik
Copy link
Member

@igrigorik igrigorik commented Nov 17, 2016

Based on the discussion earlier today on the webperf call...

  • Added: fetch, beacon, navigation as valid values. The last case is
    important for ServiceWorker cases; Nav Timing 2 will report same
    value.
  • If none of the specified cases match, the default fallback is other.

Closes #69.

- Added: fetch, beacon, navigation as valid values. The last case is
  important for ServiceWorker cases. Nav Timing 2 will report same
  value.
- If none of the specified cases match, the default fallback is "other".
@igrigorik
Copy link
Member Author

@toddreifsteck @yoavweiss @plehegar ptal.

<code><a href="https://www.w3.org/TR/dom/#concept-element">element</a></code> [[!DOM]], if the initiator is an <code><a href="https://www.w3.org/TR/dom/#concept-element">element</a></code>.</li>
<li><dfn id='css-resource'><code>"css"</code></dfn>, if the initiator is a CSS resource downloaded by the <code><a href="https://www.w3.org/TR/css-syntax-3/#consume-a-url-token">url()</a></code> syntax [[!CSS-SYNTAX-3]], such as <code>@import url()</code> or <code>background: url()</code>.</li>
<li><dfn id='xhr-resource'><code>"xmlhttprequest"</code></dfn>, if the initiator is an XMLHttpRequest object [[!XMLHttpRequest]].</li>
<code><a href="https://www.w3.org/TR/dom/#concept-element">element</a></code> [[!DOM]], if the initiator is an <code><a href="https://www.w3.org/TR/dom/#concept-element">element</a></code>;</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still defines initiatorType according to "initiator", which is not defined anywhere. I don't have easy solutions to defining it here tho (there are no equivalent Fetch hooks, other than creating a map of Fetch type and destination to initiatorType, but even with that, some types fall off the edges, e.g. "beacon")

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/initiator/if the request is a result of processing the element.

or, some such?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely better than current definition

<li><dfn id='xhr-resource'><code>"xmlhttprequest"</code></dfn>, if the initiator is an XMLHttpRequest object [[!XMLHttpRequest]].</li>
<code><a href="https://www.w3.org/TR/dom/#concept-element">element</a></code> [[!DOM]], if the initiator is an <code><a href="https://www.w3.org/TR/dom/#concept-element">element</a></code>;</li>
<li><dfn id='css-resource'><code>"css"</code></dfn>, if the initiator is a CSS resource downloaded by the <code><a href="https://www.w3.org/TR/css-syntax-3/#consume-a-url-token">url()</a></code> syntax [[!CSS-SYNTAX-3]], such as <code>@import url()</code> or <code>background: url()</code>;</li>
<li><dfn id='navigation-resource'><code>"navigation"</code></dfn>, if the request is a <a href="https://fetch.spec.whatwg.org/#navigation-request">navigation request</a>;</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this defined for navigation timing's sake?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also ServiceWorker.. which intercepts navigation requests via RT and needs to be able to distinguish them as such.

@igrigorik
Copy link
Member Author

@yoavweiss updated, ptal.

@plehegar
Copy link
Member

LGTM

@yoavweiss
Copy link
Contributor

LGTM2

@toddreifsteck
Copy link
Member

@nicjansma Can you confirm that this matches your data?

@nicjansma
Copy link
Contributor

@toddreifsteck Looks great

@igrigorik igrigorik merged commit 4d596cd into V2 Nov 30, 2016
@plehegar plehegar deleted the clarify-initiator branch November 30, 2016 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants