aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tabs/core.js
Commit message (Collapse)AuthorAgeFilesLines
* Tabs: Properly handle decoded/encoded anchor hashes & panel IDsMichał Gołębiowski-Owczarek2025-03-311-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to jQuery UI 1.14.1, hashes in anchor hrefs were used directly. In gh-2307, that was changed - by decoding - to support more complex IDs, e.g. containing emojis which are automatically encoded in `anchor.hash`. Unfortunately, that broke cases where the panel ID is decoded as well. It turns out the spec mandates checking both. In the "scrolling to a fragment" section of the HTML spec[^1]. That uses a concept of document's indicated part[^2]. Slightly below there's an algorithm to compute the indicated part[^3]. The interesting parts are steps 4 to 9: 4. Let potentialIndicatedElement be the result of finding a potential indicated element given document and fragment. 5. If potentialIndicatedElement is not null, then return potentialIndicatedElement. 6. Let fragmentBytes be the result of percent-decoding fragment. 7. Let decodedFragment be the result of running UTF-8 decode without BOM on fragmentBytes. 8. Set potentialIndicatedElement to the result of finding a potential indicated element given document and decodedFragment. 9. If potentialIndicatedElement is not null, then return potentialIndicatedElement. First, in steps 4-5, the algorithm tries the hash as-is, without decoding. Then, if one is not found, the same is attempted with a decoded hash. This change replicates this logic by first trying the hash as-is and then decoding it. Fixes gh-2344 Closes gh-2345 Ref gh-2307 [^1]: https://html.spec.whatwg.org/#scrolling-to-a-fragment [^2]: https://html.spec.whatwg.org/#the-indicated-part-of-the-document [^3]: https://html.spec.whatwg.org/#select-the-indicated-part
* Tabs: Support URL-based credentialsMichał Gołębiowski-Owczarek2025-03-311-0/+26
| | | | | | | | | | | | | When credentials are provided directly in the URL, e.g.: https://username:password@www.example.com/ `location.href` strips out the auth part, but anchor links contain them, making our `isLocal` computation broken. This fixes it by only looking at `origin`, `pathname` & `search`. Fixes gh-2213 Closes gh-2345
* Tabs: Use `CSS.escape` for sanitizing selectorsMichał Gołębiowski-Owczarek2024-10-271-0/+31
| | | | | | The previous private `_sanitizeSelector` API was not correctly escaping backslashes and is now removed. The native API should always be correct. Closes gh-2307
* All: Drop support for jQueries different than the latest for each majorMichał Gołębiowski-Owczarek2024-05-151-20/+3
| | | | | | Also, remove the ability to run the test suite in jQuery <1.12.4 & <2.2.4. Closes gh-2249
* Core: Make back compat disabled by defaultMichał Gołębiowski-Owczarek2024-05-131-3/+3
| | | Closes gh-2250
* Tests: Skip a problematic keyboard test in IE with jQuery 3.6Michał Gołębiowski-Owczarek2024-04-121-1/+7
| | | | | | jQuery 3.6 has issues with focus handling in IE which breaks this test. The issues were fixed in jQuery 3.7, so we just accept them here. Closes gh-2231
* Widget: Optimize attachment of the _untrackClassesElement listenerMichał Gołębiowski-Owczarek2022-01-151-0/+52
| | | | | | | | | | | | | | | jQuery UI 1.13.0 changed the logic attaching the `_untrackClassesElement` listener in the `_classes` widget method; one of the side effects was calling `this._on` for each node that needed the listener. That caused a severe performance degradation for large comboboxes as each `_on` jQuery UI call causes a jQuery `add` call that calls Sizzle's `uniqueSort` underneath. Instead, collect the nodes that need the listener and then, outside of the loop, create a jQuery object out of them and attach the listener once. That's still slower than the jQuery 1.12 version but only slightly: 936 ms to 1.03s on a very large list on a recent MacBook Pro, compared to ~30 seconds before this patch. Fixes gh-2014 Closes gh-2037
* Build: Migrate from JSHint & JSCS to ESLintMichał Gołębiowski-Owczarek2021-06-071-0/+1
| | | | | Fixes #15393 Closes gh-1958
* Tests: Accept delayed focusout in IE with jQuery 1.8Michał Gołębiowski-Owczarek2021-04-161-2/+13
| | | | | | In IE with jQuery 1.8 focusout may not happen immediately so some checks need to be done later. Closes gh-1952
* Tests: Ensure no timers are running at the end of each test (#1920)Michał Gołębiowski-Owczarek2020-05-161-2/+3
| | | | | | | | | | | | | This helps fix issues that make tooltip tests sometimes fail when run against jQuery 3.2 or newer due to timing differences. Details: * Add the `moduleAfterEach` function ensuring no timers are running. * Attach this function via `common.testWidget`. * Attach this function to most test suites. * Add a tooltip test helper cleaning up leftover timers. * Rename legacy `setup`/`teardown` hooks to `beforeEach`/`afterEach`. Closes gh-1920
* Tabs: Remove presentation rolemilk542016-09-291-2/+1
| | | | | Fixes #10122 Closes gh-1748
* Tabs: Remove test for Ajax URLs containing hashesScott González2016-07-061-12/+0
| | | | | | | | | This hasn't been a problem for a long time and jQuery no longer removes the hash in 3.0.0, so the test started to fail even though the actual code is working just fine. Ref #3627 Ref jquery/jquery#1732
* Tabs: Shift to use no globalsAmanpreet Singh2016-04-141-326/+331
|
* Tabs: Style updatesAlexander Schmitz2015-09-111-34/+34
| | | | Ref #14246
* Tabs: Style updatesAlexander Schmitz2015-08-211-12/+12
| | | | | Ref #14246 Ref gh-1588
* Tabs: Move tabs into widgets directoryAlexander Schmitz2015-08-081-1/+1
| | | | Ref #13885
* Tabs: Rename ui-tab class to ui-tabs-tab for consistent prefixesJörn Zaefferer2015-04-181-1/+7
| | | | | | | Fixes #12061 Closes gh-1538 Ref #7053 Ref jquery/api.jqueryui.com#256
* Tests: Rename filesScott González2015-04-091-0/+667
Ref gh-1528