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

Unified Diff: Source/core/rendering/RenderBlock.cpp

Issue 390173003: When accessing line boxes, use RenderBlockFlow instead of RenderBlock. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: make line box methods protected Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/RenderBlock.cpp
diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp
index 2d0e66f81a8c87a706952ff95a8683d1e81f19b1..c6ea8cd72040263ac6e7ad8fc77bb39e50d70c96 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -4219,21 +4219,21 @@ static bool shouldCheckLines(RenderObject* obj)
static int getHeightForLineCount(RenderBlock* block, int l, bool includeBottom, int& count)
{
if (block->style()->visibility() == VISIBLE) {
- if (block->childrenInline()) {
- for (RootInlineBox* box = block->firstRootBox(); box; box = box->nextRootBox()) {
+ if (block->isRenderBlockFlow() && block->childrenInline()) {
+ for (RootInlineBox* box = toRenderBlockFlow(block)->firstRootBox(); box; box = box->nextRootBox()) {
if (++count == l)
return box->lineBottom() + (includeBottom ? (block->borderBottom() + block->paddingBottom()) : LayoutUnit());
}
- }
- else {
+ } else {
RenderBox* normalFlowChildWithoutLines = 0;
for (RenderBox* obj = block->firstChildBox(); obj; obj = obj->nextSiblingBox()) {
if (shouldCheckLines(obj)) {
int result = getHeightForLineCount(toRenderBlock(obj), l, false, count);
if (result != -1)
return result + obj->y() + (includeBottom ? (block->borderBottom() + block->paddingBottom()) : LayoutUnit());
- } else if (!obj->isFloatingOrOutOfFlowPositioned())
+ } else if (!obj->isFloatingOrOutOfFlowPositioned()) {
normalFlowChildWithoutLines = obj;
+ }
}
if (normalFlowChildWithoutLines && l == 0)
return normalFlowChildWithoutLines->y() + normalFlowChildWithoutLines->height();

Powered by Google App Engine
This is Rietveld 408576698