| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 ASSERT(m_columnCount); | 45 ASSERT(m_columnCount); |
| 46 } | 46 } |
| 47 | 47 |
| 48 static String stringForPosition(const NamedGridAreaMap& gridAreaMap, size_t row,
size_t column) | 48 static String stringForPosition(const NamedGridAreaMap& gridAreaMap, size_t row,
size_t column) |
| 49 { | 49 { |
| 50 Vector<String> candidates; | 50 Vector<String> candidates; |
| 51 | 51 |
| 52 NamedGridAreaMap::const_iterator end = gridAreaMap.end(); | 52 NamedGridAreaMap::const_iterator end = gridAreaMap.end(); |
| 53 for (NamedGridAreaMap::const_iterator it = gridAreaMap.begin(); it != end; +
+it) { | 53 for (NamedGridAreaMap::const_iterator it = gridAreaMap.begin(); it != end; +
+it) { |
| 54 const GridCoordinate& coordinate = it->value; | 54 const GridCoordinate& coordinate = it->value; |
| 55 if (row >= coordinate.rows.initialPositionIndex && row <= coordinate.row
s.finalPositionIndex) | 55 if (row >= coordinate.rows.initialPositionIndex.integerPosition() && row
<= coordinate.rows.finalPositionIndex.integerPosition()) |
| 56 candidates.append(it->key); | 56 candidates.append(it->key); |
| 57 } | 57 } |
| 58 | 58 |
| 59 end = gridAreaMap.end(); | 59 end = gridAreaMap.end(); |
| 60 for (NamedGridAreaMap::const_iterator it = gridAreaMap.begin(); it != end; +
+it) { | 60 for (NamedGridAreaMap::const_iterator it = gridAreaMap.begin(); it != end; +
+it) { |
| 61 const GridCoordinate& coordinate = it->value; | 61 const GridCoordinate& coordinate = it->value; |
| 62 if (column >= coordinate.columns.initialPositionIndex && column <= coord
inate.columns.finalPositionIndex && candidates.contains(it->key)) | 62 if (column >= coordinate.columns.initialPositionIndex.integerPosition()
&& column <= coordinate.columns.finalPositionIndex.integerPosition() && candidat
es.contains(it->key)) |
| 63 return it->key; | 63 return it->key; |
| 64 } | 64 } |
| 65 | 65 |
| 66 return "."; | 66 return "."; |
| 67 } | 67 } |
| 68 | 68 |
| 69 String CSSGridTemplateValue::customCSSText() const | 69 String CSSGridTemplateValue::customCSSText() const |
| 70 { | 70 { |
| 71 StringBuilder builder; | 71 StringBuilder builder; |
| 72 for (size_t row = 0; row < m_rowCount; ++row) { | 72 for (size_t row = 0; row < m_rowCount; ++row) { |
| 73 builder.append('\"'); | 73 builder.append('\"'); |
| 74 for (size_t column = 0; column < m_columnCount; ++column) { | 74 for (size_t column = 0; column < m_columnCount; ++column) { |
| 75 builder.append(stringForPosition(m_gridAreaMap, row, column)); | 75 builder.append(stringForPosition(m_gridAreaMap, row, column)); |
| 76 if (column != m_columnCount - 1) | 76 if (column != m_columnCount - 1) |
| 77 builder.append(' '); | 77 builder.append(' '); |
| 78 } | 78 } |
| 79 builder.append('\"'); | 79 builder.append('\"'); |
| 80 if (row != m_rowCount - 1) | 80 if (row != m_rowCount - 1) |
| 81 builder.append(' '); | 81 builder.append(' '); |
| 82 } | 82 } |
| 83 return builder.toString(); | 83 return builder.toString(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 } // namespace WebCore | 86 } // namespace WebCore |
| OLD | NEW |