Summary: | Should choose the best match during 'route' if there are multiple matches. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | dewei_zhu | ||||||
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | NEW --- | ||||||||
Severity: | Normal | CC: | dewei_zhu, rniwa | ||||||
Priority: | P2 | ||||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
dewei_zhu
2018-01-31 01:13:47 PST
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. |