Changeset 201635 in webkit for trunk/Source/WebCore/rendering/RenderBox.cpp
- Timestamp:
- Jun 2, 2016, 10:27:53 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/Source/WebCore/rendering/RenderBox.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/rendering/RenderBox.cpp
r201498 r201635 2207 2207 } 2208 2208 2209 LayoutRect RenderBox::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer, bool fixed) const2209 LayoutRect RenderBox::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer, RepaintContext context) const 2210 2210 { 2211 2211 // The rect we compute at each step is shifted by our x/y offset in the parent container's coordinate space. … … 2246 2246 } 2247 2247 2248 bool containerSkipped;2249 auto* renderer = container(repaintContainer, containerSkipped);2250 if (! renderer)2248 bool repaintContainerIsSkipped; 2249 auto* container = this->container(repaintContainer, repaintContainerIsSkipped); 2250 if (!container) 2251 2251 return adjustedRect; 2252 2252 2253 EPosition position = styleToUse.position();2254 2255 2253 // This code isn't necessary for in-flow RenderFlowThreads. 2256 2254 // Don't add the location of the region in the flow thread for absolute positioned … … 2260 2258 // The same logic applies for elements flowed directly into the flow thread. Their topLeft member 2261 2259 // will already contain the portion rect of the region. 2262 if (renderer->isOutOfFlowRenderFlowThread() && position != AbsolutePosition && containingBlock() != flowThreadContainingBlock()) { 2260 EPosition position = styleToUse.position(); 2261 if (container->isOutOfFlowRenderFlowThread() && position != AbsolutePosition && containingBlock() != flowThreadContainingBlock()) { 2263 2262 RenderRegion* firstRegion = nullptr; 2264 2263 RenderRegion* lastRegion = nullptr; 2265 if (downcast<RenderFlowThread>(* renderer).getRegionRangeForBox(this, firstRegion, lastRegion))2264 if (downcast<RenderFlowThread>(*container).getRegionRangeForBox(this, firstRegion, lastRegion)) 2266 2265 adjustedRect.moveBy(firstRegion->flowThreadPortionRect().location()); 2267 2266 } 2268 2267 2269 if (isWritingModeRoot() && !isOutOfFlowPositioned()) 2270 flipForWritingMode(adjustedRect); 2268 if (isWritingModeRoot()) { 2269 if (!isOutOfFlowPositioned() || !context.m_dirtyRectIsFlipped) { 2270 flipForWritingMode(adjustedRect); 2271 context.m_dirtyRectIsFlipped = true; 2272 } 2273 } 2271 2274 2272 2275 LayoutSize locationOffset = this->locationOffset(); … … 2283 2286 // in the parent's coordinate space that encloses us. 2284 2287 if (hasLayer() && layer()->transform()) { 2285 fixed= position == FixedPosition;2288 context.m_hasPositionFixedDescendant = position == FixedPosition; 2286 2289 adjustedRect = LayoutRect(encloseRectToDevicePixels(layer()->transform()->mapRect(adjustedRect), document().deviceScaleFactor())); 2287 2290 topLeft = adjustedRect.location(); 2288 2291 topLeft.move(locationOffset); 2289 2292 } else if (position == FixedPosition) 2290 fixed= true;2291 2292 if (position == AbsolutePosition && renderer->isInFlowPositioned() && is<RenderInline>(*renderer))2293 topLeft += downcast<RenderInline>(* renderer).offsetForInFlowPositionedInline(this);2293 context.m_hasPositionFixedDescendant = true; 2294 2295 if (position == AbsolutePosition && container->isInFlowPositioned() && is<RenderInline>(*container)) 2296 topLeft += downcast<RenderInline>(*container).offsetForInFlowPositionedInline(this); 2294 2297 else if (styleToUse.hasInFlowPosition() && layer()) { 2295 2298 // Apply the relative position offset when invalidating a rectangle. The layer … … 2303 2306 // its controlClipRect will be wrong. For overflow clip we use the values cached by the layer. 2304 2307 adjustedRect.setLocation(topLeft); 2305 if ( renderer->hasOverflowClip()) {2306 RenderBox& containerBox = downcast<RenderBox>(* renderer);2308 if (container->hasOverflowClip()) { 2309 RenderBox& containerBox = downcast<RenderBox>(*container); 2307 2310 if (shouldApplyContainersClipAndOffset(repaintContainer, &containerBox)) { 2308 2311 containerBox.applyCachedClipAndScrollOffsetForRepaint(adjustedRect); … … 2312 2315 } 2313 2316 2314 if ( containerSkipped) {2315 // If the repaintContainer is below o, then we need to map the rect into repaintContainer's coordinates.2316 LayoutSize containerOffset = repaintContainer->offsetFromAncestorContainer(* renderer);2317 if (repaintContainerIsSkipped) { 2318 // If the repaintContainer is below container, then we need to map the rect into repaintContainer's coordinates. 2319 LayoutSize containerOffset = repaintContainer->offsetFromAncestorContainer(*container); 2317 2320 adjustedRect.move(-containerOffset); 2318 2321 return adjustedRect; 2319 2322 } 2320 return renderer->computeRectForRepaint(adjustedRect, repaintContainer, fixed);2323 return container->computeRectForRepaint(adjustedRect, repaintContainer, context); 2321 2324 } 2322 2325
Note:
See TracChangeset
for help on using the changeset viewer.