OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 4201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4212 static bool shouldCheckLines(RenderObject* obj) | 4212 static bool shouldCheckLines(RenderObject* obj) |
4213 { | 4213 { |
4214 return !obj->isFloatingOrOutOfFlowPositioned() | 4214 return !obj->isFloatingOrOutOfFlowPositioned() |
4215 && obj->isRenderBlock() && obj->style()->height().isAuto() | 4215 && obj->isRenderBlock() && obj->style()->height().isAuto() |
4216 && (!obj->isDeprecatedFlexibleBox() || obj->style()->boxOrient() == VERT
ICAL); | 4216 && (!obj->isDeprecatedFlexibleBox() || obj->style()->boxOrient() == VERT
ICAL); |
4217 } | 4217 } |
4218 | 4218 |
4219 static int getHeightForLineCount(RenderBlock* block, int l, bool includeBottom,
int& count) | 4219 static int getHeightForLineCount(RenderBlock* block, int l, bool includeBottom,
int& count) |
4220 { | 4220 { |
4221 if (block->style()->visibility() == VISIBLE) { | 4221 if (block->style()->visibility() == VISIBLE) { |
4222 if (block->childrenInline()) { | 4222 if (block->isRenderBlockFlow() && block->childrenInline()) { |
4223 for (RootInlineBox* box = block->firstRootBox(); box; box = box->nex
tRootBox()) { | 4223 for (RootInlineBox* box = toRenderBlockFlow(block)->firstRootBox();
box; box = box->nextRootBox()) { |
4224 if (++count == l) | 4224 if (++count == l) |
4225 return box->lineBottom() + (includeBottom ? (block->borderBo
ttom() + block->paddingBottom()) : LayoutUnit()); | 4225 return box->lineBottom() + (includeBottom ? (block->borderBo
ttom() + block->paddingBottom()) : LayoutUnit()); |
4226 } | 4226 } |
4227 } | 4227 } else { |
4228 else { | |
4229 RenderBox* normalFlowChildWithoutLines = 0; | 4228 RenderBox* normalFlowChildWithoutLines = 0; |
4230 for (RenderBox* obj = block->firstChildBox(); obj; obj = obj->nextSi
blingBox()) { | 4229 for (RenderBox* obj = block->firstChildBox(); obj; obj = obj->nextSi
blingBox()) { |
4231 if (shouldCheckLines(obj)) { | 4230 if (shouldCheckLines(obj)) { |
4232 int result = getHeightForLineCount(toRenderBlock(obj), l, fa
lse, count); | 4231 int result = getHeightForLineCount(toRenderBlock(obj), l, fa
lse, count); |
4233 if (result != -1) | 4232 if (result != -1) |
4234 return result + obj->y() + (includeBottom ? (block->bord
erBottom() + block->paddingBottom()) : LayoutUnit()); | 4233 return result + obj->y() + (includeBottom ? (block->bord
erBottom() + block->paddingBottom()) : LayoutUnit()); |
4235 } else if (!obj->isFloatingOrOutOfFlowPositioned()) | 4234 } else if (!obj->isFloatingOrOutOfFlowPositioned()) { |
4236 normalFlowChildWithoutLines = obj; | 4235 normalFlowChildWithoutLines = obj; |
| 4236 } |
4237 } | 4237 } |
4238 if (normalFlowChildWithoutLines && l == 0) | 4238 if (normalFlowChildWithoutLines && l == 0) |
4239 return normalFlowChildWithoutLines->y() + normalFlowChildWithout
Lines->height(); | 4239 return normalFlowChildWithoutLines->y() + normalFlowChildWithout
Lines->height(); |
4240 } | 4240 } |
4241 } | 4241 } |
4242 | 4242 |
4243 return -1; | 4243 return -1; |
4244 } | 4244 } |
4245 | 4245 |
4246 RootInlineBox* RenderBlock::lineAtIndex(int i) const | 4246 RootInlineBox* RenderBlock::lineAtIndex(int i) const |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4939 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const | 4939 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const |
4940 { | 4940 { |
4941 showRenderObject(); | 4941 showRenderObject(); |
4942 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 4942 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
4943 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 4943 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
4944 } | 4944 } |
4945 | 4945 |
4946 #endif | 4946 #endif |
4947 | 4947 |
4948 } // namespace WebCore | 4948 } // namespace WebCore |
OLD | NEW |