Changeset 191234 in webkit
- Timestamp:
- Oct 16, 2015 8:36:56 PM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r191233 r191234 1 2015-10-16 Zalan Bujtas <zalan@apple.com> 2 3 RenderBlockFlow::*logical*ForFloat should take FloatingObject reference. 4 https://bugs.webkit.org/show_bug.cgi?id=150266 5 6 Reviewed by Simon Fraser. 7 8 No change in behaviour. 9 10 * rendering/FloatingObjects.cpp: 11 (WebCore::FindNextFloatLogicalBottomAdapter::collectIfNeeded): 12 (WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded): 13 (WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded): 14 (WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatTypeValue>::heightRemaining): 15 (WebCore::ComputeFloatOffsetAdapter<FloatTypeValue>::collectIfNeeded): 16 (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded): 17 (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded): 18 * rendering/RenderBlockFlow.cpp: 19 (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats): 20 (WebCore::RenderBlockFlow::repaintOverhangingFloats): 21 (WebCore::RenderBlockFlow::insertFloatingObject): 22 (WebCore::RenderBlockFlow::removeFloatingObject): 23 (WebCore::RenderBlockFlow::removeFloatingObjectsBelow): 24 (WebCore::RenderBlockFlow::computeLogicalLocationForFloat): 25 (WebCore::RenderBlockFlow::positionNewFloats): 26 (WebCore::RenderBlockFlow::lowestFloatLogicalBottom): 27 (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom): 28 (WebCore::RenderBlockFlow::addOverhangingFloats): 29 (WebCore::RenderBlockFlow::hasOverhangingFloat): 30 (WebCore::RenderBlockFlow::addIntrudingFloats): 31 * rendering/RenderBlockFlow.h: 32 (WebCore::RenderBlockFlow::logicalTopForFloat): 33 (WebCore::RenderBlockFlow::logicalBottomForFloat): 34 (WebCore::RenderBlockFlow::logicalLeftForFloat): 35 (WebCore::RenderBlockFlow::logicalRightForFloat): 36 (WebCore::RenderBlockFlow::logicalWidthForFloat): 37 (WebCore::RenderBlockFlow::logicalHeightForFloat): 38 (WebCore::RenderBlockFlow::setLogicalTopForFloat): 39 (WebCore::RenderBlockFlow::setLogicalLeftForFloat): 40 (WebCore::RenderBlockFlow::setLogicalHeightForFloat): 41 (WebCore::RenderBlockFlow::setLogicalWidthForFloat): 42 (WebCore::RenderBlockFlow::logicalSizeForFloat): Deleted. 43 * rendering/RenderBlockLineLayout.cpp: 44 (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): 45 (WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine): 46 (WebCore::RenderBlockFlow::positionNewFloatOnLine): 47 * rendering/RenderBox.cpp: 48 (WebCore::RenderBox::addOverflowFromChild): 49 * rendering/RenderBox.h: 50 (WebCore::RenderBox::addOverflowFromChild): 51 * rendering/line/BreakingContext.h: 52 (WebCore::BreakingContext::handleFloat): 53 * rendering/line/LineWidth.cpp: 54 (WebCore::newFloatShrinksLine): 55 (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded): 56 * rendering/shapes/ShapeOutsideInfo.cpp: 57 (WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine): 58 1 59 2015-10-16 Jiewen Tan <jiewen_tan@apple.com> 2 60 -
trunk/Source/WebCore/rendering/FloatingObjects.cpp
r185517 r191234 211 211 inline void FindNextFloatLogicalBottomAdapter::collectIfNeeded(const IntervalType& interval) 212 212 { 213 const FloatingObject* floatingObject =interval.data();213 const auto& floatingObject = *interval.data(); 214 214 if (!rangesIntersect(interval.low(), interval.high(), m_belowLogicalHeight, m_aboveLogicalHeight)) 215 215 return; 216 216 217 217 // All the objects returned from the tree should be already placed. 218 ASSERT(floatingObject ->isPlaced());218 ASSERT(floatingObject.isPlaced()); 219 219 ASSERT(rangesIntersect(m_renderer.logicalTopForFloat(floatingObject), m_renderer.logicalBottomForFloat(floatingObject), m_belowLogicalHeight, m_aboveLogicalHeight)); 220 220 … … 224 224 225 225 #if ENABLE(CSS_SHAPES) 226 if (ShapeOutsideInfo* shapeOutside = floatingObject ->renderer().shapeOutsideInfo()) {227 LayoutUnit shapeBottom = m_renderer.logicalTopForFloat(floatingObject) + m_renderer.marginBeforeForChild(floatingObject ->renderer()) + shapeOutside->shapeLogicalBottom();226 if (ShapeOutsideInfo* shapeOutside = floatingObject.renderer().shapeOutsideInfo()) { 227 LayoutUnit shapeBottom = m_renderer.logicalTopForFloat(floatingObject) + m_renderer.marginBeforeForChild(floatingObject.renderer()) + shapeOutside->shapeLogicalBottom(); 228 228 // Use the shapeBottom unless it extends outside of the margin box, in which case it is clipped. 229 229 m_nextShapeLogicalBottom = std::min(shapeBottom, floatBottom); … … 434 434 inline bool ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded(const FloatingObject& floatingObject) 435 435 { 436 LayoutUnit logicalRight = m_renderer.logicalRightForFloat( &floatingObject);436 LayoutUnit logicalRight = m_renderer.logicalRightForFloat(floatingObject); 437 437 if (logicalRight > m_offset) { 438 438 m_offset = logicalRight; … … 445 445 inline bool ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded(const FloatingObject& floatingObject) 446 446 { 447 LayoutUnit logicalLeft = m_renderer.logicalLeftForFloat( &floatingObject);447 LayoutUnit logicalLeft = m_renderer.logicalLeftForFloat(floatingObject); 448 448 if (logicalLeft < m_offset) { 449 449 m_offset = logicalLeft; … … 456 456 LayoutUnit ComputeFloatOffsetForFloatLayoutAdapter<FloatTypeValue>::heightRemaining() const 457 457 { 458 return this->m_outermostFloat ? this->m_renderer.logicalBottomForFloat( this->m_outermostFloat) - this->m_lineTop : LayoutUnit::fromPixel(1);458 return this->m_outermostFloat ? this->m_renderer.logicalBottomForFloat(*this->m_outermostFloat) - this->m_lineTop : LayoutUnit::fromPixel(1); 459 459 } 460 460 … … 462 462 inline void ComputeFloatOffsetAdapter<FloatTypeValue>::collectIfNeeded(const IntervalType& interval) 463 463 { 464 const FloatingObject* floatingObject =interval.data();465 if (floatingObject ->type() != FloatTypeValue || !rangesIntersect(interval.low(), interval.high(), m_lineTop, m_lineBottom))464 const auto& floatingObject = *interval.data(); 465 if (floatingObject.type() != FloatTypeValue || !rangesIntersect(interval.low(), interval.high(), m_lineTop, m_lineBottom)) 466 466 return; 467 467 468 468 // All the objects returned from the tree should be already placed. 469 ASSERT(floatingObject ->isPlaced());469 ASSERT(floatingObject.isPlaced()); 470 470 ASSERT(rangesIntersect(m_renderer.logicalTopForFloat(floatingObject), m_renderer.logicalBottomForFloat(floatingObject), m_lineTop, m_lineBottom)); 471 471 472 bool floatIsNewExtreme = updateOffsetIfNeeded( *floatingObject);472 bool floatIsNewExtreme = updateOffsetIfNeeded(floatingObject); 473 473 if (floatIsNewExtreme) 474 m_outermostFloat = floatingObject;474 m_outermostFloat = &floatingObject; 475 475 } 476 476 … … 478 478 inline bool ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded(const FloatingObject& floatingObject) 479 479 { 480 LayoutUnit logicalRight = m_renderer.logicalRightForFloat( &floatingObject);480 LayoutUnit logicalRight = m_renderer.logicalRightForFloat(floatingObject); 481 481 #if ENABLE(CSS_SHAPES) 482 482 if (ShapeOutsideInfo* shapeOutside = floatingObject.renderer().shapeOutsideInfo()) { … … 499 499 inline bool ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded(const FloatingObject& floatingObject) 500 500 { 501 LayoutUnit logicalLeft = m_renderer.logicalLeftForFloat( &floatingObject);501 LayoutUnit logicalLeft = m_renderer.logicalLeftForFloat(floatingObject); 502 502 #if ENABLE(CSS_SHAPES) 503 503 if (ShapeOutsideInfo* shapeOutside = floatingObject.renderer().shapeOutsideInfo()) { -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r191002 r191234 268 268 auto end = floatingObjectSet.end(); 269 269 for (auto it = floatingObjectSet.begin(); it != end; ++it) { 270 FloatingObject* floatingObject =it->get();271 std::unique_ptr<FloatingObject> oldFloatingObject = floatMap.take(&floatingObject ->renderer());270 const auto& floatingObject = *it->get(); 271 std::unique_ptr<FloatingObject> oldFloatingObject = floatMap.take(&floatingObject.renderer()); 272 272 LayoutUnit logicalBottom = logicalBottomForFloat(floatingObject); 273 273 if (oldFloatingObject) { 274 LayoutUnit oldLogicalBottom = logicalBottomForFloat( oldFloatingObject.get());275 if (logicalWidthForFloat(floatingObject) != logicalWidthForFloat( oldFloatingObject.get()) || logicalLeftForFloat(floatingObject) != logicalLeftForFloat(oldFloatingObject.get())) {274 LayoutUnit oldLogicalBottom = logicalBottomForFloat(*oldFloatingObject); 275 if (logicalWidthForFloat(floatingObject) != logicalWidthForFloat(*oldFloatingObject) || logicalLeftForFloat(floatingObject) != logicalLeftForFloat(*oldFloatingObject)) { 276 276 changeLogicalTop = 0; 277 277 changeLogicalBottom = std::max(changeLogicalBottom, std::max(logicalBottom, oldLogicalBottom)); … … 282 282 } 283 283 LayoutUnit logicalTop = logicalTopForFloat(floatingObject); 284 LayoutUnit oldLogicalTop = logicalTopForFloat( oldFloatingObject.get());284 LayoutUnit oldLogicalTop = logicalTopForFloat(*oldFloatingObject); 285 285 if (logicalTop != oldLogicalTop) { 286 286 changeLogicalTop = std::min(changeLogicalTop, std::min(logicalTop, oldLogicalTop)); … … 302 302 auto end = floatMap.end(); 303 303 for (auto it = floatMap.begin(); it != end; ++it) { 304 FloatingObject* floatingObject =it->value.get();305 if (!floatingObject ->isDescendant()) {304 const auto& floatingObject = *it->value.get(); 305 if (!floatingObject.isDescendant()) { 306 306 changeLogicalTop = 0; 307 307 changeLogicalBottom = std::max(changeLogicalBottom, logicalBottomForFloat(floatingObject)); … … 2155 2155 auto end = floatingObjectSet.end(); 2156 2156 for (auto it = floatingObjectSet.begin(); it != end; ++it) { 2157 FloatingObject* floatingObject =it->get();2157 const auto& floatingObject = *it->get(); 2158 2158 // Only repaint the object if it is overhanging, is not in its own layer, and 2159 2159 // is our responsibility to paint (m_shouldPaint is set). When paintAllDescendants is true, the latter 2160 2160 // condition is replaced with being a descendant of us. 2161 auto& renderer = floatingObject.renderer(); 2161 2162 if (logicalBottomForFloat(floatingObject) > logicalHeight() 2162 && ! floatingObject->renderer().hasSelfPaintingLayer()2163 && (floatingObject ->shouldPaint() || (paintAllDescendants && floatingObject->renderer().isDescendantOf(this)))) {2164 floatingObject->renderer().repaint();2165 floatingObject->renderer().repaintOverhangingFloats(false);2163 && !renderer.hasSelfPaintingLayer() 2164 && (floatingObject.shouldPaint() || (paintAllDescendants && renderer.isDescendantOf(this)))) { 2165 renderer.repaint(); 2166 renderer.repaintOverhangingFloats(false); 2166 2167 } 2167 2168 } … … 2279 2280 } 2280 2281 2281 setLogicalWidthForFloat( floatingObject.get(), logicalWidthForChild(floatBox) + marginStartForChild(floatBox) + marginEndForChild(floatBox));2282 setLogicalWidthForFloat(*floatingObject, logicalWidthForChild(floatBox) + marginStartForChild(floatBox) + marginEndForChild(floatBox)); 2282 2283 2283 2284 return m_floatingObjects->add(WTF::move(floatingObject)); … … 2290 2291 auto it = floatingObjectSet.find<RenderBox&, FloatingObjectHashTranslator>(floatBox); 2291 2292 if (it != floatingObjectSet.end()) { 2292 FloatingObject* floatingObject =it->get();2293 auto& floatingObject = *it->get(); 2293 2294 if (childrenInline()) { 2294 2295 LayoutUnit logicalTop = logicalTopForFloat(floatingObject); … … 2304 2305 logicalBottom = std::max(logicalBottom, logicalTop + 1); 2305 2306 } 2306 if (floatingObject ->originatingLine()) {2307 floatingObject ->originatingLine()->removeFloat(floatBox);2307 if (floatingObject.originatingLine()) { 2308 floatingObject.originatingLine()->removeFloat(floatBox); 2308 2309 if (!selfNeedsLayout()) { 2309 ASSERT(&floatingObject ->originatingLine()->renderer() == this);2310 floatingObject ->originatingLine()->markDirty();2310 ASSERT(&floatingObject.originatingLine()->renderer() == this); 2311 floatingObject.originatingLine()->markDirty(); 2311 2312 } 2312 2313 #if !ASSERT_DISABLED 2313 floatingObject ->setOriginatingLine(0);2314 floatingObject.setOriginatingLine(0); 2314 2315 #endif 2315 2316 } 2316 2317 markLinesDirtyInBlockRange(0, logicalBottom); 2317 2318 } 2318 m_floatingObjects->remove( floatingObject);2319 m_floatingObjects->remove(&floatingObject); 2319 2320 } 2320 2321 } … … 2328 2329 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 2329 2330 FloatingObject* curr = floatingObjectSet.last().get(); 2330 while (curr != lastFloat && (!curr->isPlaced() || logicalTopForFloat( curr) >= logicalOffset)) {2331 while (curr != lastFloat && (!curr->isPlaced() || logicalTopForFloat(*curr) >= logicalOffset)) { 2331 2332 m_floatingObjects->remove(curr); 2332 2333 if (floatingObjectSet.isEmpty()) … … 2352 2353 } 2353 2354 2354 LayoutPoint RenderBlockFlow::computeLogicalLocationForFloat(const FloatingObject *floatingObject, LayoutUnit logicalTopOffset)2355 { 2356 RenderBox& childBox = floatingObject->renderer();2355 LayoutPoint RenderBlockFlow::computeLogicalLocationForFloat(const FloatingObject& floatingObject, LayoutUnit logicalTopOffset) 2356 { 2357 auto& childBox = floatingObject.renderer(); 2357 2358 LayoutUnit logicalLeftOffset = logicalLeftOffsetForContent(logicalTopOffset); // Constant part of left offset. 2358 2359 LayoutUnit logicalRightOffset = logicalRightOffsetForContent(logicalTopOffset); // Constant part of right offset. … … 2472 2473 // The float cannot start above the top position of the last positioned float. 2473 2474 if (lastPlacedFloatingObject) 2474 logicalTop = std::max(logicalTopForFloat( lastPlacedFloatingObject), logicalTop);2475 logicalTop = std::max(logicalTopForFloat(*lastPlacedFloatingObject), logicalTop); 2475 2476 2476 2477 auto end = floatingObjectSet.end(); 2477 2478 // Now walk through the set of unpositioned floats and place them. 2478 2479 for (; it != end; ++it) { 2479 FloatingObject* floatingObject =it->get();2480 auto& floatingObject = *it->get(); 2480 2481 // The containing block is responsible for positioning floats, so if we have floats in our 2481 2482 // list that come from somewhere else, do not attempt to position them. 2482 if (floatingObject->renderer().containingBlock() != this) 2483 auto& childBox = floatingObject.renderer(); 2484 if (childBox.containingBlock() != this) 2483 2485 continue; 2484 2485 RenderBox& childBox = floatingObject->renderer();2486 2486 2487 2487 LayoutUnit childLogicalLeftMargin = style().isLeftToRightDirection() ? marginStartForChild(childBox) : marginEndForChild(childBox); … … 2523 2523 2524 2524 if (newLogicalTop != floatLogicalLocation.y()) { 2525 floatingObject ->setPaginationStrut(newLogicalTop - floatLogicalLocation.y());2525 floatingObject.setPaginationStrut(newLogicalTop - floatLogicalLocation.y()); 2526 2526 2527 2527 floatLogicalLocation = computeLogicalLocationForFloat(floatingObject, newLogicalTop); … … 2546 2546 setLogicalHeightForFloat(floatingObject, logicalHeightForChildForFragmentation(childBox) + marginBeforeForChild(childBox) + marginAfterForChild(childBox)); 2547 2547 2548 m_floatingObjects->addPlacedObject( floatingObject);2548 m_floatingObjects->addPlacedObject(&floatingObject); 2549 2549 2550 2550 #if ENABLE(CSS_SHAPES) … … 2621 2621 auto end = floatingObjectSet.end(); 2622 2622 for (auto it = floatingObjectSet.begin(); it != end; ++it) { 2623 FloatingObject* floatingObject =it->get();2624 if (floatingObject ->isPlaced() && floatingObject->type() & floatType)2623 const auto& floatingObject = *it->get(); 2624 if (floatingObject.isPlaced() && floatingObject.type() & floatType) 2625 2625 lowestFloatBottom = std::max(lowestFloatBottom, logicalBottomForFloat(floatingObject)); 2626 2626 } … … 2636 2636 auto end = floatingObjectSet.end(); 2637 2637 for (auto it = floatingObjectSet.begin(); it != end; ++it) { 2638 FloatingObject* floatingObject =it->get();2639 if (floatingObject ->isPlaced() && floatingObject->renderer().style().styleType() == FIRST_LETTER && floatingObject->renderer().style().initialLetterDrop() > 0)2638 const auto& floatingObject = *it->get(); 2639 if (floatingObject.isPlaced() && floatingObject.renderer().style().styleType() == FIRST_LETTER && floatingObject.renderer().style().initialLetterDrop() > 0) 2640 2640 lowestFloatBottom = std::max(lowestFloatBottom, logicalBottomForFloat(floatingObject)); 2641 2641 } … … 2657 2657 auto childEnd = child.m_floatingObjects->set().end(); 2658 2658 for (auto childIt = child.m_floatingObjects->set().begin(); childIt != childEnd; ++childIt) { 2659 FloatingObject* floatingObject =childIt->get();2659 auto& floatingObject = *childIt->get(); 2660 2660 LayoutUnit floatLogicalBottom = std::min(logicalBottomForFloat(floatingObject), LayoutUnit::max() - childLogicalTop); 2661 2661 LayoutUnit logicalBottom = childLogicalTop + floatLogicalBottom; … … 2664 2664 if (logicalBottom > logicalHeight()) { 2665 2665 // If the object is not in the list, we add it now. 2666 if (!containsFloat(floatingObject ->renderer())) {2666 if (!containsFloat(floatingObject.renderer())) { 2667 2667 LayoutSize offset = isHorizontalWritingMode() ? LayoutSize(-childLogicalLeft, -childLogicalTop) : LayoutSize(-childLogicalTop, -childLogicalLeft); 2668 2668 bool shouldPaint = false; … … 2672 2672 // far out as we can, to the outermost block that overlaps the float, stopping only 2673 2673 // if we hit a self-painting layer boundary. 2674 if (floatingObject ->renderer().enclosingFloatPaintingLayer() == enclosingFloatPaintingLayer()) {2675 floatingObject ->setShouldPaint(false);2674 if (floatingObject.renderer().enclosingFloatPaintingLayer() == enclosingFloatPaintingLayer()) { 2675 floatingObject.setShouldPaint(false); 2676 2676 shouldPaint = true; 2677 2677 } … … 2680 2680 createFloatingObjects(); 2681 2681 2682 m_floatingObjects->add(floatingObject ->copyToNewContainer(offset, shouldPaint, true));2682 m_floatingObjects->add(floatingObject.copyToNewContainer(offset, shouldPaint, true)); 2683 2683 } 2684 2684 } else { 2685 if (makeChildPaintOtherFloats && !floatingObject->shouldPaint() && !floatingObject->renderer().hasSelfPaintingLayer() 2686 && floatingObject->renderer().isDescendantOf(&child) && floatingObject->renderer().enclosingFloatPaintingLayer() == child.enclosingFloatPaintingLayer()) { 2685 const auto& renderer = floatingObject.renderer(); 2686 if (makeChildPaintOtherFloats && !floatingObject.shouldPaint() && !renderer.hasSelfPaintingLayer() 2687 && renderer.isDescendantOf(&child) && renderer.enclosingFloatPaintingLayer() == child.enclosingFloatPaintingLayer()) { 2687 2688 // The float is not overhanging from this block, so if it is a descendant of the child, the child should 2688 2689 // paint it (the other case is that it is intruding into the child), unless it has its own layer or enclosing … … 2690 2691 // If makeChildPaintOtherFloats is false, it means that the child must already know about all the floats 2691 2692 // it should paint. 2692 floatingObject ->setShouldPaint(true);2693 floatingObject.setShouldPaint(true); 2693 2694 } 2694 2695 2695 2696 // Since the float doesn't overhang, it didn't get put into our list. We need to add its overflow in to the child now. 2696 if (floatingObject ->isDescendant())2697 child.addOverflowFromChild(& floatingObject->renderer(), LayoutSize(xPositionForFloatIncludingMargin(floatingObject), yPositionForFloatIncludingMargin(floatingObject)));2697 if (floatingObject.isDescendant()) 2698 child.addOverflowFromChild(&renderer, LayoutSize(xPositionForFloatIncludingMargin(&floatingObject), yPositionForFloatIncludingMargin(&floatingObject))); 2698 2699 } 2699 2700 } … … 2707 2708 2708 2709 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 2709 auto it = floatingObjectSet.find<RenderBox&, FloatingObjectHashTranslator>(renderer);2710 const auto it = floatingObjectSet.find<RenderBox&, FloatingObjectHashTranslator>(renderer); 2710 2711 if (it == floatingObjectSet.end()) 2711 2712 return false; 2712 2713 2713 return logicalBottomForFloat( it->get()) > logicalHeight();2714 return logicalBottomForFloat(*it->get()) > logicalHeight(); 2714 2715 } 2715 2716 … … 2731 2732 auto prevEnd = prevSet.end(); 2732 2733 for (auto prevIt = prevSet.begin(); prevIt != prevEnd; ++prevIt) { 2733 FloatingObject* floatingObject =prevIt->get();2734 auto& floatingObject = *prevIt->get(); 2734 2735 if (logicalBottomForFloat(floatingObject) > logicalTopOffset) { 2735 if (!m_floatingObjects || !m_floatingObjects->set().contains<FloatingObject&, FloatingObjectHashTranslator>( *floatingObject)) {2736 if (!m_floatingObjects || !m_floatingObjects->set().contains<FloatingObject&, FloatingObjectHashTranslator>(floatingObject)) { 2736 2737 // We create the floating object list lazily. 2737 2738 if (!m_floatingObjects) … … 2747 2748 : LayoutSize(logicalTopOffset, logicalLeftOffset - (prev != container ? prev->marginTop() : LayoutUnit())); 2748 2749 2749 m_floatingObjects->add(floatingObject ->copyToNewContainer(offset));2750 m_floatingObjects->add(floatingObject.copyToNewContainer(offset)); 2750 2751 } 2751 2752 } -
trunk/Source/WebCore/rendering/RenderBlockFlow.h
r191195 r191234 298 298 const FloatingObjectSet* floatingObjectSet() const { return m_floatingObjects ? &m_floatingObjects->set() : nullptr; } 299 299 300 LayoutUnit logicalTopForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->y() : floatingObject->x(); } 301 LayoutUnit logicalBottomForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->maxY() : floatingObject->maxX(); } 302 LayoutUnit logicalLeftForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->x() : floatingObject->y(); } 303 LayoutUnit logicalRightForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->maxX() : floatingObject->maxY(); } 304 LayoutUnit logicalWidthForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->width() : floatingObject->height(); } 305 LayoutUnit logicalHeightForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->height() : floatingObject->width(); } 306 LayoutSize logicalSizeForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? LayoutSize(floatingObject->width(), floatingObject->height()) : LayoutSize(floatingObject->height(), floatingObject->width()); } 307 308 void setLogicalTopForFloat(FloatingObject* floatingObject, LayoutUnit logicalTop) 300 LayoutUnit logicalTopForFloat(const FloatingObject& floatingObject) const { return isHorizontalWritingMode() ? floatingObject.y() : floatingObject.x(); } 301 LayoutUnit logicalBottomForFloat(const FloatingObject& floatingObject) const { return isHorizontalWritingMode() ? floatingObject.maxY() : floatingObject.maxX(); } 302 LayoutUnit logicalLeftForFloat(const FloatingObject& floatingObject) const { return isHorizontalWritingMode() ? floatingObject.x() : floatingObject.y(); } 303 LayoutUnit logicalRightForFloat(const FloatingObject& floatingObject) const { return isHorizontalWritingMode() ? floatingObject.maxX() : floatingObject.maxY(); } 304 LayoutUnit logicalWidthForFloat(const FloatingObject& floatingObject) const { return isHorizontalWritingMode() ? floatingObject.width() : floatingObject.height(); } 305 LayoutUnit logicalHeightForFloat(const FloatingObject& floatingObject) const { return isHorizontalWritingMode() ? floatingObject.height() : floatingObject.width(); } 306 307 void setLogicalTopForFloat(FloatingObject& floatingObject, LayoutUnit logicalTop) 309 308 { 310 309 if (isHorizontalWritingMode()) 311 floatingObject ->setY(logicalTop);310 floatingObject.setY(logicalTop); 312 311 else 313 floatingObject ->setX(logicalTop);312 floatingObject.setX(logicalTop); 314 313 } 315 void setLogicalLeftForFloat(FloatingObject *floatingObject, LayoutUnit logicalLeft)314 void setLogicalLeftForFloat(FloatingObject& floatingObject, LayoutUnit logicalLeft) 316 315 { 317 316 if (isHorizontalWritingMode()) 318 floatingObject ->setX(logicalLeft);317 floatingObject.setX(logicalLeft); 319 318 else 320 floatingObject ->setY(logicalLeft);319 floatingObject.setY(logicalLeft); 321 320 } 322 void setLogicalHeightForFloat(FloatingObject *floatingObject, LayoutUnit logicalHeight)321 void setLogicalHeightForFloat(FloatingObject& floatingObject, LayoutUnit logicalHeight) 323 322 { 324 323 if (isHorizontalWritingMode()) 325 floatingObject ->setHeight(logicalHeight);324 floatingObject.setHeight(logicalHeight); 326 325 else 327 floatingObject ->setWidth(logicalHeight);326 floatingObject.setWidth(logicalHeight); 328 327 } 329 void setLogicalWidthForFloat(FloatingObject *floatingObject, LayoutUnit logicalWidth)328 void setLogicalWidthForFloat(FloatingObject& floatingObject, LayoutUnit logicalWidth) 330 329 { 331 330 if (isHorizontalWritingMode()) 332 floatingObject ->setWidth(logicalWidth);331 floatingObject.setWidth(logicalWidth); 333 332 else 334 floatingObject ->setHeight(logicalWidth);333 floatingObject.setHeight(logicalWidth); 335 334 } 336 335 … … 491 490 void removeFloatingObject(RenderBox&); 492 491 void removeFloatingObjectsBelow(FloatingObject*, int logicalOffset); 493 LayoutPoint computeLogicalLocationForFloat(const FloatingObject *, LayoutUnit logicalTopOffset);492 LayoutPoint computeLogicalLocationForFloat(const FloatingObject&, LayoutUnit logicalTopOffset); 494 493 495 494 // Called from lineWidth, to position the floats added in the last line. -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r191195 r191234 1256 1256 const InlineIterator oldEnd = end; 1257 1257 bool isNewUBAParagraph = layoutState.lineInfo().previousLineBrokeCleanly(); 1258 FloatingObject* lastFloatFromPreviousLine = (containsFloats()) ? m_floatingObjects->set().last().get() : 0;1258 FloatingObject* lastFloatFromPreviousLine = (containsFloats()) ? m_floatingObjects->set().last().get() : nullptr; 1259 1259 1260 1260 WordMeasurements wordMeasurements; … … 1899 1899 auto end = floatingObjectSet.end(); 1900 1900 for (auto it = floatingObjectSet.begin(); it != end; ++it) { 1901 FloatingObject* floatingObject =it->get();1901 const auto& floatingObject = *it->get(); 1902 1902 if (logicalBottomForFloat(floatingObject) >= logicalTop && logicalBottomForFloat(floatingObject) < logicalBottom) 1903 1903 return false; … … 2076 2076 ASSERT(floatingObjectSet.last().get() == &newFloat); 2077 2077 2078 LayoutUnit floatLogicalTop = logicalTopForFloat( &newFloat);2078 LayoutUnit floatLogicalTop = logicalTopForFloat(newFloat); 2079 2079 LayoutUnit paginationStrut = newFloat.paginationStrut(); 2080 2080 … … 2087 2087 while (it != begin) { 2088 2088 --it; 2089 FloatingObject* floatingObject =it->get();2090 if ( floatingObject == lastFloatFromPreviousLine)2089 auto& floatingObject = *it->get(); 2090 if (&floatingObject == lastFloatFromPreviousLine) 2091 2091 break; 2092 2092 if (logicalTopForFloat(floatingObject) == logicalHeight() + lineInfo.floatPaginationStrut()) { 2093 floatingObject ->setPaginationStrut(paginationStrut + floatingObject->paginationStrut());2094 RenderBox& floatBox = floatingObject ->renderer();2093 floatingObject.setPaginationStrut(paginationStrut + floatingObject.paginationStrut()); 2094 RenderBox& floatBox = floatingObject.renderer(); 2095 2095 setLogicalTopForChild(floatBox, logicalTopForChild(floatBox) + marginBeforeForChild(floatBox) + paginationStrut); 2096 2096 2097 if (updateRegionRangeForBoxChild(float ingObject->renderer()))2097 if (updateRegionRangeForBoxChild(floatBox)) 2098 2098 floatBox.setNeedsLayout(MarkOnlyThis); 2099 2099 else if (is<RenderBlock>(floatBox)) … … 2104 2104 // isPlaced to false. Otherwise it will trigger an assert in logicalTopForFloat. 2105 2105 LayoutUnit oldLogicalTop = logicalTopForFloat(floatingObject); 2106 m_floatingObjects->removePlacedObject( floatingObject);2106 m_floatingObjects->removePlacedObject(&floatingObject); 2107 2107 setLogicalTopForFloat(floatingObject, oldLogicalTop + paginationStrut); 2108 m_floatingObjects->addPlacedObject( floatingObject);2108 m_floatingObjects->addPlacedObject(&floatingObject); 2109 2109 } 2110 2110 } -
trunk/Source/WebCore/rendering/RenderBox.cpp
r191002 r191234 4448 4448 } 4449 4449 4450 void RenderBox::addOverflowFromChild( RenderBox* child, const LayoutSize& delta)4450 void RenderBox::addOverflowFromChild(const RenderBox* child, const LayoutSize& delta) 4451 4451 { 4452 4452 // Never allow flow threads to propagate overflow up to a parent. -
trunk/Source/WebCore/rendering/RenderBox.h
r190834 r191234 205 205 void addVisualEffectOverflow(); 206 206 LayoutRect applyVisualEffectOverflow(const LayoutRect&) const; 207 void addOverflowFromChild( RenderBox* child) { addOverflowFromChild(child, child->locationOffset()); }208 void addOverflowFromChild( RenderBox* child, const LayoutSize& delta);207 void addOverflowFromChild(const RenderBox* child) { addOverflowFromChild(child, child->locationOffset()); } 208 void addOverflowFromChild(const RenderBox* child, const LayoutSize& delta); 209 209 210 210 void updateLayerTransform(); -
trunk/Source/WebCore/rendering/line/BreakingContext.h
r191195 r191234 445 445 { 446 446 auto& floatBox = downcast<RenderBox>(*m_current.renderer()); 447 FloatingObject* floatingObject =m_lineBreaker.insertFloatingObject(floatBox);447 const auto& floatingObject = *m_lineBreaker.insertFloatingObject(floatBox); 448 448 // check if it fits in the current line. 449 449 // If it does, position it now, otherwise, position 450 450 // it after moving to next line (in clearFloats() func) 451 451 if (m_floatsFitOnLine && m_width.fitsOnLineExcludingTrailingWhitespace(m_block.logicalWidthForFloat(floatingObject))) { 452 m_lineBreaker.positionNewFloatOnLine( *floatingObject, m_lastFloatFromPreviousLine, m_lineInfo, m_width);452 m_lineBreaker.positionNewFloatOnLine(floatingObject, m_lastFloatFromPreviousLine, m_lineInfo, m_width); 453 453 if (m_lineBreakHistory.renderer() == m_current.renderer()) { 454 454 ASSERT(!m_lineBreakHistory.offset()); -
trunk/Source/WebCore/rendering/line/LineWidth.cpp
r191195 r191234 80 80 { 81 81 LayoutUnit blockOffset = block.logicalHeight(); 82 if (blockOffset >= block.logicalTopForFloat( &newFloat) && blockOffset < block.logicalBottomForFloat(&newFloat))82 if (blockOffset >= block.logicalTopForFloat(newFloat) && blockOffset < block.logicalBottomForFloat(newFloat)) 83 83 return true; 84 84 … … 103 103 104 104 if (newFloat.type() == FloatingObject::FloatLeft) { 105 float newLeft = m_block.logicalRightForFloat( &newFloat);105 float newLeft = m_block.logicalRightForFloat(newFloat); 106 106 if (shouldIndentText() && m_block.style().isLeftToRightDirection()) 107 107 newLeft += floorToInt(m_block.textIndentOffset()); … … 116 116 m_left = std::max<float>(m_left, newLeft); 117 117 } else { 118 float newRight = m_block.logicalLeftForFloat( &newFloat);118 float newRight = m_block.logicalLeftForFloat(newFloat); 119 119 if (shouldIndentText() && !m_block.style().isLeftToRightDirection()) 120 120 newRight -= floorToInt(m_block.textIndentOffset()); -
trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp
r191049 r191234 308 308 { 309 309 ASSERT(lineHeight >= 0); 310 LayoutUnit borderBoxTop = containingBlock.logicalTopForFloat( &floatingObject) + containingBlock.marginBeforeForChild(m_renderer);310 LayoutUnit borderBoxTop = containingBlock.logicalTopForFloat(floatingObject) + containingBlock.marginBeforeForChild(m_renderer); 311 311 LayoutUnit borderBoxLineTop = lineTop - borderBoxTop; 312 312 313 313 if (isShapeDirty() || !m_shapeOutsideDeltas.isForLine(borderBoxLineTop, lineHeight)) { 314 314 LayoutUnit referenceBoxLineTop = borderBoxLineTop - logicalTopOffset(); 315 LayoutUnit floatMarginBoxWidth = std::max<LayoutUnit>(LayoutUnit(), containingBlock.logicalWidthForFloat( &floatingObject));315 LayoutUnit floatMarginBoxWidth = std::max<LayoutUnit>(LayoutUnit(), containingBlock.logicalWidthForFloat(floatingObject)); 316 316 317 317 if (computedShape().lineOverlapsShapeMarginBounds(referenceBoxLineTop, lineHeight)) {
Note: See TracChangeset
for help on using the changeset viewer.