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

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: Rebase Created 5 years, 6 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
« no previous file with comments | « Source/core/layout/line/LineWidth.cpp ('k') | Source/core/paint/BlockFlowPainter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 case ShapeValue::Box: 279 case ShapeValue::Box:
280 return true; 280 return true;
281 } 281 }
282 282
283 return false; 283 return false;
284 } 284 }
285 ShapeOutsideDeltas ShapeOutsideInfo::computeDeltasForContainingBlockLine(const L ayoutBlockFlow& containingBlock, const FloatingObject& floatingObject, LayoutUni t lineTop, LayoutUnit lineHeight) 285 ShapeOutsideDeltas ShapeOutsideInfo::computeDeltasForContainingBlockLine(const L ayoutBlockFlow& containingBlock, const FloatingObject& floatingObject, LayoutUni t lineTop, LayoutUnit lineHeight)
286 { 286 {
287 ASSERT(lineHeight >= 0); 287 ASSERT(lineHeight >= 0);
288 288
289 LayoutUnit borderBoxTop = containingBlock.logicalTopForFloat(&floatingObject ) + containingBlock.marginBeforeForChild(m_layoutBox); 289 LayoutUnit borderBoxTop = containingBlock.logicalTopForFloat(floatingObject) + containingBlock.marginBeforeForChild(m_layoutBox);
290 LayoutUnit borderBoxLineTop = lineTop - borderBoxTop; 290 LayoutUnit borderBoxLineTop = lineTop - borderBoxTop;
291 291
292 if (isShapeDirty() || !m_shapeOutsideDeltas.isForLine(borderBoxLineTop, line Height)) { 292 if (isShapeDirty() || !m_shapeOutsideDeltas.isForLine(borderBoxLineTop, line Height)) {
293 LayoutUnit referenceBoxLineTop = borderBoxLineTop - logicalTopOffset(); 293 LayoutUnit referenceBoxLineTop = borderBoxLineTop - logicalTopOffset();
294 LayoutUnit floatMarginBoxWidth = std::max(containingBlock.logicalWidthFo rFloat(&floatingObject), LayoutUnit()); 294 LayoutUnit floatMarginBoxWidth = std::max(containingBlock.logicalWidthFo rFloat(floatingObject), LayoutUnit());
295 295
296 if (computedShape().lineOverlapsShapeMarginBounds(referenceBoxLineTop, l ineHeight)) { 296 if (computedShape().lineOverlapsShapeMarginBounds(referenceBoxLineTop, l ineHeight)) {
297 LineSegment segment = computedShape().getExcludedInterval((borderBox LineTop - logicalTopOffset()), std::min(lineHeight, shapeLogicalBottom() - borde rBoxLineTop)); 297 LineSegment segment = computedShape().getExcludedInterval((borderBox LineTop - logicalTopOffset()), std::min(lineHeight, shapeLogicalBottom() - borde rBoxLineTop));
298 if (segment.isValid) { 298 if (segment.isValid) {
299 LayoutUnit logicalLeftMargin = containingBlock.style()->isLeftTo RightDirection() ? containingBlock.marginStartForChild(m_layoutBox) : containing Block.marginEndForChild(m_layoutBox); 299 LayoutUnit logicalLeftMargin = containingBlock.style()->isLeftTo RightDirection() ? containingBlock.marginStartForChild(m_layoutBox) : containing Block.marginEndForChild(m_layoutBox);
300 LayoutUnit rawLeftMarginBoxDelta = segment.logicalLeft + logical LeftOffset() + logicalLeftMargin; 300 LayoutUnit rawLeftMarginBoxDelta = segment.logicalLeft + logical LeftOffset() + logicalLeftMargin;
301 LayoutUnit leftMarginBoxDelta = clampTo<LayoutUnit>(rawLeftMargi nBoxDelta, LayoutUnit(), floatMarginBoxWidth); 301 LayoutUnit leftMarginBoxDelta = clampTo<LayoutUnit>(rawLeftMargi nBoxDelta, LayoutUnit(), floatMarginBoxWidth);
302 302
303 LayoutUnit logicalRightMargin = containingBlock.style()->isLeftT oRightDirection() ? containingBlock.marginEndForChild(m_layoutBox) : containingB lock.marginStartForChild(m_layoutBox); 303 LayoutUnit logicalRightMargin = containingBlock.style()->isLeftT oRightDirection() ? containingBlock.marginEndForChild(m_layoutBox) : containingB lock.marginStartForChild(m_layoutBox);
304 LayoutUnit rawRightMarginBoxDelta = segment.logicalRight + logic alLeftOffset() - containingBlock.logicalWidthForChild(m_layoutBox) - logicalRigh tMargin; 304 LayoutUnit rawRightMarginBoxDelta = segment.logicalRight + logic alLeftOffset() - containingBlock.logicalWidthForChild(m_layoutBox) - logicalRigh tMargin;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 347 }
348 348
349 FloatSize ShapeOutsideInfo::shapeToLayoutObjectSize(FloatSize size) const 349 FloatSize ShapeOutsideInfo::shapeToLayoutObjectSize(FloatSize size) const
350 { 350 {
351 if (!m_layoutBox.style()->isHorizontalWritingMode()) 351 if (!m_layoutBox.style()->isHorizontalWritingMode())
352 return size.transposedSize(); 352 return size.transposedSize();
353 return size; 353 return size;
354 } 354 }
355 355
356 } // namespace blink 356 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/line/LineWidth.cpp ('k') | Source/core/paint/BlockFlowPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698