2 * Copyright (c) 2013, Opera Software ASA. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
14 * * Neither the name of Opera Software ASA nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #ifndef BorderImageLengthBox_h
32 #define BorderImageLengthBox_h
34 #include "core/rendering/style/BorderImageLength.h"
38 // Represents a computed border image width or outset.
40 // http://www.w3.org/TR/css3-background/#border-image-width
41 // http://www.w3.org/TR/css3-background/#border-image-outset
42 class BorderImageLengthBox {
44 BorderImageLengthBox(Length length)
52 BorderImageLengthBox(double number)
60 BorderImageLengthBox(const BorderImageLength& top, const BorderImageLength& right,
61 const BorderImageLength& bottom, const BorderImageLength& left)
69 const BorderImageLength& left() const { return m_left; }
70 const BorderImageLength& right() const { return m_right; }
71 const BorderImageLength& top() const { return m_top; }
72 const BorderImageLength& bottom() const { return m_bottom; }
74 bool operator==(const BorderImageLengthBox& other) const
76 return m_left == other.m_left && m_right == other.m_right
77 && m_top == other.m_top && m_bottom == other.m_bottom;
80 bool operator!=(const BorderImageLengthBox& other) const
82 return !(*this == other);
87 return !(m_left.isZero() && m_right.isZero() && m_top.isZero() && m_bottom.isZero());
91 BorderImageLength m_left;
92 BorderImageLength m_right;
93 BorderImageLength m_top;
94 BorderImageLength m_bottom;
99 #endif // BorderImageLengthBox_h