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); } }
void StyleBuilderFunctions::applyInheritCSSPropertyZoom(StyleResolverState& state) { resetEffectiveZoom(state); state.setZoom(state.parentStyle()->zoom()); }
void StyleBuilderFunctions::applyInitialCSSPropertyZoom(StyleResolverState& state) { resetEffectiveZoom(state); state.setZoom(ComputedStyle::initialZoom()); }