Chromium Code Reviews| 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 * * Redistributions of source code must retain the above copyright | 4 * * Redistributions of source code must retain the above copyright |
| 5 * notice, this list of conditions and the following disclaimer. | 5 * notice, this list of conditions and the following disclaimer. |
| 6 * * Redistributions in binary form must reproduce the above | 6 * * Redistributions in binary form must reproduce the above |
| 7 * copyright notice, this list of conditions and the following disclaimer | 7 * copyright notice, this list of conditions and the following disclaimer |
| 8 * in the documentation and/or other materials provided with the | 8 * in the documentation and/or other materials provided with the |
| 9 * distribution. | 9 * distribution. |
| 10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 474 ++currentNamedGridLine; | 474 ++currentNamedGridLine; |
| 475 trackSizes.append(convertGridTrackSize(state, currValue)); | 475 trackSizes.append(convertGridTrackSize(state, currValue)); |
| 476 } | 476 } |
| 477 | 477 |
| 478 // The parser should have rejected any <track-list> without any <track-size> as | 478 // The parser should have rejected any <track-list> without any <track-size> as |
| 479 // this is not conformant to the syntax. | 479 // this is not conformant to the syntax. |
| 480 ASSERT(!trackSizes.isEmpty()); | 480 ASSERT(!trackSizes.isEmpty()); |
| 481 return true; | 481 return true; |
| 482 } | 482 } |
| 483 | 483 |
| 484 void StyleBuilderConverter::convertOrderedNamedGridLinesMapToNamedGridLinesMap(c onst OrderedNamedGridLines& orderedNamedGridLines, NamedGridLinesMap& namedGridL ines) | |
| 485 { | |
| 486 ASSERT(namedGridLines.size() == 0); | |
| 487 | |
| 488 if (orderedNamedGridLines.size() == 0) | |
| 489 return; | |
| 490 | |
| 491 for (auto& orderedNamedGridLine : orderedNamedGridLines) { | |
| 492 for (auto& lineName : orderedNamedGridLine.value) { | |
| 493 NamedGridLinesMap::AddResult startResult = namedGridLines.add(lineNa me, Vector<size_t>()); | |
| 494 startResult.storedValue->value.append(orderedNamedGridLine.key); | |
| 495 } | |
| 496 } | |
| 497 | |
| 498 for (auto& namedGridLine : namedGridLines) { | |
| 499 Vector<size_t> gridLineIndexes = namedGridLine.value; | |
| 500 std::sort(gridLineIndexes.begin(), gridLineIndexes.end()); | |
|
Julien - ping for review
2014/11/10 16:03:33
We may know do 2 sorting as we generate the implic
| |
| 501 } | |
| 502 } | |
| 503 | |
| 484 void StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(const Named GridAreaMap& namedGridAreas, NamedGridLinesMap& namedGridLines, GridTrackSizingD irection direction) | 504 void StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(const Named GridAreaMap& namedGridAreas, NamedGridLinesMap& namedGridLines, GridTrackSizingD irection direction) |
| 485 { | 505 { |
| 486 for (const auto& namedGridAreaEntry : namedGridAreas) { | 506 for (const auto& namedGridAreaEntry : namedGridAreas) { |
| 487 GridSpan areaSpan = direction == ForRows ? namedGridAreaEntry.value.rows : namedGridAreaEntry.value.columns; | 507 GridSpan areaSpan = direction == ForRows ? namedGridAreaEntry.value.rows : namedGridAreaEntry.value.columns; |
| 488 { | 508 { |
| 489 NamedGridLinesMap::AddResult startResult = namedGridLines.add(namedG ridAreaEntry.key + "-start", Vector<size_t>()); | 509 NamedGridLinesMap::AddResult startResult = namedGridLines.add(namedG ridAreaEntry.key + "-start", Vector<size_t>()); |
| 490 startResult.storedValue->value.append(areaSpan.resolvedInitialPositi on.toInt()); | 510 startResult.storedValue->value.append(areaSpan.resolvedInitialPositi on.toInt()); |
| 491 std::sort(startResult.storedValue->value.begin(), startResult.stored Value->value.end()); | 511 std::sort(startResult.storedValue->value.begin(), startResult.stored Value->value.end()); |
| 492 } | 512 } |
| 493 { | 513 { |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 819 CSSPrimitiveValue* primitiveValueZ = toCSSPrimitiveValue(list->item(2)); | 839 CSSPrimitiveValue* primitiveValueZ = toCSSPrimitiveValue(list->item(2)); |
| 820 | 840 |
| 821 return TransformOrigin( | 841 return TransformOrigin( |
| 822 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX) , | 842 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX) , |
| 823 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY) , | 843 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY) , |
| 824 StyleBuilderConverter::convertComputedLength<float>(state, primitiveValu eZ) | 844 StyleBuilderConverter::convertComputedLength<float>(state, primitiveValu eZ) |
| 825 ); | 845 ); |
| 826 } | 846 } |
| 827 | 847 |
| 828 } // namespace blink | 848 } // namespace blink |
| OLD | NEW |