| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple 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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 break; | 568 break; |
| 569 | 569 |
| 570 fractionValueBasedOnGridItemsRatio = track.m_normalizedFlexValue; | 570 fractionValueBasedOnGridItemsRatio = track.m_normalizedFlexValue; |
| 571 } | 571 } |
| 572 | 572 |
| 573 accumulatedFractions += track.m_flex; | 573 accumulatedFractions += track.m_flex; |
| 574 // This item was processed so we re-add its used breadth to the availabl
e space to accurately count the remaining space. | 574 // This item was processed so we re-add its used breadth to the availabl
e space to accurately count the remaining space. |
| 575 availableLogicalSpaceIgnoringFractionTracks += track.m_track->baseSize()
; | 575 availableLogicalSpaceIgnoringFractionTracks += track.m_track->baseSize()
; |
| 576 } | 576 } |
| 577 | 577 |
| 578 // Let flex factor sum be the sum of the flex factors of the flexible tracks
. If this value |
| 579 // is less than 1, set it to 1 instead. |
| 580 if (accumulatedFractions < 1) |
| 581 return availableLogicalSpaceIgnoringFractionTracks; |
| 582 |
| 578 return availableLogicalSpaceIgnoringFractionTracks / accumulatedFractions; | 583 return availableLogicalSpaceIgnoringFractionTracks / accumulatedFractions; |
| 579 } | 584 } |
| 580 | 585 |
| 581 bool LayoutGrid::hasDefiniteLogicalSize(GridTrackSizingDirection direction) cons
t | 586 bool LayoutGrid::hasDefiniteLogicalSize(GridTrackSizingDirection direction) cons
t |
| 582 { | 587 { |
| 583 return (direction == ForRows) ? hasDefiniteLogicalHeight() : hasDefiniteLogi
calWidth(); | 588 return (direction == ForRows) ? hasDefiniteLogicalHeight() : hasDefiniteLogi
calWidth(); |
| 584 } | 589 } |
| 585 | 590 |
| 586 GridTrackSize LayoutGrid::gridTrackSize(GridTrackSizingDirection direction, size
_t i) const | 591 GridTrackSize LayoutGrid::gridTrackSize(GridTrackSizingDirection direction, size
_t i) const |
| 587 { | 592 { |
| (...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1919 | 1924 |
| 1920 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child)); | 1925 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child)); |
| 1921 } | 1926 } |
| 1922 | 1927 |
| 1923 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa
intOffset) | 1928 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa
intOffset) |
| 1924 { | 1929 { |
| 1925 GridPainter(*this).paintChildren(paintInfo, paintOffset); | 1930 GridPainter(*this).paintChildren(paintInfo, paintOffset); |
| 1926 } | 1931 } |
| 1927 | 1932 |
| 1928 } // namespace blink | 1933 } // namespace blink |
| OLD | NEW |