当前位置: 首页>>代码示例>>C++>>正文


C++ TransformOperations::dependsOnBoxSize方法代码示例

本文整理汇总了C++中TransformOperations::dependsOnBoxSize方法的典型用法代码示例。如果您正苦于以下问题:C++ TransformOperations::dependsOnBoxSize方法的具体用法?C++ TransformOperations::dependsOnBoxSize怎么用?C++ TransformOperations::dependsOnBoxSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TransformOperations的用法示例。


在下文中一共展示了TransformOperations::dependsOnBoxSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setMatrixValue

void CSSMatrix::setMatrixValue(const String& string,
                               ExceptionState& exceptionState) {
  if (string.isEmpty())
    return;

  if (const CSSValue* value =
          CSSParser::parseSingleValue(CSSPropertyTransform, string)) {
    // Check for a "none" transform. In these cases we can use the default
    // identity matrix.
    if (value->isIdentifierValue() &&
        (toCSSIdentifierValue(value))->getValueID() == CSSValueNone)
      return;

    DEFINE_STATIC_REF(ComputedStyle, initialStyle, createInitialStyle());
    TransformOperations operations =
        TransformBuilder::createTransformOperations(
            *value, CSSToLengthConversionData(initialStyle, initialStyle,
                                              LayoutViewItem(nullptr), 1.0f));

    // Convert transform operations to a TransformationMatrix. This can fail
    // if a param has a percentage ('%')
    if (operations.dependsOnBoxSize())
      exceptionState.throwDOMException(SyntaxError,
                                       "The transformation depends on the box "
                                       "size, which is not supported.");
    m_matrix = TransformationMatrix::create();
    operations.apply(FloatSize(0, 0), *m_matrix);
  } else {  // There is something there but parsing failed.
    exceptionState.throwDOMException(SyntaxError,
                                     "Failed to parse '" + string + "'.");
  }
}
开发者ID:mirror,项目名称:chromium,代码行数:32,代码来源:CSSMatrix.cpp

示例2: setMatrixValue

void CSSMatrix::setMatrixValue(const String& string, ExceptionState& exceptionState)
{
    if (string.isEmpty())
        return;

    RefPtr<MutableStylePropertySet> styleDeclaration = MutableStylePropertySet::create();
    if (BisonCSSParser::parseValue(styleDeclaration.get(), CSSPropertyWebkitTransform, string, true, HTMLStandardMode, 0)) {
        // Convert to TransformOperations. This can fail if a property
        // requires style (i.e., param uses 'ems' or 'exs')
        RefPtrWillBeRawPtr<CSSValue> value = styleDeclaration->getPropertyCSSValue(CSSPropertyWebkitTransform);

        // Check for a "none" or empty transform. In these cases we can use the default identity matrix.
        if (!value || (value->isPrimitiveValue() && (toCSSPrimitiveValue(value.get()))->getValueID() == CSSValueNone))
            return;

        DEFINE_STATIC_REF(RenderStyle, defaultStyle, RenderStyle::createDefaultStyle());
        TransformOperations operations;
        if (!TransformBuilder::createTransformOperations(value.get(), CSSToLengthConversionData(defaultStyle, defaultStyle, 0, 0, 1.0f), operations)) {
            exceptionState.throwDOMException(SyntaxError, "Failed to interpret '" + string + "' as a transformation operation.");
            return;
        }

        // Convert transform operations to a TransformationMatrix. This can fail
        // if a param has a percentage ('%')
        if (operations.dependsOnBoxSize())
            exceptionState.throwDOMException(SyntaxError, "The transformation depends on the box size, which is not supported.");
        TransformationMatrix t;
        operations.apply(FloatSize(0, 0), t);

        // set the matrix
        m_matrix = t;
    } else { // There is something there but parsing failed.
        exceptionState.throwDOMException(SyntaxError, "Failed to parse '" + string + "'.");
    }
}
开发者ID:Mihiri,项目名称:blink,代码行数:35,代码来源:CSSMatrix.cpp

示例3: setMatrixValue

void CSSMatrix::setMatrixValue(const String& string, ExceptionState& exceptionState)
{
    if (string.isEmpty())
        return;

    // FIXME: crbug.com/154772 - should this continue to use legacy style parsing?
    if (RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyWebkitTransform, string)) {
        // Check for a "none" transform. In these cases we can use the default identity matrix.
        if (value->isPrimitiveValue() && (toCSSPrimitiveValue(value.get()))->getValueID() == CSSValueNone)
            return;

        // FIXME: This has a null pointer crash if we use ex units (crbug.com/414145)
        DEFINE_STATIC_REF(RenderStyle, defaultStyle, RenderStyle::createDefaultStyle());
        TransformOperations operations;
        if (!TransformBuilder::createTransformOperations(value.get(), CSSToLengthConversionData(defaultStyle, defaultStyle, 0, 0, 1.0f), operations)) {
            exceptionState.throwDOMException(SyntaxError, "Failed to interpret '" + string + "' as a transformation operation.");
            return;
        }

        // Convert transform operations to a TransformationMatrix. This can fail
        // if a param has a percentage ('%')
        if (operations.dependsOnBoxSize())
            exceptionState.throwDOMException(SyntaxError, "The transformation depends on the box size, which is not supported.");
        TransformationMatrix t;
        operations.apply(FloatSize(0, 0), t);

        // set the matrix
        m_matrix = t;
    } else { // There is something there but parsing failed.
        exceptionState.throwDOMException(SyntaxError, "Failed to parse '" + string + "'.");
    }
}
开发者ID:335969568,项目名称:Blink-1,代码行数:32,代码来源:CSSMatrix.cpp


注:本文中的TransformOperations::dependsOnBoxSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。