| 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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 static void convertGridLineNamesList( | 667 static void convertGridLineNamesList( |
| 668 const CSSValue& value, | 668 const CSSValue& value, |
| 669 size_t currentNamedGridLine, | 669 size_t currentNamedGridLine, |
| 670 NamedGridLinesMap& namedGridLines, | 670 NamedGridLinesMap& namedGridLines, |
| 671 OrderedNamedGridLines& orderedNamedGridLines) { | 671 OrderedNamedGridLines& orderedNamedGridLines) { |
| 672 ASSERT(value.isGridLineNamesValue()); | 672 ASSERT(value.isGridLineNamesValue()); |
| 673 | 673 |
| 674 for (auto& namedGridLineValue : toCSSValueList(value)) { | 674 for (auto& namedGridLineValue : toCSSValueList(value)) { |
| 675 String namedGridLine = toCSSCustomIdentValue(*namedGridLineValue).value(); | 675 String namedGridLine = toCSSCustomIdentValue(*namedGridLineValue).value(); |
| 676 NamedGridLinesMap::AddResult result = | 676 NamedGridLinesMap::AddResult result = |
| 677 namedGridLines.add(namedGridLine, Vector<size_t>()); | 677 namedGridLines.insert(namedGridLine, Vector<size_t>()); |
| 678 result.storedValue->value.push_back(currentNamedGridLine); | 678 result.storedValue->value.push_back(currentNamedGridLine); |
| 679 OrderedNamedGridLines::AddResult orderedInsertionResult = | 679 OrderedNamedGridLines::AddResult orderedInsertionResult = |
| 680 orderedNamedGridLines.add(currentNamedGridLine, Vector<String>()); | 680 orderedNamedGridLines.insert(currentNamedGridLine, Vector<String>()); |
| 681 orderedInsertionResult.storedValue->value.push_back(namedGridLine); | 681 orderedInsertionResult.storedValue->value.push_back(namedGridLine); |
| 682 } | 682 } |
| 683 } | 683 } |
| 684 | 684 |
| 685 Vector<GridTrackSize> StyleBuilderConverter::convertGridTrackSizeList( | 685 Vector<GridTrackSize> StyleBuilderConverter::convertGridTrackSizeList( |
| 686 StyleResolverState& state, | 686 StyleResolverState& state, |
| 687 const CSSValue& value) { | 687 const CSSValue& value) { |
| 688 DCHECK(value.isValueList()); | 688 DCHECK(value.isValueList()); |
| 689 Vector<GridTrackSize> trackSizes; | 689 Vector<GridTrackSize> trackSizes; |
| 690 for (auto& currValue : toCSSValueList(value)) { | 690 for (auto& currValue : toCSSValueList(value)) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 const OrderedNamedGridLines& orderedNamedGridLines, | 755 const OrderedNamedGridLines& orderedNamedGridLines, |
| 756 NamedGridLinesMap& namedGridLines) { | 756 NamedGridLinesMap& namedGridLines) { |
| 757 ASSERT(namedGridLines.size() == 0); | 757 ASSERT(namedGridLines.size() == 0); |
| 758 | 758 |
| 759 if (orderedNamedGridLines.size() == 0) | 759 if (orderedNamedGridLines.size() == 0) |
| 760 return; | 760 return; |
| 761 | 761 |
| 762 for (auto& orderedNamedGridLine : orderedNamedGridLines) { | 762 for (auto& orderedNamedGridLine : orderedNamedGridLines) { |
| 763 for (auto& lineName : orderedNamedGridLine.value) { | 763 for (auto& lineName : orderedNamedGridLine.value) { |
| 764 NamedGridLinesMap::AddResult startResult = | 764 NamedGridLinesMap::AddResult startResult = |
| 765 namedGridLines.add(lineName, Vector<size_t>()); | 765 namedGridLines.insert(lineName, Vector<size_t>()); |
| 766 startResult.storedValue->value.push_back(orderedNamedGridLine.key); | 766 startResult.storedValue->value.push_back(orderedNamedGridLine.key); |
| 767 } | 767 } |
| 768 } | 768 } |
| 769 | 769 |
| 770 for (auto& namedGridLine : namedGridLines) { | 770 for (auto& namedGridLine : namedGridLines) { |
| 771 Vector<size_t> gridLineIndexes = namedGridLine.value; | 771 Vector<size_t> gridLineIndexes = namedGridLine.value; |
| 772 std::sort(gridLineIndexes.begin(), gridLineIndexes.end()); | 772 std::sort(gridLineIndexes.begin(), gridLineIndexes.end()); |
| 773 } | 773 } |
| 774 } | 774 } |
| 775 | 775 |
| 776 void StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea( | 776 void StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea( |
| 777 const NamedGridAreaMap& namedGridAreas, | 777 const NamedGridAreaMap& namedGridAreas, |
| 778 NamedGridLinesMap& namedGridLines, | 778 NamedGridLinesMap& namedGridLines, |
| 779 GridTrackSizingDirection direction) { | 779 GridTrackSizingDirection direction) { |
| 780 for (const auto& namedGridAreaEntry : namedGridAreas) { | 780 for (const auto& namedGridAreaEntry : namedGridAreas) { |
| 781 GridSpan areaSpan = direction == ForRows ? namedGridAreaEntry.value.rows | 781 GridSpan areaSpan = direction == ForRows ? namedGridAreaEntry.value.rows |
| 782 : namedGridAreaEntry.value.columns; | 782 : namedGridAreaEntry.value.columns; |
| 783 { | 783 { |
| 784 NamedGridLinesMap::AddResult startResult = namedGridLines.add( | 784 NamedGridLinesMap::AddResult startResult = namedGridLines.insert( |
| 785 namedGridAreaEntry.key + "-start", Vector<size_t>()); | 785 namedGridAreaEntry.key + "-start", Vector<size_t>()); |
| 786 startResult.storedValue->value.push_back(areaSpan.startLine()); | 786 startResult.storedValue->value.push_back(areaSpan.startLine()); |
| 787 std::sort(startResult.storedValue->value.begin(), | 787 std::sort(startResult.storedValue->value.begin(), |
| 788 startResult.storedValue->value.end()); | 788 startResult.storedValue->value.end()); |
| 789 } | 789 } |
| 790 { | 790 { |
| 791 NamedGridLinesMap::AddResult endResult = | 791 NamedGridLinesMap::AddResult endResult = namedGridLines.insert( |
| 792 namedGridLines.add(namedGridAreaEntry.key + "-end", Vector<size_t>()); | 792 namedGridAreaEntry.key + "-end", Vector<size_t>()); |
| 793 endResult.storedValue->value.push_back(areaSpan.endLine()); | 793 endResult.storedValue->value.push_back(areaSpan.endLine()); |
| 794 std::sort(endResult.storedValue->value.begin(), | 794 std::sort(endResult.storedValue->value.begin(), |
| 795 endResult.storedValue->value.end()); | 795 endResult.storedValue->value.end()); |
| 796 } | 796 } |
| 797 } | 797 } |
| 798 } | 798 } |
| 799 | 799 |
| 800 Length StyleBuilderConverter::convertLength(const StyleResolverState& state, | 800 Length StyleBuilderConverter::convertLength(const StyleResolverState& state, |
| 801 const CSSValue& value) { | 801 const CSSValue& value) { |
| 802 return toCSSPrimitiveValue(value).convertToLength( | 802 return toCSSPrimitiveValue(value).convertToLength( |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 } | 1395 } |
| 1396 | 1396 |
| 1397 const CSSValue& StyleBuilderConverter::convertRegisteredPropertyValue( | 1397 const CSSValue& StyleBuilderConverter::convertRegisteredPropertyValue( |
| 1398 const StyleResolverState& state, | 1398 const StyleResolverState& state, |
| 1399 const CSSValue& value) { | 1399 const CSSValue& value) { |
| 1400 return computeRegisteredPropertyValue(state.cssToLengthConversionData(), | 1400 return computeRegisteredPropertyValue(state.cssToLengthConversionData(), |
| 1401 value); | 1401 value); |
| 1402 } | 1402 } |
| 1403 | 1403 |
| 1404 } // namespace blink | 1404 } // namespace blink |
| OLD | NEW |