| 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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 } | 84 } |
| 85 } else if (parent()) | 85 } else if (parent()) |
| 86 parent()->dirtyLinesFromChangedChild(this); | 86 parent()->dirtyLinesFromChangedChild(this); |
| 87 } | 87 } |
| 88 | 88 |
| 89 m_lineBoxes.deleteLineBoxes(); | 89 m_lineBoxes.deleteLineBoxes(); |
| 90 | 90 |
| 91 RenderBoxModelObject::willBeDestroyed(); | 91 RenderBoxModelObject::willBeDestroyed(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void RenderInline::updateFromStyle() | |
| 95 { | |
| 96 RenderBoxModelObject::updateFromStyle(); | |
| 97 | |
| 98 // FIXME: Is this still needed. Was needed for run-ins, since run-in is cons
idered a block display type. | |
| 99 setInline(true); | |
| 100 | |
| 101 // FIXME: Support transforms and reflections on inline flows someday. | |
| 102 setHasTransform(false); | |
| 103 } | |
| 104 | |
| 105 void RenderInline::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
yle) | 94 void RenderInline::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
yle) |
| 106 { | 95 { |
| 107 RenderBoxModelObject::styleDidChange(diff, oldStyle); | 96 RenderBoxModelObject::styleDidChange(diff, oldStyle); |
| 108 | 97 |
| 109 if (!alwaysCreateLineBoxes()) { | 98 if (!alwaysCreateLineBoxes()) { |
| 110 RenderStyle* newStyle = style(); | 99 RenderStyle* newStyle = style(); |
| 111 bool alwaysCreateLineBoxesNew = hasSelfPaintingLayer() || hasBoxDecorati
onBackground() || newStyle->hasPadding() || newStyle->hasMargin() || newStyle->h
asOutline(); | 100 bool alwaysCreateLineBoxesNew = hasBoxDecorationBackground() || newStyle
->hasPadding() || newStyle->hasMargin() || newStyle->hasOutline(); |
| 112 if (oldStyle && alwaysCreateLineBoxesNew) { | 101 if (oldStyle && alwaysCreateLineBoxesNew) { |
| 113 dirtyLineBoxes(false); | 102 dirtyLineBoxes(false); |
| 114 setNeedsLayout(); | 103 setNeedsLayout(); |
| 115 } | 104 } |
| 116 setAlwaysCreateLineBoxes(alwaysCreateLineBoxesNew); | 105 setAlwaysCreateLineBoxes(alwaysCreateLineBoxesNew); |
| 117 } | 106 } |
| 118 } | 107 } |
| 119 | 108 |
| 120 void RenderInline::updateAlwaysCreateLineBoxes(bool fullLayout) | 109 void RenderInline::updateAlwaysCreateLineBoxes(bool fullLayout) |
| 121 { | 110 { |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 if (!currBox->hasSelfPaintingLayer() && currBox->inlineBoxWrapper())
{ | 523 if (!currBox->hasSelfPaintingLayer() && currBox->inlineBoxWrapper())
{ |
| 535 LayoutRect logicalRect = currBox->visualOverflowRect(); | 524 LayoutRect logicalRect = currBox->visualOverflowRect(); |
| 536 logicalRect.moveBy(currBox->location()); | 525 logicalRect.moveBy(currBox->location()); |
| 537 result.uniteIfNonZero(logicalRect); | 526 result.uniteIfNonZero(logicalRect); |
| 538 } | 527 } |
| 539 } else if (curr->isRenderInline()) { | 528 } else if (curr->isRenderInline()) { |
| 540 // If the child doesn't need line boxes either, then we can recur. | 529 // If the child doesn't need line boxes either, then we can recur. |
| 541 RenderInline* currInline = toRenderInline(curr); | 530 RenderInline* currInline = toRenderInline(curr); |
| 542 if (!currInline->alwaysCreateLineBoxes()) | 531 if (!currInline->alwaysCreateLineBoxes()) |
| 543 result.uniteIfNonZero(currInline->culledInlineVisualOverflowBoun
dingBox()); | 532 result.uniteIfNonZero(currInline->culledInlineVisualOverflowBoun
dingBox()); |
| 544 else if (!currInline->hasSelfPaintingLayer()) | 533 else |
| 545 result.uniteIfNonZero(currInline->linesVisualOverflowBoundingBox
()); | 534 result.uniteIfNonZero(currInline->linesVisualOverflowBoundingBox
()); |
| 546 } else if (curr->isText()) { | 535 } else if (curr->isText()) { |
| 547 // FIXME; Overflow from text boxes is lost. We will need to cache th
is information in | 536 // FIXME; Overflow from text boxes is lost. We will need to cache th
is information in |
| 548 // InlineTextBoxes. | 537 // InlineTextBoxes. |
| 549 RenderText* currText = toRenderText(curr); | 538 RenderText* currText = toRenderText(curr); |
| 550 result.uniteIfNonZero(currText->linesVisualOverflowBoundingBox()); | 539 result.uniteIfNonZero(currText->linesVisualOverflowBoundingBox()); |
| 551 } | 540 } |
| 552 } | 541 } |
| 553 return result; | 542 return result; |
| 554 } | 543 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 573 RootInlineBox& lastRootBox = lastLineBox()->root(); | 562 RootInlineBox& lastRootBox = lastLineBox()->root(); |
| 574 | 563 |
| 575 LayoutUnit logicalTop = firstLineBox()->logicalTopVisualOverflow(firstRootBo
x.lineTop()); | 564 LayoutUnit logicalTop = firstLineBox()->logicalTopVisualOverflow(firstRootBo
x.lineTop()); |
| 576 LayoutUnit logicalWidth = logicalRightSide - logicalLeftSide; | 565 LayoutUnit logicalWidth = logicalRightSide - logicalLeftSide; |
| 577 LayoutUnit logicalHeight = lastLineBox()->logicalBottomVisualOverflow(lastRo
otBox.lineBottom()) - logicalTop; | 566 LayoutUnit logicalHeight = lastLineBox()->logicalBottomVisualOverflow(lastRo
otBox.lineBottom()) - logicalTop; |
| 578 | 567 |
| 579 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight); | 568 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight); |
| 580 return rect; | 569 return rect; |
| 581 } | 570 } |
| 582 | 571 |
| 583 void RenderInline::mapLocalToContainer(const RenderLayerModelObject* paintInvali
dationContainer, TransformState& transformState, MapCoordinatesFlags mode) const | 572 void RenderInline::mapLocalToContainer(const RenderBox* paintInvalidationContain
er, TransformState& transformState, MapCoordinatesFlags mode) const |
| 584 { | 573 { |
| 585 if (paintInvalidationContainer == this) | |
| 586 return; | |
| 587 | |
| 588 bool containerSkipped; | 574 bool containerSkipped; |
| 589 RenderObject* o = container(paintInvalidationContainer, &containerSkipped); | 575 RenderObject* o = container(paintInvalidationContainer, &containerSkipped); |
| 590 if (!o) | 576 if (!o) |
| 591 return; | 577 return; |
| 592 | 578 |
| 593 if (mode & ApplyContainerFlip && o->isBox()) { | 579 if (mode & ApplyContainerFlip && o->isBox()) { |
| 594 mode &= ~ApplyContainerFlip; | 580 mode &= ~ApplyContainerFlip; |
| 595 } | 581 } |
| 596 | 582 |
| 597 LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(trans
formState.mappedPoint())); | 583 LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(trans
formState.mappedPoint())); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 | 687 |
| 702 void operator()(const FloatRect& rect) | 688 void operator()(const FloatRect& rect) |
| 703 { | 689 { |
| 704 if (!rect.isEmpty()) | 690 if (!rect.isEmpty()) |
| 705 AbsoluteRectsGeneratorContext::operator()(rect); | 691 AbsoluteRectsGeneratorContext::operator()(rect); |
| 706 } | 692 } |
| 707 }; | 693 }; |
| 708 | 694 |
| 709 } // unnamed namespace | 695 } // unnamed namespace |
| 710 | 696 |
| 711 void RenderInline::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint&
additionalOffset, const RenderLayerModelObject* paintContainer) const | 697 void RenderInline::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint&
additionalOffset, const RenderBox* paintContainer) const |
| 712 { | 698 { |
| 713 AbsoluteRectsIgnoringEmptyRectsGeneratorContext context(rects, additionalOff
set); | 699 AbsoluteRectsIgnoringEmptyRectsGeneratorContext context(rects, additionalOff
set); |
| 714 generateLineBoxRects(context); | 700 generateLineBoxRects(context); |
| 715 | 701 |
| 716 addChildFocusRingRects(rects, additionalOffset, paintContainer); | 702 addChildFocusRingRects(rects, additionalOffset, paintContainer); |
| 717 } | 703 } |
| 718 | 704 |
| 719 } // namespace blink | 705 } // namespace blink |
| OLD | NEW |