DeprecatedCSSOMPrimitiveValue.cpp [plain text]
#include "config.h"
#include "DeprecatedCSSOMPrimitiveValue.h"
#include "DeprecatedCSSOMCounter.h"
#include "DeprecatedCSSOMRGBColor.h"
#include "DeprecatedCSSOMRect.h"
#include "ExceptionCode.h"
namespace WebCore {
unsigned short DeprecatedCSSOMPrimitiveValue::primitiveType() const
{
return m_value->primitiveType();
}
ExceptionOr<void> DeprecatedCSSOMPrimitiveValue::setFloatValue(unsigned short unitType, double floatValue)
{
return m_value->setFloatValue(unitType, floatValue);
}
ExceptionOr<float> DeprecatedCSSOMPrimitiveValue::getFloatValue(unsigned short unitType) const
{
return m_value->getFloatValue(unitType);
}
ExceptionOr<void> DeprecatedCSSOMPrimitiveValue::setStringValue(unsigned short stringType, const String& stringValue)
{
return m_value->setStringValue(stringType, stringValue);
}
ExceptionOr<String> DeprecatedCSSOMPrimitiveValue::getStringValue() const
{
return m_value->getStringValue();
}
ExceptionOr<Ref<DeprecatedCSSOMCounter>> DeprecatedCSSOMPrimitiveValue::getCounterValue() const
{
ExceptionOr<Counter&> counter = m_value->getCounterValue();
if (counter.hasException())
return Exception { INVALID_ACCESS_ERR };
return DeprecatedCSSOMCounter::create(counter.releaseReturnValue());
}
ExceptionOr<Ref<DeprecatedCSSOMRect>> DeprecatedCSSOMPrimitiveValue::getRectValue() const
{
ExceptionOr<Rect&> rect = m_value->getRectValue();
if (rect.hasException())
return Exception { INVALID_ACCESS_ERR };
return DeprecatedCSSOMRect::create(rect.releaseReturnValue());
}
ExceptionOr<Ref<DeprecatedCSSOMRGBColor>> DeprecatedCSSOMPrimitiveValue::getRGBColorValue() const
{
ExceptionOr<Ref<RGBColor>> color = m_value->getRGBColorValue();
if (color.hasException())
return Exception { INVALID_ACCESS_ERR };
return DeprecatedCSSOMRGBColor::create(color.releaseReturnValue());
}
}