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

Side by Side Diff: Source/core/layout/line/LineWidth.cpp

Issue 1103883002: Convert Block code to layoutObject. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2013 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 , m_availableWidth(0) 46 , m_availableWidth(0)
47 , m_isFirstLine(isFirstLine) 47 , m_isFirstLine(isFirstLine)
48 , m_shouldIndentText(shouldIndentText) 48 , m_shouldIndentText(shouldIndentText)
49 { 49 {
50 updateAvailableWidth(); 50 updateAvailableWidth();
51 } 51 }
52 52
53 void LineWidth::updateAvailableWidth(LayoutUnit replacedHeight) 53 void LineWidth::updateAvailableWidth(LayoutUnit replacedHeight)
54 { 54 {
55 LayoutUnit height = m_block.logicalHeight(); 55 LayoutUnit height = m_block.logicalHeight();
56 LayoutUnit logicalHeight = m_block.minLineHeightForReplacedRenderer(m_isFirs tLine, replacedHeight); 56 LayoutUnit logicalHeight = m_block.minLineHeightForReplacedObject(m_isFirstL ine, replacedHeight);
57 m_left = m_block.logicalLeftOffsetForLine(height, shouldIndentText(), logica lHeight).toFloat(); 57 m_left = m_block.logicalLeftOffsetForLine(height, shouldIndentText(), logica lHeight).toFloat();
58 m_right = m_block.logicalRightOffsetForLine(height, shouldIndentText(), logi calHeight).toFloat(); 58 m_right = m_block.logicalRightOffsetForLine(height, shouldIndentText(), logi calHeight).toFloat();
59 59
60 computeAvailableWidthFromLeftAndRight(); 60 computeAvailableWidthFromLeftAndRight();
61 } 61 }
62 62
63 void LineWidth::shrinkAvailableWidthForNewFloatIfNeeded(FloatingObject* newFloat ) 63 void LineWidth::shrinkAvailableWidthForNewFloatIfNeeded(FloatingObject* newFloat )
64 { 64 {
65 LayoutUnit height = m_block.logicalHeight(); 65 LayoutUnit height = m_block.logicalHeight();
66 if (height < m_block.logicalTopForFloat(newFloat) || height >= m_block.logic alBottomForFloat(newFloat)) 66 if (height < m_block.logicalTopForFloat(newFloat) || height >= m_block.logic alBottomForFloat(newFloat))
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } 190 }
191 updateLineDimension(lastFloatLogicalBottom, newLineWidth, newLineLeft, newLi neRight); 191 updateLineDimension(lastFloatLogicalBottom, newLineWidth, newLineLeft, newLi neRight);
192 } 192 }
193 193
194 void LineWidth::computeAvailableWidthFromLeftAndRight() 194 void LineWidth::computeAvailableWidthFromLeftAndRight()
195 { 195 {
196 m_availableWidth = max(0.0f, m_right - m_left) + m_overhangWidth; 196 m_availableWidth = max(0.0f, m_right - m_left) + m_overhangWidth;
197 } 197 }
198 198
199 } 199 }
OLDNEW
« no previous file with comments | « Source/core/layout/line/BreakingContextInlineHeaders.h ('k') | Source/core/layout/line/WordMeasurement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698