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 3072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3083 // 4. paint floats. | 3083 // 4. paint floats. |
3084 if (paintPhase == PaintPhaseFloat || paintPhase == PaintPhaseSelection || pa
intPhase == PaintPhaseTextClip) { | 3084 if (paintPhase == PaintPhaseFloat || paintPhase == PaintPhaseSelection || pa
intPhase == PaintPhaseTextClip) { |
3085 if (hasColumns()) | 3085 if (hasColumns()) |
3086 paintColumnContents(paintInfo, scrolledOffset, true); | 3086 paintColumnContents(paintInfo, scrolledOffset, true); |
3087 else | 3087 else |
3088 paintFloats(paintInfo, scrolledOffset, paintPhase == PaintPhaseSelec
tion || paintPhase == PaintPhaseTextClip); | 3088 paintFloats(paintInfo, scrolledOffset, paintPhase == PaintPhaseSelec
tion || paintPhase == PaintPhaseTextClip); |
3089 } | 3089 } |
3090 | 3090 |
3091 // 5. paint outline. | 3091 // 5. paint outline. |
3092 if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline)
&& hasOutline() && style()->visibility() == VISIBLE) | 3092 if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline)
&& hasOutline() && style()->visibility() == VISIBLE) |
3093 paintOutline(paintInfo, LayoutRect(paintOffset, size())); | 3093 paintOutline(paintInfo.context, LayoutRect(paintOffset, size())); |
3094 | 3094 |
3095 // 6. paint continuation outlines. | 3095 // 6. paint continuation outlines. |
3096 if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseChildOutline
s)) { | 3096 if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseChildOutline
s)) { |
3097 RenderInline* inlineCont = inlineElementContinuation(); | 3097 RenderInline* inlineCont = inlineElementContinuation(); |
3098 if (inlineCont && inlineCont->hasOutline() && inlineCont->style()->visib
ility() == VISIBLE) { | 3098 if (inlineCont && inlineCont->hasOutline() && inlineCont->style()->visib
ility() == VISIBLE) { |
3099 RenderInline* inlineRenderer = toRenderInline(inlineCont->node()->re
nderer()); | 3099 RenderInline* inlineRenderer = toRenderInline(inlineCont->node()->re
nderer()); |
3100 RenderBlock* cb = containingBlock(); | 3100 RenderBlock* cb = containingBlock(); |
3101 | 3101 |
3102 bool inlineEnclosedInSelfPaintingLayer = false; | 3102 bool inlineEnclosedInSelfPaintingLayer = false; |
3103 for (RenderBoxModelObject* box = inlineRenderer; box != cb; box = bo
x->parent()->enclosingBoxModelObject()) { | 3103 for (RenderBoxModelObject* box = inlineRenderer; box != cb; box = bo
x->parent()->enclosingBoxModelObject()) { |
3104 if (box->hasSelfPaintingLayer()) { | 3104 if (box->hasSelfPaintingLayer()) { |
3105 inlineEnclosedInSelfPaintingLayer = true; | 3105 inlineEnclosedInSelfPaintingLayer = true; |
3106 break; | 3106 break; |
3107 } | 3107 } |
3108 } | 3108 } |
3109 | 3109 |
3110 // Do not add continuations for outline painting by our containing b
lock if we are a relative positioned | 3110 // Do not add continuations for outline painting by our containing b
lock if we are a relative positioned |
3111 // anonymous block (i.e. have our own layer), paint them straightawa
y instead. This is because a block depends on renderers in its continuation tabl
e being | 3111 // anonymous block (i.e. have our own layer), paint them straightawa
y instead. This is because a block depends on renderers in its continuation tabl
e being |
3112 // in the same layer. | 3112 // in the same layer. |
3113 if (!inlineEnclosedInSelfPaintingLayer && !hasLayer()) | 3113 if (!inlineEnclosedInSelfPaintingLayer && !hasLayer()) |
3114 cb->addContinuationWithOutline(inlineRenderer); | 3114 cb->addContinuationWithOutline(inlineRenderer); |
3115 else if (!inlineRenderer->firstLineBox() || (!inlineEnclosedInSelfPa
intingLayer && hasLayer())) | 3115 else if (!inlineRenderer->firstLineBox() || (!inlineEnclosedInSelfPa
intingLayer && hasLayer())) |
3116 inlineRenderer->paintOutline(paintInfo, paintOffset - locationOf
fset() + inlineRenderer->containingBlock()->location()); | 3116 inlineRenderer->paintOutline(paintInfo.context, paintOffset - lo
cationOffset() + inlineRenderer->containingBlock()->location()); |
3117 } | 3117 } |
3118 paintContinuationOutlines(paintInfo, paintOffset); | 3118 paintContinuationOutlines(paintInfo, paintOffset); |
3119 } | 3119 } |
3120 | 3120 |
3121 // 7. paint caret. | 3121 // 7. paint caret. |
3122 // If the caret's node's render object's containing block is this block, and
the paint action is PaintPhaseForeground, | 3122 // If the caret's node's render object's containing block is this block, and
the paint action is PaintPhaseForeground, |
3123 // then paint the caret. | 3123 // then paint the caret. |
3124 if (paintPhase == PaintPhaseForeground) { | 3124 if (paintPhase == PaintPhaseForeground) { |
3125 paintCaret(paintInfo, paintOffset, CursorCaret); | 3125 paintCaret(paintInfo, paintOffset, CursorCaret); |
3126 paintCaret(paintInfo, paintOffset, DragCaret); | 3126 paintCaret(paintInfo, paintOffset, DragCaret); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3234 LayoutPoint accumulatedPaintOffset = paintOffset; | 3234 LayoutPoint accumulatedPaintOffset = paintOffset; |
3235 // Paint each continuation outline. | 3235 // Paint each continuation outline. |
3236 ListHashSet<RenderInline*>::iterator end = continuations->end(); | 3236 ListHashSet<RenderInline*>::iterator end = continuations->end(); |
3237 for (ListHashSet<RenderInline*>::iterator it = continuations->begin(); it !=
end; ++it) { | 3237 for (ListHashSet<RenderInline*>::iterator it = continuations->begin(); it !=
end; ++it) { |
3238 // Need to add in the coordinates of the intervening blocks. | 3238 // Need to add in the coordinates of the intervening blocks. |
3239 RenderInline* flow = *it; | 3239 RenderInline* flow = *it; |
3240 RenderBlock* block = flow->containingBlock(); | 3240 RenderBlock* block = flow->containingBlock(); |
3241 for ( ; block && block != this; block = block->containingBlock()) | 3241 for ( ; block && block != this; block = block->containingBlock()) |
3242 accumulatedPaintOffset.moveBy(block->location()); | 3242 accumulatedPaintOffset.moveBy(block->location()); |
3243 ASSERT(block); | 3243 ASSERT(block); |
3244 flow->paintOutline(info, accumulatedPaintOffset); | 3244 flow->paintOutline(info.context, accumulatedPaintOffset); |
3245 } | 3245 } |
3246 } | 3246 } |
3247 | 3247 |
3248 bool RenderBlock::shouldPaintSelectionGaps() const | 3248 bool RenderBlock::shouldPaintSelectionGaps() const |
3249 { | 3249 { |
3250 return selectionState() != SelectionNone && style()->visibility() == VISIBLE
&& isSelectionRoot(); | 3250 return selectionState() != SelectionNone && style()->visibility() == VISIBLE
&& isSelectionRoot(); |
3251 } | 3251 } |
3252 | 3252 |
3253 bool RenderBlock::isSelectionRoot() const | 3253 bool RenderBlock::isSelectionRoot() const |
3254 { | 3254 { |
(...skipping 3716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6971 LayoutUnit containerRight = containingBlock()->x() + containingBlock
LogicalWidthForContent(); | 6971 LayoutUnit containerRight = containingBlock()->x() + containingBlock
LogicalWidthForContent(); |
6972 FloatPoint absContainerPoint = localToAbsolute(FloatPoint(containerR
ight, 0)); | 6972 FloatPoint absContainerPoint = localToAbsolute(FloatPoint(containerR
ight, 0)); |
6973 | 6973 |
6974 *extraWidthToEndOfLine = absContainerPoint.x() - absRightPoint.x(); | 6974 *extraWidthToEndOfLine = absContainerPoint.x() - absRightPoint.x(); |
6975 } | 6975 } |
6976 } | 6976 } |
6977 | 6977 |
6978 return caretRect; | 6978 return caretRect; |
6979 } | 6979 } |
6980 | 6980 |
6981 void RenderBlock::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& a
dditionalOffset, const RenderLayerModelObject* paintContainer) | 6981 void RenderBlock::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& a
dditionalOffset) |
6982 { | 6982 { |
6983 // For blocks inside inlines, we go ahead and include margins so that we run
right up to the | 6983 // For blocks inside inlines, we go ahead and include margins so that we run
right up to the |
6984 // inline boxes above and below us (thus getting merged with them to form a
single irregular | 6984 // inline boxes above and below us (thus getting merged with them to form a
single irregular |
6985 // shape). | 6985 // shape). |
6986 if (inlineElementContinuation()) { | 6986 if (inlineElementContinuation()) { |
6987 // FIXME: This check really isn't accurate. | 6987 // FIXME: This check really isn't accurate. |
6988 bool nextInlineHasLineBox = inlineElementContinuation()->firstLineBox(); | 6988 bool nextInlineHasLineBox = inlineElementContinuation()->firstLineBox(); |
6989 // FIXME: This is wrong. The principal renderer may not be the continuat
ion preceding this block. | 6989 // FIXME: This is wrong. The principal renderer may not be the continuat
ion preceding this block. |
6990 // FIXME: This is wrong for block-flows that are horizontal. | 6990 // FIXME: This is wrong for block-flows that are horizontal. |
6991 // https://bugs.webkit.org/show_bug.cgi?id=46781 | 6991 // https://bugs.webkit.org/show_bug.cgi?id=46781 |
(...skipping 14 matching lines...) Expand all Loading... |
7006 if (!rect.isEmpty()) | 7006 if (!rect.isEmpty()) |
7007 rects.append(pixelSnappedIntRect(rect)); | 7007 rects.append(pixelSnappedIntRect(rect)); |
7008 } | 7008 } |
7009 | 7009 |
7010 for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()
) { | 7010 for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()
) { |
7011 if (!curr->isText() && !curr->isListMarker() && curr->isBox()) { | 7011 if (!curr->isText() && !curr->isListMarker() && curr->isBox()) { |
7012 RenderBox* box = toRenderBox(curr); | 7012 RenderBox* box = toRenderBox(curr); |
7013 FloatPoint pos; | 7013 FloatPoint pos; |
7014 // FIXME: This doesn't work correctly with transforms. | 7014 // FIXME: This doesn't work correctly with transforms. |
7015 if (box->layer()) | 7015 if (box->layer()) |
7016 pos = curr->localToContainerPoint(FloatPoint(), paintContain
er); | 7016 pos = curr->localToAbsolute(); |
7017 else | 7017 else |
7018 pos = FloatPoint(additionalOffset.x() + box->x(), additional
Offset.y() + box->y()); | 7018 pos = FloatPoint(additionalOffset.x() + box->x(), additional
Offset.y() + box->y()); |
7019 box->addFocusRingRects(rects, flooredLayoutPoint(pos), paintCont
ainer); | 7019 box->addFocusRingRects(rects, flooredLayoutPoint(pos)); |
7020 } | 7020 } |
7021 } | 7021 } |
7022 } | 7022 } |
7023 | 7023 |
7024 if (inlineElementContinuation()) | 7024 if (inlineElementContinuation()) |
7025 inlineElementContinuation()->addFocusRingRects(rects, flooredLayoutPoint
(additionalOffset + inlineElementContinuation()->containingBlock()->location() -
location()), paintContainer); | 7025 inlineElementContinuation()->addFocusRingRects(rects, flooredLayoutPoint
(additionalOffset + inlineElementContinuation()->containingBlock()->location() -
location())); |
7026 } | 7026 } |
7027 | 7027 |
7028 RenderBox* RenderBlock::createAnonymousBoxWithSameTypeAs(const RenderObject* par
ent) const | 7028 RenderBox* RenderBlock::createAnonymousBoxWithSameTypeAs(const RenderObject* par
ent) const |
7029 { | 7029 { |
7030 if (isAnonymousColumnsBlock()) | 7030 if (isAnonymousColumnsBlock()) |
7031 return createAnonymousColumnsWithParentRenderer(parent); | 7031 return createAnonymousColumnsWithParentRenderer(parent); |
7032 if (isAnonymousColumnSpanBlock()) | 7032 if (isAnonymousColumnSpanBlock()) |
7033 return createAnonymousColumnSpanWithParentRenderer(parent); | 7033 return createAnonymousColumnSpanWithParentRenderer(parent); |
7034 return createAnonymousWithParentRendererAndDisplay(parent, style()->display(
)); | 7034 return createAnonymousWithParentRendererAndDisplay(parent, style()->display(
)); |
7035 } | 7035 } |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7851 { | 7851 { |
7852 memoryInstrumentation->addRootObject(gColumnInfoMap, WebCoreMemoryTypes::Ren
deringStructures); | 7852 memoryInstrumentation->addRootObject(gColumnInfoMap, WebCoreMemoryTypes::Ren
deringStructures); |
7853 memoryInstrumentation->addRootObject(gPositionedDescendantsMap, WebCoreMemor
yTypes::RenderingStructures); | 7853 memoryInstrumentation->addRootObject(gPositionedDescendantsMap, WebCoreMemor
yTypes::RenderingStructures); |
7854 memoryInstrumentation->addRootObject(gPercentHeightDescendantsMap, WebCoreMe
moryTypes::RenderingStructures); | 7854 memoryInstrumentation->addRootObject(gPercentHeightDescendantsMap, WebCoreMe
moryTypes::RenderingStructures); |
7855 memoryInstrumentation->addRootObject(gPositionedContainerMap, WebCoreMemoryT
ypes::RenderingStructures); | 7855 memoryInstrumentation->addRootObject(gPositionedContainerMap, WebCoreMemoryT
ypes::RenderingStructures); |
7856 memoryInstrumentation->addRootObject(gPercentHeightContainerMap, WebCoreMemo
ryTypes::RenderingStructures); | 7856 memoryInstrumentation->addRootObject(gPercentHeightContainerMap, WebCoreMemo
ryTypes::RenderingStructures); |
7857 memoryInstrumentation->addRootObject(gDelayedUpdateScrollInfoSet, WebCoreMem
oryTypes::RenderingStructures); | 7857 memoryInstrumentation->addRootObject(gDelayedUpdateScrollInfoSet, WebCoreMem
oryTypes::RenderingStructures); |
7858 } | 7858 } |
7859 | 7859 |
7860 } // namespace WebCore | 7860 } // namespace WebCore |
OLD | NEW |