void StyleBuilderFunctions::applyValueCSSPropertyZoom(StyleResolverState& state, CSSValue* value) { ASSERT_WITH_SECURITY_IMPLICATION(value->isPrimitiveValue()); CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); if (primitiveValue->getValueID() == CSSValueNormal) { resetEffectiveZoom(state); state.setZoom(ComputedStyle::initialZoom()); } else if (primitiveValue->getValueID() == CSSValueReset) { state.setEffectiveZoom(ComputedStyle::initialZoom()); state.setZoom(ComputedStyle::initialZoom()); } else if (primitiveValue->getValueID() == CSSValueDocument) { float docZoom = state.rootElementStyle() ? state.rootElementStyle()->zoom() : ComputedStyle::initialZoom(); state.setEffectiveZoom(docZoom); state.setZoom(docZoom); } else if (primitiveValue->isPercentage()) { resetEffectiveZoom(state); if (float percent = primitiveValue->getFloatValue()) state.setZoom(percent / 100.0f); } else if (primitiveValue->isNumber()) { resetEffectiveZoom(state); if (float number = primitiveValue->getFloatValue()) state.setZoom(number); } }
static PassRefPtr<CustomFilterParameter> parseCustomFilterTransformParameter(const String& name, CSSValueList* values, StyleResolverState& state) { RefPtr<CustomFilterTransformParameter> transformParameter = CustomFilterTransformParameter::create(name); TransformOperations operations; TransformBuilder::createTransformOperations(values, state.style(), state.rootElementStyle(), operations); transformParameter->setOperations(operations); return transformParameter.release(); }
void StyleBuilderFunctions::applyValueCSSPropertyFontSize(StyleResolverState& state, CSSValue* value) { state.fontBuilder().setFontSizeValue(value, state.parentStyle(), state.rootElementStyle()); }