Skip to content

Commit ea6ce85

Browse files
committed
fixing insert before by manually calculating position
1 parent 67c4542 commit ea6ce85

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/Sabberworm/CSS/Rule/Rule.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ public function getColNo() {
8484
return $this->iColNo;
8585
}
8686

87+
public function setPosition($iLine, $iColumn) {
88+
$this->iColNo = $iColumn;
89+
$this->iLineNo = $iLine;
90+
}
91+
8792
public function setRule($sRule) {
8893
$this->sRule = $sRule;
8994
}

lib/Sabberworm/CSS/RuleSet/RuleSet.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public function addRule(Rule $oRule, Rule $oSibling = null) {
7878
$iSiblingPos = array_search($oSibling, $this->aRules[$sRule], true);
7979
if ($iSiblingPos !== false) {
8080
$iPosition = $iSiblingPos;
81+
$oRule->setPosition($oSibling->getLineNo(), $oSibling->getColNo() - 1);
8182
}
8283
}
8384

0 commit comments

Comments
 (0)