| 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 15 matching lines...) Expand all Loading... |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "core/rendering/RenderGrid.h" | 27 #include "core/rendering/RenderGrid.h" |
| 28 | 28 |
| 29 #include "core/paint/GridPainter.h" | 29 #include "core/paint/GridPainter.h" |
| 30 #include "core/rendering/RenderLayer.h" | 30 #include "core/rendering/RenderLayer.h" |
| 31 #include "core/rendering/RenderView.h" | 31 #include "core/rendering/RenderView.h" |
| 32 #include "core/rendering/TextAutosizer.h" | 32 #include "core/rendering/TextAutosizer.h" |
| 33 #include "core/rendering/style/GridCoordinate.h" | 33 #include "core/rendering/style/GridCoordinate.h" |
| 34 #include "core/rendering/style/RenderStyle.h" | 34 #include "core/rendering/style/RenderStyle.h" |
| 35 #include "platform/LengthFunctions.h" | 35 #include "platform/LengthFunctions.h" |
| 36 #include "wtf/VectorTraits.h" | |
| 37 | 36 |
| 38 namespace blink { | 37 namespace blink { |
| 39 | 38 |
| 40 static const int infinity = -1; | 39 static const int infinity = -1; |
| 41 | 40 |
| 42 class GridTrack { | 41 class GridTrack { |
| 43 public: | 42 public: |
| 44 GridTrack() | 43 GridTrack() |
| 45 : m_usedBreadth(0) | 44 : m_usedBreadth(0) |
| 46 , m_maxBreadth(0) | 45 , m_maxBreadth(0) |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 { | 688 { |
| 690 visitor->trace(m_gridItem); | 689 visitor->trace(m_gridItem); |
| 691 } | 690 } |
| 692 | 691 |
| 693 private: | 692 private: |
| 694 RawPtrWillBeMember<RenderBox> m_gridItem; | 693 RawPtrWillBeMember<RenderBox> m_gridItem; |
| 695 GridCoordinate m_coordinate; | 694 GridCoordinate m_coordinate; |
| 696 size_t m_span; | 695 size_t m_span; |
| 697 }; | 696 }; |
| 698 | 697 |
| 699 } // namespace blink | |
| 700 | |
| 701 namespace WTF { | |
| 702 | |
| 703 template<> | |
| 704 struct VectorTraits<blink::GridItemWithSpan> : SimpleClassVectorTraits<blink::Gr
idItemWithSpan> { | |
| 705 // needsDestruction is by default defined in terms of IsPod<>, but as | |
| 706 // it doesn't handle embedded structs/enums (e.g., GridCoordinate), | |
| 707 // override it here. | |
| 708 static const bool needsDestruction = false; | |
| 709 }; | |
| 710 | |
| 711 } // namespace WTF | |
| 712 | |
| 713 namespace blink { | |
| 714 | |
| 715 bool RenderGrid::spanningItemCrossesFlexibleSizedTracks(const GridCoordinate& co
ordinate, GridTrackSizingDirection direction) const | 698 bool RenderGrid::spanningItemCrossesFlexibleSizedTracks(const GridCoordinate& co
ordinate, GridTrackSizingDirection direction) const |
| 716 { | 699 { |
| 717 const GridResolvedPosition initialTrackPosition = (direction == ForColumns)
? coordinate.columns.resolvedInitialPosition : coordinate.rows.resolvedInitialPo
sition; | 700 const GridResolvedPosition initialTrackPosition = (direction == ForColumns)
? coordinate.columns.resolvedInitialPosition : coordinate.rows.resolvedInitialPo
sition; |
| 718 const GridResolvedPosition finalTrackPosition = (direction == ForColumns) ?
coordinate.columns.resolvedFinalPosition : coordinate.rows.resolvedFinalPosition
; | 701 const GridResolvedPosition finalTrackPosition = (direction == ForColumns) ?
coordinate.columns.resolvedFinalPosition : coordinate.rows.resolvedFinalPosition
; |
| 719 | 702 |
| 720 for (GridResolvedPosition trackPosition = initialTrackPosition; trackPositio
n <= finalTrackPosition; ++trackPosition) { | 703 for (GridResolvedPosition trackPosition = initialTrackPosition; trackPositio
n <= finalTrackPosition; ++trackPosition) { |
| 721 const GridTrackSize& trackSize = gridTrackSize(direction, trackPosition.
toInt()); | 704 const GridTrackSize& trackSize = gridTrackSize(direction, trackPosition.
toInt()); |
| 722 if (trackSize.minTrackBreadth().isFlex() || trackSize.maxTrackBreadth().
isFlex()) | 705 if (trackSize.minTrackBreadth().isFlex() || trackSize.maxTrackBreadth().
isFlex()) |
| 723 return true; | 706 return true; |
| 724 } | 707 } |
| (...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1440 if (isOutOfFlowPositioned()) | 1423 if (isOutOfFlowPositioned()) |
| 1441 return "RenderGrid (positioned)"; | 1424 return "RenderGrid (positioned)"; |
| 1442 if (isAnonymous()) | 1425 if (isAnonymous()) |
| 1443 return "RenderGrid (generated)"; | 1426 return "RenderGrid (generated)"; |
| 1444 if (isRelPositioned()) | 1427 if (isRelPositioned()) |
| 1445 return "RenderGrid (relative positioned)"; | 1428 return "RenderGrid (relative positioned)"; |
| 1446 return "RenderGrid"; | 1429 return "RenderGrid"; |
| 1447 } | 1430 } |
| 1448 | 1431 |
| 1449 } // namespace blink | 1432 } // namespace blink |
| OLD | NEW |