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 4001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4012 return RenderBox::localCaretRect(inlineBox, caretOffset, extraWidthToEnd
OfLine); | 4012 return RenderBox::localCaretRect(inlineBox, caretOffset, extraWidthToEnd
OfLine); |
4013 | 4013 |
4014 LayoutRect caretRect = localCaretRectForEmptyElement(width(), textIndentOffs
et()); | 4014 LayoutRect caretRect = localCaretRectForEmptyElement(width(), textIndentOffs
et()); |
4015 | 4015 |
4016 if (extraWidthToEndOfLine) | 4016 if (extraWidthToEndOfLine) |
4017 *extraWidthToEndOfLine = width() - caretRect.maxX(); | 4017 *extraWidthToEndOfLine = width() - caretRect.maxX(); |
4018 | 4018 |
4019 return caretRect; | 4019 return caretRect; |
4020 } | 4020 } |
4021 | 4021 |
4022 void RenderBlock::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint
& additionalOffset, const RenderLayerModelObject* paintContainer) const | 4022 void RenderBlock::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint
& additionalOffset) const |
4023 { | 4023 { |
4024 // For blocks inside inlines, we go ahead and include margins so that we run
right up to the | 4024 // For blocks inside inlines, we go ahead and include margins so that we run
right up to the |
4025 // inline boxes above and below us (thus getting merged with them to form a
single irregular | 4025 // inline boxes above and below us (thus getting merged with them to form a
single irregular |
4026 // shape). | 4026 // shape). |
4027 if (inlineElementContinuation()) { | 4027 if (inlineElementContinuation()) { |
4028 // FIXME: This check really isn't accurate. | 4028 // FIXME: This check really isn't accurate. |
4029 bool nextInlineHasLineBox = inlineElementContinuation()->firstLineBox(); | 4029 bool nextInlineHasLineBox = inlineElementContinuation()->firstLineBox(); |
4030 // FIXME: This is wrong. The principal renderer may not be the continuat
ion preceding this block. | 4030 // FIXME: This is wrong. The principal renderer may not be the continuat
ion preceding this block. |
4031 // FIXME: This is wrong for block-flows that are horizontal. | 4031 // FIXME: This is wrong for block-flows that are horizontal. |
4032 // https://bugs.webkit.org/show_bug.cgi?id=46781 | 4032 // https://bugs.webkit.org/show_bug.cgi?id=46781 |
4033 bool prevInlineHasLineBox = toRenderInline(inlineElementContinuation()->
node()->renderer())->firstLineBox(); | 4033 bool prevInlineHasLineBox = toRenderInline(inlineElementContinuation()->
node()->renderer())->firstLineBox(); |
4034 LayoutUnit topMargin = prevInlineHasLineBox ? collapsedMarginBefore() :
LayoutUnit(); | 4034 LayoutUnit topMargin = prevInlineHasLineBox ? collapsedMarginBefore() :
LayoutUnit(); |
4035 LayoutUnit bottomMargin = nextInlineHasLineBox ? collapsedMarginAfter()
: LayoutUnit(); | 4035 LayoutUnit bottomMargin = nextInlineHasLineBox ? collapsedMarginAfter()
: LayoutUnit(); |
4036 LayoutRect rect(additionalOffset.x(), additionalOffset.y() - topMargin,
width(), height() + topMargin + bottomMargin); | 4036 LayoutRect rect(additionalOffset.x(), additionalOffset.y() - topMargin,
width(), height() + topMargin + bottomMargin); |
4037 if (!rect.isEmpty()) | 4037 if (!rect.isEmpty()) |
4038 rects.append(rect); | 4038 rects.append(rect); |
4039 } else if (width() && height()) { | 4039 } else if (width() && height()) { |
4040 rects.append(LayoutRect(additionalOffset, size())); | 4040 rects.append(LayoutRect(additionalOffset, size())); |
4041 } | 4041 } |
4042 | 4042 |
4043 if (!hasOverflowClip() && !hasControlClip()) { | 4043 if (!hasOverflowClip() && !hasControlClip()) { |
4044 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBo
x()) { | 4044 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBo
x()) { |
4045 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top()); | 4045 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top()); |
4046 LayoutUnit bottom = std::min<LayoutUnit>(curr->lineBottom(), curr->t
op() + curr->height()); | 4046 LayoutUnit bottom = std::min<LayoutUnit>(curr->lineBottom(), curr->t
op() + curr->height()); |
4047 LayoutRect rect(additionalOffset.x() + curr->x(), additionalOffset.y
() + top, curr->width(), bottom - top); | 4047 LayoutRect rect(additionalOffset.x() + curr->x(), additionalOffset.y
() + top, curr->width(), bottom - top); |
4048 if (!rect.isEmpty()) | 4048 if (!rect.isEmpty()) |
4049 rects.append(rect); | 4049 rects.append(rect); |
4050 } | 4050 } |
4051 | 4051 |
4052 addChildFocusRingRects(rects, additionalOffset, paintContainer); | 4052 addChildFocusRingRects(rects, additionalOffset); |
4053 } | 4053 } |
4054 | 4054 |
4055 if (inlineElementContinuation()) | 4055 if (inlineElementContinuation()) |
4056 inlineElementContinuation()->addFocusRingRects(rects, additionalOffset +
(inlineElementContinuation()->containingBlock()->location() - location()), pain
tContainer); | 4056 inlineElementContinuation()->addFocusRingRects(rects, additionalOffset +
(inlineElementContinuation()->containingBlock()->location() - location())); |
4057 } | 4057 } |
4058 | 4058 |
4059 void RenderBlock::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layou
tPoint& layerOffset) const | 4059 void RenderBlock::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layou
tPoint& layerOffset) const |
4060 { | 4060 { |
4061 RenderBox::computeSelfHitTestRects(rects, layerOffset); | 4061 RenderBox::computeSelfHitTestRects(rects, layerOffset); |
4062 | 4062 |
4063 if (hasHorizontalLayoutOverflow() || hasVerticalLayoutOverflow()) { | 4063 if (hasHorizontalLayoutOverflow() || hasVerticalLayoutOverflow()) { |
4064 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBo
x()) { | 4064 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBo
x()) { |
4065 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top()); | 4065 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top()); |
4066 LayoutUnit bottom = std::min<LayoutUnit>(curr->lineBottom(), curr->t
op() + curr->height()); | 4066 LayoutUnit bottom = std::min<LayoutUnit>(curr->lineBottom(), curr->t
op() + curr->height()); |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4410 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const | 4410 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const |
4411 { | 4411 { |
4412 showRenderObject(); | 4412 showRenderObject(); |
4413 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 4413 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
4414 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 4414 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
4415 } | 4415 } |
4416 | 4416 |
4417 #endif | 4417 #endif |
4418 | 4418 |
4419 } // namespace blink | 4419 } // namespace blink |
OLD | NEW |