// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

enum LengthType {
    "px", "percent", "em", "ex", "ch", "rem", "vw", "vh", "vmin", "vmax", "cm", "mm", "in", "pc", "pt"
};

[
    Exposed=(Window,PaintWorklet),
    RuntimeEnabled=CSSTypedOM
] interface CSSLengthValue : CSSStyleValue {
    [NewObject] CSSLengthValue add(CSSLengthValue other);
    [NewObject] CSSLengthValue subtract(CSSLengthValue other);
    [NewObject] CSSLengthValue multiply(double value);
    [RaisesException, NewObject] CSSLengthValue divide(double value);

    [RaisesException, NewObject] static CSSLengthValue from(DOMString cssText);
    [RaisesException, NewObject] static CSSLengthValue from(double value, LengthType type);
    [RaisesException, NewObject] static CSSLengthValue from(CSSCalcDictionary dictionary);
};
