Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Side by Side Diff: Source/core/layout/shapes/ShapeOutsideInfo.cpp

Issue 763173003: Convert RenderBlockFlow code to use FloatingObject references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address Review Comments Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2012 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 case ShapeValue::Box: 275 case ShapeValue::Box:
276 return true; 276 return true;
277 } 277 }
278 278
279 return false; 279 return false;
280 } 280 }
281 ShapeOutsideDeltas ShapeOutsideInfo::computeDeltasForContainingBlockLine(const L ayoutBlockFlow& containingBlock, const FloatingObject& floatingObject, LayoutUni t lineTop, LayoutUnit lineHeight) 281 ShapeOutsideDeltas ShapeOutsideInfo::computeDeltasForContainingBlockLine(const L ayoutBlockFlow& containingBlock, const FloatingObject& floatingObject, LayoutUni t lineTop, LayoutUnit lineHeight)
282 { 282 {
283 ASSERT(lineHeight >= 0); 283 ASSERT(lineHeight >= 0);
284 284
285 LayoutUnit borderBoxTop = containingBlock.logicalTopForFloat(&floatingObject ) + containingBlock.marginBeforeForChild(m_renderer); 285 LayoutUnit borderBoxTop = containingBlock.logicalTopForFloat(floatingObject) + containingBlock.marginBeforeForChild(m_renderer);
286 LayoutUnit borderBoxLineTop = lineTop - borderBoxTop; 286 LayoutUnit borderBoxLineTop = lineTop - borderBoxTop;
287 287
288 if (isShapeDirty() || !m_shapeOutsideDeltas.isForLine(borderBoxLineTop, line Height)) { 288 if (isShapeDirty() || !m_shapeOutsideDeltas.isForLine(borderBoxLineTop, line Height)) {
289 LayoutUnit referenceBoxLineTop = borderBoxLineTop - logicalTopOffset(); 289 LayoutUnit referenceBoxLineTop = borderBoxLineTop - logicalTopOffset();
290 LayoutUnit floatMarginBoxWidth = containingBlock.logicalWidthForFloat(&f loatingObject); 290 LayoutUnit floatMarginBoxWidth = containingBlock.logicalWidthForFloat(fl oatingObject);
291 291
292 if (computedShape().lineOverlapsShapeMarginBounds(referenceBoxLineTop, l ineHeight)) { 292 if (computedShape().lineOverlapsShapeMarginBounds(referenceBoxLineTop, l ineHeight)) {
293 LineSegment segment = computedShape().getExcludedInterval((borderBox LineTop - logicalTopOffset()), std::min(lineHeight, shapeLogicalBottom() - borde rBoxLineTop)); 293 LineSegment segment = computedShape().getExcludedInterval((borderBox LineTop - logicalTopOffset()), std::min(lineHeight, shapeLogicalBottom() - borde rBoxLineTop));
294 if (segment.isValid) { 294 if (segment.isValid) {
295 LayoutUnit logicalLeftMargin = containingBlock.style()->isLeftTo RightDirection() ? containingBlock.marginStartForChild(m_renderer) : containingB lock.marginEndForChild(m_renderer); 295 LayoutUnit logicalLeftMargin = containingBlock.style()->isLeftTo RightDirection() ? containingBlock.marginStartForChild(m_renderer) : containingB lock.marginEndForChild(m_renderer);
296 LayoutUnit rawLeftMarginBoxDelta = segment.logicalLeft + logical LeftOffset() + logicalLeftMargin; 296 LayoutUnit rawLeftMarginBoxDelta = segment.logicalLeft + logical LeftOffset() + logicalLeftMargin;
297 LayoutUnit leftMarginBoxDelta = clampTo<LayoutUnit>(rawLeftMargi nBoxDelta, LayoutUnit(), floatMarginBoxWidth); 297 LayoutUnit leftMarginBoxDelta = clampTo<LayoutUnit>(rawLeftMargi nBoxDelta, LayoutUnit(), floatMarginBoxWidth);
298 298
299 LayoutUnit logicalRightMargin = containingBlock.style()->isLeftT oRightDirection() ? containingBlock.marginEndForChild(m_renderer) : containingBl ock.marginStartForChild(m_renderer); 299 LayoutUnit logicalRightMargin = containingBlock.style()->isLeftT oRightDirection() ? containingBlock.marginEndForChild(m_renderer) : containingBl ock.marginStartForChild(m_renderer);
300 LayoutUnit rawRightMarginBoxDelta = segment.logicalRight + logic alLeftOffset() - containingBlock.logicalWidthForChild(m_renderer) - logicalRight Margin; 300 LayoutUnit rawRightMarginBoxDelta = segment.logicalRight + logic alLeftOffset() - containingBlock.logicalWidthForChild(m_renderer) - logicalRight Margin;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 } 343 }
344 344
345 FloatSize ShapeOutsideInfo::shapeToRendererSize(FloatSize size) const 345 FloatSize ShapeOutsideInfo::shapeToRendererSize(FloatSize size) const
346 { 346 {
347 if (!m_renderer.style()->isHorizontalWritingMode()) 347 if (!m_renderer.style()->isHorizontalWritingMode())
348 return size.transposedSize(); 348 return size.transposedSize();
349 return size; 349 return size;
350 } 350 }
351 351
352 } // namespace blink 352 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698