Should chose the best match during 'route' when there are multiple matches.
Created attachment 332750 [details] Patch
Comment on attachment 332750 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=332750&action=review r- due to the lack of testing. > Websites/perf.webkit.org/public/v3/pages/page-router.js:43 > + } else if (hashUrl.startsWith(routeName) && hashUrl.charAt(routeName.length) == '/' && bestMatchingRouteName.length < routeName.length) { What's hashUrl.charAt(routeName.length) == '/' about?
Comment on attachment 332750 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=332750&action=review >> Websites/perf.webkit.org/public/v3/pages/page-router.js:43 >> + } else if (hashUrl.startsWith(routeName) && hashUrl.charAt(routeName.length) == '/' && bestMatchingRouteName.length < routeName.length) { > > What's hashUrl.charAt(routeName.length) == '/' about? This check exists before. I would assume we want '/apple/xxxx' matches '/apple', and do not want it matches '/applepile/...'
Created attachment 332802 [details] Patch
Comment on attachment 332802 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=332802&action=review > Websites/perf.webkit.org/public/v3/pages/page-router.js:32 > + let bestMatchingRouteName = ''; Initialize this to null instead.