OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | |
4 * | |
5 * This library is free software; you can redistribute it and/or | |
6 * modify it under the terms of the GNU Library General Public | |
7 * License as published by the Free Software Foundation; either | |
8 * version 2 of the License, or (at your option) any later version. | |
9 * | |
10 * This library is distributed in the hope that it will be useful, | |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 * Library General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU Library General Public License | |
16 * along with this library; see the file COPYING.LIB. If not, write to | |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
18 * Boston, MA 02110-1301, USA. | |
19 * | |
20 */ | |
21 | |
22 #include "core/style/StyleBoxData.h" | |
23 | |
24 #include "core/style/ComputedStyle.h" | |
25 | |
26 namespace blink { | |
27 | |
28 struct SameSizeAsStyleBoxData : public RefCounted<SameSizeAsStyleBoxData> { | |
29 Length length[7]; | |
30 int z_index_; | |
31 uint32_t bitfields; | |
32 }; | |
33 | |
34 static_assert(sizeof(StyleBoxData) == sizeof(SameSizeAsStyleBoxData), | |
35 "StyleBoxData should stay small"); | |
36 | |
37 StyleBoxData::StyleBoxData() | |
38 : min_width_(ComputedStyle::InitialMinWidth()), | |
39 max_width_(ComputedStyle::InitialMaxWidth()), | |
40 min_height_(ComputedStyle::InitialMinHeight()), | |
41 max_height_(ComputedStyle::InitialMaxHeight()), | |
42 z_index_(0), | |
43 has_auto_z_index_(true), | |
44 box_sizing_(static_cast<unsigned>(ComputedStyle::InitialBoxSizing())), | |
45 box_decoration_break_( | |
46 static_cast<unsigned>(EBoxDecorationBreak::kSlice)) {} | |
47 | |
48 bool StyleBoxData::operator==(const StyleBoxData& o) const { | |
49 return width_ == o.width_ && height_ == o.height_ && | |
50 min_width_ == o.min_width_ && max_width_ == o.max_width_ && | |
51 min_height_ == o.min_height_ && max_height_ == o.max_height_ && | |
52 vertical_align_length_ == o.vertical_align_length_ && | |
53 z_index_ == o.z_index_ && has_auto_z_index_ == o.has_auto_z_index_ && | |
54 box_sizing_ == o.box_sizing_ && | |
55 box_decoration_break_ == o.box_decoration_break_; | |
56 } | |
57 | |
58 } // namespace blink | |
OLD | NEW |