Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/FrameSetPainter.h" | 6 #include "core/paint/FrameSetPainter.h" |
| 7 | 7 |
| 8 #include "core/html/HTMLFrameSetElement.h" | 8 #include "core/html/HTMLFrameSetElement.h" |
| 9 #include "core/layout/LayoutFrameSet.h" | 9 #include "core/layout/LayoutFrameSet.h" |
| 10 #include "core/paint/LayoutObjectDrawingRecorder.h" | 10 #include "core/paint/LayoutObjectDrawingRecorder.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 yPos += borderThickness; | 103 yPos += borderThickness; |
| 104 } | 104 } |
| 105 } | 105 } |
| 106 } | 106 } |
| 107 | 107 |
| 108 void FrameSetPainter::paintChildren(const PaintInfo& paintInfo, const LayoutPoin t& adjustedPaintOffset) | 108 void FrameSetPainter::paintChildren(const PaintInfo& paintInfo, const LayoutPoin t& adjustedPaintOffset) |
| 109 { | 109 { |
| 110 // Paint only those children that fit in the grid. | 110 // Paint only those children that fit in the grid. |
| 111 // Remaining frames are "hidden". | 111 // Remaining frames are "hidden". |
| 112 // See also LayoutFrameSet::positionFrames. | 112 // See also LayoutFrameSet::positionFrames. |
| 113 LayoutObject* child = m_layoutFrameSet.firstChild(); | 113 LayoutObject* child = m_layoutFrameSet.firstChild(); |
|
wkorman
2015/06/12 19:14:48
It looks like this could be null, at least theoret
| |
| 114 size_t rows = m_layoutFrameSet.rows().m_sizes.size(); | 114 size_t rows = m_layoutFrameSet.rows().m_sizes.size(); |
| 115 size_t cols = m_layoutFrameSet.columns().m_sizes.size(); | 115 size_t cols = m_layoutFrameSet.columns().m_sizes.size(); |
| 116 for (size_t r = 0; r < rows; r++) { | 116 for (size_t r = 0; r < rows; r++) { |
| 117 for (size_t c = 0; c < cols; c++) { | 117 for (size_t c = 0; c < cols; c++) { |
| 118 if (child->isLayoutBoxModelObject() && toLayoutBoxModelObject(child) ->hasSelfPaintingLayer()) | |
|
wkorman
2015/06/12 19:14:48
Worth adding a comment on why we do this?
chrishtr
2015/06/12 19:57:28
Done.
| |
| 119 continue; | |
| 118 child->paint(paintInfo, adjustedPaintOffset); | 120 child->paint(paintInfo, adjustedPaintOffset); |
| 119 child = child->nextSibling(); | 121 child = child->nextSibling(); |
| 120 if (!child) | 122 if (!child) |
| 121 return; | 123 return; |
| 122 } | 124 } |
| 123 } | 125 } |
| 124 } | 126 } |
| 125 | 127 |
| 126 void FrameSetPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint Offset) | 128 void FrameSetPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint Offset) |
| 127 { | 129 { |
| 128 if (paintInfo.phase != PaintPhaseForeground) | 130 if (paintInfo.phase != PaintPhaseForeground) |
| 129 return; | 131 return; |
| 130 | 132 |
| 131 LayoutObject* child = m_layoutFrameSet.firstChild(); | 133 LayoutObject* child = m_layoutFrameSet.firstChild(); |
| 132 if (!child) | 134 if (!child) |
| 133 return; | 135 return; |
| 134 | 136 |
| 135 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutFrameSet.location(); | 137 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutFrameSet.location(); |
| 136 paintChildren(paintInfo, adjustedPaintOffset); | 138 paintChildren(paintInfo, adjustedPaintOffset); |
| 137 paintBorders(paintInfo, adjustedPaintOffset); | 139 paintBorders(paintInfo, adjustedPaintOffset); |
| 138 } | 140 } |
| 139 | 141 |
| 140 } // namespace blink | 142 } // namespace blink |
| OLD | NEW |