| 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 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 if (resolvedFinalPosition < resolvedInitialPosition) | 772 if (resolvedFinalPosition < resolvedInitialPosition) |
| 773 resolvedFinalPosition = resolvedInitialPosition; | 773 resolvedFinalPosition = resolvedInitialPosition; |
| 774 | 774 |
| 775 return adoptPtr(new GridSpan(resolvedInitialPosition, resolvedFinalPosition)
); | 775 return adoptPtr(new GridSpan(resolvedInitialPosition, resolvedFinalPosition)
); |
| 776 } | 776 } |
| 777 | 777 |
| 778 size_t RenderGrid::resolveGridPositionFromStyle(const GridPosition& position, Gr
idPositionSide side) const | 778 size_t RenderGrid::resolveGridPositionFromStyle(const GridPosition& position, Gr
idPositionSide side) const |
| 779 { | 779 { |
| 780 // FIXME: Handle other values for grid-{row,column} like ranges or line name
s. | 780 // FIXME: Handle other values for grid-{row,column} like ranges or line name
s. |
| 781 switch (position.type()) { | 781 switch (position.type()) { |
| 782 case IntegerPosition: { | 782 case ExplicitPosition: { |
| 783 if (position.isPositive()) { | 783 if (position.isPositive()) { |
| 784 if (side == EndSide || side == AfterSide) | 784 if (side == EndSide || side == AfterSide) |
| 785 return std::max(0, position.integerPosition() - 2); | 785 return std::max(0, position.integerPosition() - 2); |
| 786 | 786 |
| 787 return position.integerPosition() - 1; | 787 return position.integerPosition() - 1; |
| 788 } | 788 } |
| 789 | 789 |
| 790 size_t resolvedPosition = abs(position.integerPosition()); | 790 size_t resolvedPosition = abs(position.integerPosition()); |
| 791 // FIXME: This returns one less than the expected result for side == Sta
rtSide or BeforeSide as we don't properly convert | 791 // FIXME: This returns one less than the expected result for side == Sta
rtSide or BeforeSide as we don't properly convert |
| 792 // the grid line to its grid track. However this avoids the issue of gro
wing the grid when inserting the item (e.g. -1 / auto). | 792 // the grid line to its grid track. However this avoids the issue of gro
wing the grid when inserting the item (e.g. -1 / auto). |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 if (isOutOfFlowPositioned()) | 863 if (isOutOfFlowPositioned()) |
| 864 return "RenderGrid (positioned)"; | 864 return "RenderGrid (positioned)"; |
| 865 if (isAnonymous()) | 865 if (isAnonymous()) |
| 866 return "RenderGrid (generated)"; | 866 return "RenderGrid (generated)"; |
| 867 if (isRelPositioned()) | 867 if (isRelPositioned()) |
| 868 return "RenderGrid (relative positioned)"; | 868 return "RenderGrid (relative positioned)"; |
| 869 return "RenderGrid"; | 869 return "RenderGrid"; |
| 870 } | 870 } |
| 871 | 871 |
| 872 } // namespace WebCore | 872 } // namespace WebCore |
| OLD | NEW |