-
Notifications
You must be signed in to change notification settings - Fork 24
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
SYNTAX_ERR exception for markName argument #1
Comments
I believe we discussed this on one of the conf calls and the conclusion was that we should allow any/all metric names. Any objections? /cc @toddreifsteck |
I'm unsure where this bit of the spec originated but I just tested Chrome and IE. Both allow name, duration, startTime, entryType to be used. I believe we should cut this from the spec. Should we follow up with Firefox? I did not check their prerelease builds of Gecko. |
/cc @mina @marcoscaceres |
@toddreifsteck do you/we have a test somewhere that I can run on firefox? |
We have a test at: |
Sorry, I've not been following this spec or it's implementation in Gecko at all :( I don't know if I can be much here. |
So, it looks like we got mixed up in measure() and the fix would impact this issue:
However, PerformanceTiming doesn't contain DOMHighResTimeStamp values: imho, this should be changed to refer to PerformanceNavigationTiming attributes instead. Now, if we do that, can one store the mark "prerenderSwitch" or "nextHopProtocol"? |
Btw, if the answer to my last question is "no, you should raise a SyntaxError instead", then what should we do with performance.measure("myMeasure", "prerenderSwitch", "nextHopProtocol") ? |
Ugh, that's messy. Related, what about Wondering if we should consider option (3): remove that capability entirely, since it's just syntax sugar for |
"domInteractive" is ok as far as I know. We don't raise SYNTAX_ERR on the measureName. However, would we break anyone if we remove |
Ah, right, apologies about the confusion.
That said, I'm not sure if/what we'd break if we were to remove that functionality at this point. If we want to keep it backwards compatible, perhaps we should explicitly list the names of "special markNames" that would only be applicable in Window context? |
Note that #13 doesn't solve this issue. |
After re-reading this thread, my proposal is...
Thoughts / objections? |
Discussed with Ilya/Yoav. The original purpose of this exception is to protect measure string lookups on nav timing 1 from being corrupted by user timings that are injected. performance.measure('foo','navigationStart','fetchStart') A simple spec update to limit the attributes protected to only include the readonly attributes will mean that the following does not need to throw for the spec to be followed: performance.mark('toJSON') |
Raised whenever name of the mark matches a readonly attribute of Performance Timing (NT1) interface. toJSON is writable [1] and is thus excluded. Related discussion in [2]. Closes #1. [1] https://heycam.github.io/webidl/#es-serializer [2] #1
From https://lists.w3.org/Archives/Public/public-web-perf/2015Jan/0070.html
[[
In the Exceptions section of the User Timing spec for the mark method, it
states:
"Throws a SYNTAX_ERR exception if the markName argument is the same name as
an attribute in the PerformanceTiming interface."
In Gecko we implemented bug 760851 [1] out-of-spec and added
toJSON
tothe PerformanceTiming interface to get a JSON version of the timing
attributes. Following this reasoning, then
toJSON
being aPerformanceTiming attribute may need to throw a SYNTAX_ERR when used as a
performance marker name:
performance.mark('toJSON');
So we need some clarification of the spec to determine whether all
attributes of the PerformanceTiming interface should throw if used as
marker names, or only those specifically defined by the spec.
[1]
https://bugzilla.mozilla.org/show_bug.cgi?id=760851
]]
The text was updated successfully, but these errors were encountered: