OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 13 matching lines...) Expand all Loading... |
24 */ | 24 */ |
25 | 25 |
26 #ifndef StyleGridData_h | 26 #ifndef StyleGridData_h |
27 #define StyleGridData_h | 27 #define StyleGridData_h |
28 | 28 |
29 #include "core/rendering/style/GridTrackSize.h" | 29 #include "core/rendering/style/GridTrackSize.h" |
30 #include "core/rendering/style/RenderStyleConstants.h" | 30 #include "core/rendering/style/RenderStyleConstants.h" |
31 #include <wtf/PassRefPtr.h> | 31 #include <wtf/PassRefPtr.h> |
32 #include <wtf/RefCounted.h> | 32 #include <wtf/RefCounted.h> |
33 #include <wtf/Vector.h> | 33 #include <wtf/Vector.h> |
| 34 #include <wtf/text/WTFString.h> |
34 | 35 |
35 namespace WebCore { | 36 namespace WebCore { |
36 | 37 |
| 38 typedef HashMap<String, Vector<size_t> > NamedGridLinesMap; |
| 39 |
37 class StyleGridData : public RefCounted<StyleGridData> { | 40 class StyleGridData : public RefCounted<StyleGridData> { |
38 public: | 41 public: |
39 static PassRefPtr<StyleGridData> create() { return adoptRef(new StyleGridDat
a); } | 42 static PassRefPtr<StyleGridData> create() { return adoptRef(new StyleGridDat
a); } |
40 PassRefPtr<StyleGridData> copy() const { return adoptRef(new StyleGridData(*
this)); } | 43 PassRefPtr<StyleGridData> copy() const { return adoptRef(new StyleGridData(*
this)); } |
41 | 44 |
42 bool operator==(const StyleGridData& o) const | 45 bool operator==(const StyleGridData& o) const |
43 { | 46 { |
44 return m_gridColumns == o.m_gridColumns && m_gridRows == o.m_gridRows &&
m_gridAutoFlow == o.m_gridAutoFlow && m_gridAutoRows == o.m_gridAutoRows && m_g
ridAutoColumns == o.m_gridAutoColumns; | 47 return m_gridColumns == o.m_gridColumns && m_gridRows == o.m_gridRows &&
m_gridAutoFlow == o.m_gridAutoFlow && m_gridAutoRows == o.m_gridAutoRows && m_g
ridAutoColumns == o.m_gridAutoColumns && m_namedGridColumnLines == o.m_namedGrid
ColumnLines && m_namedGridRowLines == o.m_namedGridRowLines; |
45 } | 48 } |
46 | 49 |
47 bool operator!=(const StyleGridData& o) const | 50 bool operator!=(const StyleGridData& o) const |
48 { | 51 { |
49 return !(*this == o); | 52 return !(*this == o); |
50 } | 53 } |
51 | 54 |
52 // FIXME: Update the naming of the following variables. | 55 // FIXME: Update the naming of the following variables. |
53 Vector<GridTrackSize> m_gridColumns; | 56 Vector<GridTrackSize> m_gridColumns; |
54 Vector<GridTrackSize> m_gridRows; | 57 Vector<GridTrackSize> m_gridRows; |
55 | 58 |
| 59 NamedGridLinesMap m_namedGridColumnLines; |
| 60 NamedGridLinesMap m_namedGridRowLines; |
| 61 |
56 GridAutoFlow m_gridAutoFlow; | 62 GridAutoFlow m_gridAutoFlow; |
57 | 63 |
58 GridTrackSize m_gridAutoRows; | 64 GridTrackSize m_gridAutoRows; |
59 GridTrackSize m_gridAutoColumns; | 65 GridTrackSize m_gridAutoColumns; |
60 | 66 |
61 private: | 67 private: |
62 StyleGridData(); | 68 StyleGridData(); |
63 StyleGridData(const StyleGridData&); | 69 StyleGridData(const StyleGridData&); |
64 }; | 70 }; |
65 | 71 |
66 } // namespace WebCore | 72 } // namespace WebCore |
67 | 73 |
68 #endif // StyleGridData_h | 74 #endif // StyleGridData_h |
OLD | NEW |