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

get_title() in testharness.js fails to extract filename if the path contain a full stop (.) #50693

Open
johannesodland opened this issue Feb 13, 2025 · 0 comments

Comments

@johannesodland
Copy link
Contributor

The implementation assumes that only the filename contains full stop characters.
If the path contains a full stop, the function returns a part of the path structure instead of the filename.

As an example, the pathname /a.path/testname.html would result in get_title() returning .path/ instead of testname.

This issue causes tests to fail in the downstream webkit project if tests are run from a folder structure containing a full stup.
https://bugs.webkit.org/show_bug.cgi?id=287285

johannesodland added a commit to johannesodland/wpt that referenced this issue Feb 13, 2025
…ters (.)

web-platform-tests#50693

The current implementation of `get_title()` assumes that the path does not contain a full stop character.
If it does, `get_title()` would return parts of the path, in stead of the filename.
The pathname `/a.path/filename.html` would cause `get_title()` to return `.path` instead of the expected `filename`.

This change fixed the issue by trimming the path away before searching for the extension.
It maintains the current behavior, where it only keeps the first part of the filename if the filename contains multiple full stop characters.
`/path/filename.foo.html` still returns `filename`.
johannesodland added a commit to johannesodland/wpt that referenced this issue Feb 13, 2025
…ters (.)

web-platform-tests#50693

The current implementation of `get_title()` assumes that the path does not contain a full stop character.
If it does, `get_title()` would return parts of the path, in stead of the filename.
The pathname `/a.path/filename.html` would cause `get_title()` to return `.path` instead of the expected `filename`.

This change fixes the issue by trimming the path away before searching for the extension.
It maintains the current behavior, where it only keeps the first part of the filename if the filename contains multiple full stop characters.
`/path/filename.foo.html` still returns `filename`.
johannesodland added a commit to johannesodland/wpt that referenced this issue Feb 15, 2025
…ters (.)

web-platform-tests#50693

The current implementation of `get_title()` assumes that the path does not contain a full stop character.
If it does, `get_title()` would return parts of the path, in stead of the filename.
The pathname `/a.path/filename.html` would cause `get_title()` to return `.path` instead of the expected `filename`.

This change fixes the issue by trimming the path away before searching for the extension.
It maintains the current behavior, where it only keeps the first part of the filename if the filename contains multiple full stop characters.
`/path/filename.foo.html` still returns `filename`.
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

No branches or pull requests

1 participant