示例#1
0
static PassRefPtrWillBeRawPtr<CSSValueList> parseSimpleTransformList(CharType*& pos, CharType* end)
{
    RefPtrWillBeRawPtr<CSSValueList> transformList = nullptr;
    while (pos < end) {
        while (pos < end && isCSSSpace(*pos))
            ++pos;
        RefPtrWillBeRawPtr<CSSFunctionValue> transformValue = parseSimpleTransformValue(pos, end);
        if (!transformValue)
            return nullptr;
        if (!transformList)
            transformList = CSSValueList::createSpaceSeparated();
        transformList->append(transformValue.release());
        if (pos < end) {
            if (isCSSSpace(*pos))
                return nullptr;
        }
    }
    return transformList.release();
}
示例#2
0
static CSSValueList* parseSimpleTransformList(const CharType* chars,
                                              unsigned length) {
  if (!transformCanLikelyUseFastPath(chars, length))
    return nullptr;
  const CharType*& pos = chars;
  const CharType* end = chars + length;
  CSSValueList* transformList = nullptr;
  while (pos < end) {
    while (pos < end && isCSSSpace(*pos))
      ++pos;
    if (pos >= end)
      break;
    CSSFunctionValue* transformValue = parseSimpleTransformValue(pos, end);
    if (!transformValue)
      return nullptr;
    if (!transformList)
      transformList = CSSValueList::createSpaceSeparated();
    transformList->append(*transformValue);
  }
  return transformList;
}