/** * Compares with another node * * @param Node $other * @return integer|null */ public function compare(Node $other) { if ($other instanceof QuotedNode && !$this->escaped && !$other->escaped) { return Util::numericCompare($this->value, $other->value); } else { $context = new Context(); return $other->toCSS($context) === $this->toCSS($context) ? 0 : null; } }
/** * Compares with another dimension * * @param Node $other * @return integer */ public function compare(Node $other) { if (!$other instanceof DimensionNode) { return null; } if ($this->unit->isEmpty() || $other->unit->isEmpty()) { $a = $this; $b = $other; } else { $a = $this->unify(); $b = $other->unify(); if ($a->unit->compare($b->unit) !== 0) { return null; } } return Util::numericCompare($a->value, $b->value); }