Skip to content

Commit 4b85443

Browse files
Merge branch '4.4'
* 4.4: (27 commits) [Validator] add notice in UPGRADE file for new Range constraint option [CssSelector] Support *:only-of-type pseudo class selector [Intl] Update the ICU data to 65.1 (4.4 branch) [Intl] Update the ICU data to 65.1 (4.3 branch) Replace deprecated calls in tests [Intl] Update the ICU data to 65.1 Delete 5_Security_issue.md [DI] Whitelist error_renderer.renderer tag in UnusedTagsPass [DI] Whitelist validator.auto_mapper in UnusedTagsPass Update CHANGELOG.md [HttpClient] Fixed #33832 NO_PROXY option ignored in NativeHttpClient::request() method [EventDispatcher] A compiler pass for aliased userland events. [Cache] give 100ms before starting the expiration countdown [Cache] fix logger usage in CacheTrait::doGet() [VarDumper] fix dumping uninitialized SplFileInfo Added missing translations. [Form] Added CountryType option for using alpha3 country codes Fixed invalid changelog 4.0.0 for VarDumper [Workflow] Fixed BC break on WorkflowInterface Fix wrong expression language value ...
2 parents d673979 + 692bb94 commit 4b85443

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
4.4.0
5+
-----
6+
7+
* Added support for `*:only-of-type`
8+
49
2.8.0
510
-----
611

Tests/XPath/TranslatorTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ public function getHtmlIdsTestData()
308308
['li div:only-child', ['li-div']],
309309
['div *:only-child', ['li-div', 'foobar-span']],
310310
['p:only-of-type', ['paragraph']],
311+
[':only-of-type', ['html', 'li-div', 'foobar-span', 'paragraph']],
312+
['div#foobar-div :only-of-type', ['foobar-span']],
311313
['a:empty', ['name-anchor']],
312314
['a:EMpty', ['name-anchor']],
313315
['li:empty', ['third-li', 'fourth-li', 'fifth-li', 'sixth-li']],

XPath/Extension/PseudoClassExtension.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,10 @@ public function translateOnlyChild(XPathExpr $xpath): XPathExpr
100100
->addCondition('last() = 1');
101101
}
102102

103-
/**
104-
* @throws ExpressionErrorException
105-
*/
106103
public function translateOnlyOfType(XPathExpr $xpath): XPathExpr
107104
{
108105
$element = $xpath->getElement();
109106

110-
if ('*' === $element) {
111-
throw new ExpressionErrorException('"*:only-of-type" is not implemented.');
112-
}
113-
114107
return $xpath->addCondition(sprintf('count(preceding-sibling::%s)=0 and count(following-sibling::%s)=0', $element, $element));
115108
}
116109

0 commit comments

Comments
 (0)