| 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 28 matching lines...) Expand all Loading... |
| 39 typedef HashMap<String, Vector<size_t>> NamedGridLinesMap; | 39 typedef HashMap<String, Vector<size_t>> NamedGridLinesMap; |
| 40 typedef HashMap<size_t, Vector<String>, WTF::IntHash<size_t>, WTF::UnsignedWithZ
eroKeyHashTraits<size_t>> OrderedNamedGridLines; | 40 typedef HashMap<size_t, Vector<String>, WTF::IntHash<size_t>, WTF::UnsignedWithZ
eroKeyHashTraits<size_t>> OrderedNamedGridLines; |
| 41 | 41 |
| 42 class StyleGridData : public RefCounted<StyleGridData> { | 42 class StyleGridData : public RefCounted<StyleGridData> { |
| 43 public: | 43 public: |
| 44 static PassRefPtr<StyleGridData> create() { return adoptRef(new StyleGridDat
a); } | 44 static PassRefPtr<StyleGridData> create() { return adoptRef(new StyleGridDat
a); } |
| 45 PassRefPtr<StyleGridData> copy() const { return adoptRef(new StyleGridData(*
this)); } | 45 PassRefPtr<StyleGridData> copy() const { return adoptRef(new StyleGridData(*
this)); } |
| 46 | 46 |
| 47 bool operator==(const StyleGridData& o) const | 47 bool operator==(const StyleGridData& o) const |
| 48 { | 48 { |
| 49 return m_gridTemplateColumns == o.m_gridTemplateColumns && m_gridTemplat
eRows == o.m_gridTemplateRows && m_gridAutoFlow == o.m_gridAutoFlow && m_gridAut
oRows == o.m_gridAutoRows && m_gridAutoColumns == o.m_gridAutoColumns && m_named
GridColumnLines == o.m_namedGridColumnLines && m_namedGridRowLines == o.m_namedG
ridRowLines && m_orderedNamedGridColumnLines == o.m_orderedNamedGridColumnLines
&& m_orderedNamedGridRowLines == o.m_orderedNamedGridRowLines && m_namedGridArea
== o.m_namedGridArea && m_namedGridArea == o.m_namedGridArea && m_namedGridArea
RowCount == o.m_namedGridAreaRowCount && m_namedGridAreaColumnCount == o.m_named
GridAreaColumnCount; | 49 return m_gridTemplateColumns == o.m_gridTemplateColumns && m_gridTemplat
eRows == o.m_gridTemplateRows |
| 50 && m_gridAutoFlow == o.m_gridAutoFlow && m_gridAutoRows == o.m_gridAutoR
ows && m_gridAutoColumns == o.m_gridAutoColumns |
| 51 && m_namedGridColumnLines == o.m_namedGridColumnLines && m_namedGridRowL
ines == o.m_namedGridRowLines |
| 52 && m_orderedNamedGridColumnLines == o.m_orderedNamedGridColumnLines && m
_orderedNamedGridRowLines == o.m_orderedNamedGridRowLines |
| 53 && m_namedGridArea == o.m_namedGridArea && m_namedGridArea == o.m_namedG
ridArea |
| 54 && m_namedGridAreaRowCount == o.m_namedGridAreaRowCount && m_namedGridAr
eaColumnCount == o.m_namedGridAreaColumnCount |
| 55 && m_gridColumnGap == o.m_gridColumnGap && m_gridRowGap == o.m_gridRowGa
p; |
| 50 } | 56 } |
| 51 | 57 |
| 52 bool operator!=(const StyleGridData& o) const | 58 bool operator!=(const StyleGridData& o) const |
| 53 { | 59 { |
| 54 return !(*this == o); | 60 return !(*this == o); |
| 55 } | 61 } |
| 56 | 62 |
| 57 Vector<GridTrackSize> m_gridTemplateColumns; | 63 Vector<GridTrackSize> m_gridTemplateColumns; |
| 58 Vector<GridTrackSize> m_gridTemplateRows; | 64 Vector<GridTrackSize> m_gridTemplateRows; |
| 59 | 65 |
| 60 NamedGridLinesMap m_namedGridColumnLines; | 66 NamedGridLinesMap m_namedGridColumnLines; |
| 61 NamedGridLinesMap m_namedGridRowLines; | 67 NamedGridLinesMap m_namedGridRowLines; |
| 62 | 68 |
| 63 // In order to reconstruct the original named grid line order, we can't rely
on NamedGridLinesMap | 69 // In order to reconstruct the original named grid line order, we can't rely
on NamedGridLinesMap |
| 64 // as it loses the position if multiple grid lines are set on a single track
. | 70 // as it loses the position if multiple grid lines are set on a single track
. |
| 65 OrderedNamedGridLines m_orderedNamedGridColumnLines; | 71 OrderedNamedGridLines m_orderedNamedGridColumnLines; |
| 66 OrderedNamedGridLines m_orderedNamedGridRowLines; | 72 OrderedNamedGridLines m_orderedNamedGridRowLines; |
| 67 | 73 |
| 68 unsigned m_gridAutoFlow : GridAutoFlowBits; | 74 unsigned m_gridAutoFlow : GridAutoFlowBits; |
| 69 | 75 |
| 70 GridTrackSize m_gridAutoRows; | 76 GridTrackSize m_gridAutoRows; |
| 71 GridTrackSize m_gridAutoColumns; | 77 GridTrackSize m_gridAutoColumns; |
| 72 | 78 |
| 73 NamedGridAreaMap m_namedGridArea; | 79 NamedGridAreaMap m_namedGridArea; |
| 74 // Because m_namedGridArea doesn't store the unnamed grid areas, we need to
keep track | 80 // Because m_namedGridArea doesn't store the unnamed grid areas, we need to
keep track |
| 75 // of the explicit grid size defined by both named and unnamed grid areas. | 81 // of the explicit grid size defined by both named and unnamed grid areas. |
| 76 size_t m_namedGridAreaRowCount; | 82 size_t m_namedGridAreaRowCount; |
| 77 size_t m_namedGridAreaColumnCount; | 83 size_t m_namedGridAreaColumnCount; |
| 78 | 84 |
| 85 Length m_gridColumnGap; |
| 86 Length m_gridRowGap; |
| 87 |
| 79 private: | 88 private: |
| 80 StyleGridData(); | 89 StyleGridData(); |
| 81 StyleGridData(const StyleGridData&); | 90 StyleGridData(const StyleGridData&); |
| 82 }; | 91 }; |
| 83 | 92 |
| 84 } // namespace blink | 93 } // namespace blink |
| 85 | 94 |
| 86 #endif // StyleGridData_h | 95 #endif // StyleGridData_h |
| OLD | NEW |