Skip to content

Releases: PhpGt/CssXPath

January 2024 release

03 Jan 18:46
c0a0667
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.1.4...v1.2.0

PHP 7.3 compatibility

13 Nov 15:41
7f073ba
Compare
Choose a tag to compare

Backwards compatibility is added in this release to allow PHP.Gt/Dom v2 to retain compatibility with PHP 7.3

CI and type safety improvements

28 Jan 13:31
6481386
Compare
Choose a tag to compare

This minor patch release includes the switch from Circle CI to Github Actions along with a few improvements to how types are hinted, for static analysis improvement.

November 2019 bugfixes

08 Nov 13:44
Compare
Choose a tag to compare

When using continue within switch statements, special care has to be taken to ensure the loops are continued as expected. This release removes ambiguity by specifying the continue nesting argument.

From https://www.php.net/manual/en/control-structures.continue.php :

Note: In PHP the switch statement is considered a looping structure for the purposes of continue. continue behaves like break (when no arguments are passed). If a switch is inside a loop, continue 2 will continue with the next iteration of the outer loop.

August 2019 bugfixes

15 Aug 09:57
af4b958
Compare
Choose a tag to compare

This release contains a number of bugfixes:

  • Bugfix for selecting children of attribute selector. The bug meant that the selector context was reset to the documentElement when in a deeper query than selecting attribute values.
  • Update DOM dependency fixing issue with iterators in tests. Iterating over HTMLCollections is only one method of working with HTMLCollections. Asking for the current() item would use the iterator but it would throw a RunTime exception if the iterator wasn't rewound.
  • Expose other attribute selector types. There are many types of attribute selector. Now these types are defined as constants in the Translator.
  • More descriptive variable names.

Regular expression splitting multiple queries

09 Aug 15:28
Compare
Choose a tag to compare

Multiple CSS selectors can be present within the same query like this: div>a, div>li>a, and a simple explode() was being called to split the strings. However, this caused an issue when one selector was looking for an attribute selector whose value contained a comma.

To solve this, a regular expression has been used to split only commas that are not surrounded by quotes.

Stable release

14 Jun 15:16
Compare
Choose a tag to compare

With the push to release PhpGt repositories to their stable versions, this release includes the single piece of functionality that was holding it back from being integrated within WebEngine: the ability to assign a prefix to the XPath query.

This is used within the PhpGt/Dom repository to allow typical child-based searches, but also parent-based searches for using DOM functionality such as $element->closest($selector).

The library has been in use within WebEngine for a number of weeks so is receiving its first stable release, and even though advanced functionality like :not selector is missing right now (and admittedly, doing advanced CSS selectors within your server-side code is probably a bad idea), we're looking forward to adding more completeness to the library for future releases.

Have fun and stay productive!

Multiple CSS selectors, comma separated

10 Jun 15:07
Compare
Choose a tag to compare
Pre-release

Part of the CSS specification is the ability to match multiple selectors as one, separated by a comma. This has now been implemented in this repository by splitting the input string on a comma and converting to multiple XPath queries that are chainable.

Amongst this feature, unit tests and continuous integration platforms have been upgraded to the latest versions, and unit tests have been hardened.

Class selection improvements

15 Nov 15:48
4117481
Compare
Choose a tag to compare
Pre-release

Multiple class selectors can now be chained together, fixing a known bug. Classes are now normalised on entry to fix some false positives.

Test, test, test

25 Sep 21:19
Compare
Choose a tag to compare
Test, test, test Pre-release
Pre-release

Because of the reliance on Symfony's CSS selector package, it's very important to test real-world use cases of CSS selectors.

It is not greatly important to get to full CSS-spec for v1 release, because there are so many complex selectors that just shouldn't be performed on the server, but getting 100% test coverage is a must.

Currently at 68%!