Skip to content

Commit e60b66a

Browse files
author
Andreas Sandberg
committed
Default to non mb functions and adding selector
1 parent e2c1fba commit e60b66a

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

CSSParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class CSSParser {
2020
*
2121
* @var bool
2222
*/
23-
private $bUseMbFunctions = TRUE;
23+
private $bUseMbFunctions = FALSE;
2424

2525
public function __construct($sText, $sDefaultCharset = 'utf-8') {
2626
$this->sText = $sText;

lib/CSSList.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,28 @@ protected function allValues($oElement, &$aResult, $sSearchString = null, $bSear
106106
}
107107
}
108108

109+
/**
110+
* Retrieve a selector by id or name.
111+
*
112+
* @param $selector
113+
* @return bool
114+
*/
115+
public function getRuleBySelector($selector)
116+
{
117+
foreach($this->getAllDeclarationBlocks() as $oBlock)
118+
{
119+
foreach($oBlock->getSelectors() as $oSelector)
120+
{
121+
if($oSelector->getSelector() == $selector)
122+
{
123+
return $oBlock;
124+
}
125+
}
126+
}
127+
128+
return FALSE;
129+
}
130+
109131
protected function allSelectors(&$aResult, $sSpecificitySearch = null) {
110132
foreach($this->getAllDeclarationBlocks() as $oBlock) {
111133
foreach($oBlock->getSelectors() as $oSelector) {

0 commit comments

Comments
 (0)