| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2011 Adobe Systems Incorporated. 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
| 9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
| 10 * disclaimer. | 10 * disclaimer. |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // FIXME: We need to find a way to set up overflow properly. Our flow thread
hasn't gotten a layout | 112 // FIXME: We need to find a way to set up overflow properly. Our flow thread
hasn't gotten a layout |
| 113 // yet, so we can't look to it for correct information. It's possible we cou
ld wait until after the RenderFlowThread | 113 // yet, so we can't look to it for correct information. It's possible we cou
ld wait until after the RenderFlowThread |
| 114 // gets a layout, and then try to propagate overflow information back to the
region, and then mark for a second layout. | 114 // gets a layout, and then try to propagate overflow information back to the
region, and then mark for a second layout. |
| 115 // That second layout would then be able to use the information from the Ren
derFlowThread to set up overflow. | 115 // That second layout would then be able to use the information from the Ren
derFlowThread to set up overflow. |
| 116 // | 116 // |
| 117 // The big problem though is that overflow needs to be region-specific. We c
an't simply use the RenderFlowThread's global | 117 // The big problem though is that overflow needs to be region-specific. We c
an't simply use the RenderFlowThread's global |
| 118 // overflow values, since then we'd always think any narrow region had huge
overflow (all the way to the width of the | 118 // overflow values, since then we'd always think any narrow region had huge
overflow (all the way to the width of the |
| 119 // RenderFlowThread itself). | 119 // RenderFlowThread itself). |
| 120 } | 120 } |
| 121 | 121 |
| 122 void RenderRegion::repaintFlowThreadContentRectangle(const LayoutRect& repaintRe
ct, const LayoutRect& flowThreadPortionRect, const LayoutRect& flowThreadPortion
OverflowRect, const LayoutPoint& regionLocation) const | 122 void RenderRegion::paintInvalidaitonOfFlowThreadContentRectangle(const LayoutRec
t& paintInvalidationRect, const LayoutRect& flowThreadPortionRect, const LayoutR
ect& flowThreadPortionOverflowRect, const LayoutPoint& regionLocation) const |
| 123 { | 123 { |
| 124 ASSERT(isValid()); | 124 ASSERT(isValid()); |
| 125 | 125 |
| 126 // We only have to issue a repaint in this region if the region rect interse
cts the repaint rect. | 126 // We only have to issue a paint invalidation in this region if the region r
ect intersects the paint invalidation rect. |
| 127 LayoutRect flippedFlowThreadPortionRect(flowThreadPortionRect); | 127 LayoutRect flippedFlowThreadPortionRect(flowThreadPortionRect); |
| 128 LayoutRect flippedFlowThreadPortionOverflowRect(flowThreadPortionOverflowRec
t); | 128 LayoutRect flippedFlowThreadPortionOverflowRect(flowThreadPortionOverflowRec
t); |
| 129 flowThread()->flipForWritingMode(flippedFlowThreadPortionRect); // Put the r
egion rects into physical coordinates. | 129 flowThread()->flipForWritingMode(flippedFlowThreadPortionRect); // Put the r
egion rects into physical coordinates. |
| 130 flowThread()->flipForWritingMode(flippedFlowThreadPortionOverflowRect); | 130 flowThread()->flipForWritingMode(flippedFlowThreadPortionOverflowRect); |
| 131 | 131 |
| 132 LayoutRect clippedRect(repaintRect); | 132 LayoutRect clippedRect(paintInvalidationRect); |
| 133 clippedRect.intersect(flippedFlowThreadPortionOverflowRect); | 133 clippedRect.intersect(flippedFlowThreadPortionOverflowRect); |
| 134 if (clippedRect.isEmpty()) | 134 if (clippedRect.isEmpty()) |
| 135 return; | 135 return; |
| 136 | 136 |
| 137 // Put the region rect into the region's physical coordinate space. | 137 // Put the region rect into the region's physical coordinate space. |
| 138 clippedRect.setLocation(regionLocation + (clippedRect.location() - flippedFl
owThreadPortionRect.location())); | 138 clippedRect.setLocation(regionLocation + (clippedRect.location() - flippedFl
owThreadPortionRect.location())); |
| 139 | 139 |
| 140 // Now switch to the region's writing mode coordinate space and let it repai
nt itself. | 140 // Now switch to the region's writing mode coordinate space and let it issue
paint invalidations itself. |
| 141 flipForWritingMode(clippedRect); | 141 flipForWritingMode(clippedRect); |
| 142 | 142 |
| 143 // Issue the repaint. | |
| 144 invalidatePaintRectangle(clippedRect); | 143 invalidatePaintRectangle(clippedRect); |
| 145 } | 144 } |
| 146 | 145 |
| 147 LayoutUnit RenderRegion::logicalTopOfFlowThreadContentRect(const LayoutRect& rec
t) const | 146 LayoutUnit RenderRegion::logicalTopOfFlowThreadContentRect(const LayoutRect& rec
t) const |
| 148 { | 147 { |
| 149 ASSERT(isValid()); | 148 ASSERT(isValid()); |
| 150 return flowThread()->isHorizontalWritingMode() ? rect.y() : rect.x(); | 149 return flowThread()->isHorizontalWritingMode() ? rect.y() : rect.x(); |
| 151 } | 150 } |
| 152 | 151 |
| 153 LayoutUnit RenderRegion::logicalBottomOfFlowThreadContentRect(const LayoutRect&
rect) const | 152 LayoutUnit RenderRegion::logicalBottomOfFlowThreadContentRect(const LayoutRect&
rect) const |
| 154 { | 153 { |
| 155 ASSERT(isValid()); | 154 ASSERT(isValid()); |
| 156 return flowThread()->isHorizontalWritingMode() ? rect.maxY() : rect.maxX(); | 155 return flowThread()->isHorizontalWritingMode() ? rect.maxY() : rect.maxX(); |
| 157 } | 156 } |
| 158 | 157 |
| 159 void RenderRegion::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, La
youtUnit& maxLogicalWidth) const | 158 void RenderRegion::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, La
youtUnit& maxLogicalWidth) const |
| 160 { | 159 { |
| 161 if (!isValid()) { | 160 if (!isValid()) { |
| 162 RenderBlockFlow::computeIntrinsicLogicalWidths(minLogicalWidth, maxLogic
alWidth); | 161 RenderBlockFlow::computeIntrinsicLogicalWidths(minLogicalWidth, maxLogic
alWidth); |
| 163 return; | 162 return; |
| 164 } | 163 } |
| 165 | 164 |
| 166 minLogicalWidth = m_flowThread->minPreferredLogicalWidth(); | 165 minLogicalWidth = m_flowThread->minPreferredLogicalWidth(); |
| 167 maxLogicalWidth = m_flowThread->maxPreferredLogicalWidth(); | 166 maxLogicalWidth = m_flowThread->maxPreferredLogicalWidth(); |
| 168 } | 167 } |
| 169 | 168 |
| 170 } // namespace blink | 169 } // namespace blink |
| OLD | NEW |