-
Notifications
You must be signed in to change notification settings - Fork 34
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
getEntriesByName and friends should explain if they're case sensitive or not #57
Comments
I wrote a test for this: Edge and Firefox are case sensitive on getEntriesByType, unlike Chrome. getEntriesByName is trickier. Chrome is also case sensitive on resource names. If we switch to case insensitive for getEntriesByName, it will trigger all kind of questions if the name contains a URL. It seems that the conservative approach would be to explain that those methods are case sensitive. @toddreifsteck, wdyt? |
FWIW, I agree that it should be case sensitive |
Also, looking at the code, entry type in Blink is indeed case-insensitive (in both |
btw, getEntries is case insensitive for the property names. getEntries({'entryType':'resource'}) will return the same thing as getEntries({'EntryType':'resource'}). Ditto for 'name' vs 'NAME'. I updated the test mentioned earlier. |
So, what's the conclusion here? It sounds like...
Yay / nay? |
Property names should be case insensitive, eg getEntries({'ENTRYTYPE': ...}) or getEntries({'NAME':...} will work. At least, FF/ED/CH implementations seem to agree on that. Property values should be case sensitive I think, otherwise we'll get in trouble for resource timing entries imho (getEntriesByName('https://w3c-test.org/RESOURCES/TESTHARNESS.JS') vs getEntriesByName('https://w3c-test.org/resources/testharness.js') ). At least, implementations need to be consistent because, unless I got mixed up, all of the current implementations don't make sense to me. getEntriesByType('RESOURCE') must return the same thing as getEntries({'entryType': 'RESOURCE'}) and none of the implementations do that?!? I updated |
Enumerating the various cases...
In terms of available strategies we could...
There are some other combinations possible here.. but I'm not sure they make a lot of sense (happy to hear other opinions :)). Personally, with my "web app developer" hat on, I would prefer (2), but I don't think (1) is entirely unreasonable either. |
Ilya, Yoav and I took a look and it appears that getEntries({filter}) is not yet implemented in any browser. We also discussed that adding it would be difficult to feature detect. Because of this, I think we can cut it from the Performance Timeline specification. This simplifies the issue significantly down to:
|
For reference: 32b0420 - this is where we introduced getEntries filtering. |
@annevk made a great comment at W3C TPAC that name being able to contain URLs is unfortunate. It would have been ideal for URLs to have been neatly separated so they could be processed correctly for equality. Case sensitivity is a good first step, but it would be ideal if we could break the URLs into a URL field and we could potentially add some type of URL creation to the getEntriesByName processing model to improve the accuracy of matches. For the short term, we are going to stick to case sensitive matching. |
Background: #57 (comment) Closes #60.
To close the loop on compat discussion of making getEntriesByType case sensitive.. Doing a scan over HTTP Archive shows exactly zero instances of uppercase/mixed-case use for popular keywords (e.g. "resource"): https://gist.github.com/igrigorik/9e66f92338821af4976b3cf25ab7f55a. Which is to say, I believe this is a safe change for Blink. /cc fyi.. @yoavweiss @RByers |
Given there are no problematic results in HTTP Archive and other engines are already case sensitive, I agree it should be low risk for blink to change, and that (in absence of any other reports of compat impact) we should just consider it a bug-fix (not a breaking API change). Is there a chromium bug filed? |
The performance timing spec has been clarified[1] to make getEntriesByType case sensitive. This CL updates Blink to this new requirement. [1] w3c/performance-timeline#57 BUG=651507 Review-Url: https://codereview.chromium.org/2390733003 Cr-Commit-Position: refs/heads/master@{#422650}
Blink has it case insensitive, the spec should probably explicitly call out ASCII Case insensitive if that's what's desired, or we should change the implementation.
The text was updated successfully, but these errors were encountered: