Skip to content

Releases: PhpGt/Dom

December 2020

23 Dec 12:33
af202e2
Compare
Choose a tag to compare

A few minor updates to the CI process have been made, along with a new test and functionality fix to innerHTML thanks to @speich.

September 2020

01 Sep 11:09
26eb989
Compare
Choose a tag to compare
  • Bugfix: When working with a textarea's value attribute, getting and setting on the same request would not persist data.
  • Feature: Boolean attributes are implemented and tested: attributes like disabled, checked, etc. all correspond to their correct HTML attributes.
  • Tests: XML documents tested for querySelector and querySelectorAll functions.
  • Tests: Body and title elements are inferred by default when there is a minimal-style HTML document created.
  • Moved to using Github Actions for our CI.

Optimised innerHTML

15 Jan 08:34
fceb86c
Compare
Choose a tag to compare

This release is very minor in scope, but has knock-on effects to DomTemplate, specifically PhpGt/DomTemplate#124

The changes in this release mean that setting an innerHTML of an empty string is much more efficient, and this can now be done on DocumentFragments too. Before, this would cause an exception, due to there not being a parent element.

Changes in DomTemplate are incoming so that binding an empty dataset to an list element will set the innerHTML to an empty string, which means that the :empty CSS selector will now be valid for empty lists.

Compatibility and test improvement

25 Nov 17:08
42846f6
Compare
Choose a tag to compare

There are no new features included within this release, just improvements to the way Element object properties are handled, and how Element and Document objects are tested. Have fun.

Element improvements and debugging

09 Oct 09:35
2348e42
Compare
Choose a tag to compare

Unit test coverage on the Element class is now improved to 100%, thanks to @Jelmergu.

The Element class has been improved to take advantage of the new CssXPath updates, along with fixing getter/setter for the value attribute, and a check for the property map constant which improves working with non-html documents such as XML.

Improved Element value getter/setter

15 Aug 14:18
1ffa6a1
Compare
Choose a tag to compare

The value property of Elements is made more consistent in this release. Certain element types behave differently when getting or setting the value property - some access the value attribute directly, others affect the state of their children.

PSR-7 Interoperability

15 Aug 09:45
4df60cd
Compare
Choose a tag to compare

The PSR-7 StreamInterface has been implemented on the Document/HTMLDocument classes to improve interoperability when used within other frameworks. There is no new functionality due to this, so only a minor version increment is necessary.

Along with the interface implementation, a couple of bugfixes are released here too:

  • Rewind HTMLCollection iterators before use, to avoid throwing a RunetimeException when used outside of a foreach.
  • Don't format the HTML output at document render. There will be some efficiency gains here on large document trees.

August 2019 bugfixes

14 Aug 14:42
Compare
Choose a tag to compare

No new features in this release, just a selection of bugfixes and improvements.

  1. Fix problem where attribute value contains comma - it's possible to use a CSS selector that contains a comma in the actual selector. Previously the CSS to XPath translator was splitting queries based on the comma character with no context as to where the comma appeared in the string. This improvement checks to see if the comma is within a quoted string, and if so, treats it as part of a selector.
  2. Test innerHTML does not encode JSON with HTML encoding - Harden tests around unicode support with the innerHTML property.
  3. Default value getter/setter property - The value property of Elements should behave differently if the element can represent a value, such as input, option, etc. This change improves the use of shorthand value property, rather than having to use getAttribute/setAttribute.

Efficiency improvements

08 Aug 12:18
ef1c3a7
Compare
Choose a tag to compare

This release is minor in footprint, but potentially major in efficiency increase. This is only noticable on large trees, but when you have thousands of Nodes in a Document, you can cut the page render time in half.

Main improvements lie in the iteration of NodeList objects. There is also improvement to the distinction between a NodeList and HTMLCollection (HTMLCollection objects can only contain Elements, not Nodes).

Bugfix

31 Jul 15:32
ad48666
Compare
Choose a tag to compare

This release fixes an issue when getting the value attribute of a select element.