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

Side by Side Diff: Source/core/rendering/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: Created 6 years 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 case ShapeValue::Box: 273 case ShapeValue::Box:
274 return true; 274 return true;
275 } 275 }
276 276
277 return false; 277 return false;
278 } 278 }
279 ShapeOutsideDeltas ShapeOutsideInfo::computeDeltasForContainingBlockLine(const R enderBlockFlow& containingBlock, const FloatingObject& floatingObject, LayoutUni t lineTop, LayoutUnit lineHeight) 279 ShapeOutsideDeltas ShapeOutsideInfo::computeDeltasForContainingBlockLine(const R enderBlockFlow& containingBlock, const FloatingObject& floatingObject, LayoutUni t lineTop, LayoutUnit lineHeight)
280 { 280 {
281 ASSERT(lineHeight >= 0); 281 ASSERT(lineHeight >= 0);
282 282
283 LayoutUnit borderBoxTop = containingBlock.logicalTopForFloat(&floatingObject ) + containingBlock.marginBeforeForChild(m_renderer); 283 LayoutUnit borderBoxTop = containingBlock.logicalTopForFloat(floatingObject) + containingBlock.marginBeforeForChild(m_renderer);
284 LayoutUnit borderBoxLineTop = lineTop - borderBoxTop; 284 LayoutUnit borderBoxLineTop = lineTop - borderBoxTop;
285 285
286 if (isShapeDirty() || !m_shapeOutsideDeltas.isForLine(borderBoxLineTop, line Height)) { 286 if (isShapeDirty() || !m_shapeOutsideDeltas.isForLine(borderBoxLineTop, line Height)) {
287 LayoutUnit referenceBoxLineTop = borderBoxLineTop - logicalTopOffset(); 287 LayoutUnit referenceBoxLineTop = borderBoxLineTop - logicalTopOffset();
288 LayoutUnit floatMarginBoxWidth = containingBlock.logicalWidthForFloat(&f loatingObject); 288 LayoutUnit floatMarginBoxWidth = containingBlock.logicalWidthForFloat(fl oatingObject);
289 289
290 if (computedShape().lineOverlapsShapeMarginBounds(referenceBoxLineTop, l ineHeight)) { 290 if (computedShape().lineOverlapsShapeMarginBounds(referenceBoxLineTop, l ineHeight)) {
291 LineSegment segment = computedShape().getExcludedInterval((borderBox LineTop - logicalTopOffset()), std::min(lineHeight, shapeLogicalBottom() - borde rBoxLineTop)); 291 LineSegment segment = computedShape().getExcludedInterval((borderBox LineTop - logicalTopOffset()), std::min(lineHeight, shapeLogicalBottom() - borde rBoxLineTop));
292 if (segment.isValid) { 292 if (segment.isValid) {
293 LayoutUnit logicalLeftMargin = containingBlock.style()->isLeftTo RightDirection() ? containingBlock.marginStartForChild(m_renderer) : containingB lock.marginEndForChild(m_renderer); 293 LayoutUnit logicalLeftMargin = containingBlock.style()->isLeftTo RightDirection() ? containingBlock.marginStartForChild(m_renderer) : containingB lock.marginEndForChild(m_renderer);
294 LayoutUnit rawLeftMarginBoxDelta = segment.logicalLeft + logical LeftOffset() + logicalLeftMargin; 294 LayoutUnit rawLeftMarginBoxDelta = segment.logicalLeft + logical LeftOffset() + logicalLeftMargin;
295 LayoutUnit leftMarginBoxDelta = clampTo<LayoutUnit>(rawLeftMargi nBoxDelta, LayoutUnit(), floatMarginBoxWidth); 295 LayoutUnit leftMarginBoxDelta = clampTo<LayoutUnit>(rawLeftMargi nBoxDelta, LayoutUnit(), floatMarginBoxWidth);
296 296
297 LayoutUnit logicalRightMargin = containingBlock.style()->isLeftT oRightDirection() ? containingBlock.marginEndForChild(m_renderer) : containingBl ock.marginStartForChild(m_renderer); 297 LayoutUnit logicalRightMargin = containingBlock.style()->isLeftT oRightDirection() ? containingBlock.marginEndForChild(m_renderer) : containingBl ock.marginStartForChild(m_renderer);
298 LayoutUnit rawRightMarginBoxDelta = segment.logicalRight + logic alLeftOffset() - containingBlock.logicalWidthForChild(m_renderer) - logicalRight Margin; 298 LayoutUnit rawRightMarginBoxDelta = segment.logicalRight + logic alLeftOffset() - containingBlock.logicalWidthForChild(m_renderer) - logicalRight Margin;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 } 341 }
342 342
343 FloatSize ShapeOutsideInfo::shapeToRendererSize(FloatSize size) const 343 FloatSize ShapeOutsideInfo::shapeToRendererSize(FloatSize size) const
344 { 344 {
345 if (!m_renderer.style()->isHorizontalWritingMode()) 345 if (!m_renderer.style()->isHorizontalWritingMode())
346 return size.transposedSize(); 346 return size.transposedSize();
347 return size; 347 return size;
348 } 348 }
349 349
350 } // namespace blink 350 } // namespace blink
OLDNEW
« Source/core/rendering/line/LineWidth.cpp ('K') | « Source/core/rendering/line/LineWidth.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698