OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * (C) 2000 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) | 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
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 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1566 LayoutUnit logicalTop = firstTextBox()->logicalTopVisualOverflow(); | 1566 LayoutUnit logicalTop = firstTextBox()->logicalTopVisualOverflow(); |
1567 LayoutUnit logicalWidth = logicalRightSide - logicalLeftSide; | 1567 LayoutUnit logicalWidth = logicalRightSide - logicalLeftSide; |
1568 LayoutUnit logicalHeight = lastTextBox()->logicalBottomVisualOverflow() - lo
gicalTop; | 1568 LayoutUnit logicalHeight = lastTextBox()->logicalBottomVisualOverflow() - lo
gicalTop; |
1569 | 1569 |
1570 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight); | 1570 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight); |
1571 if (!style()->isHorizontalWritingMode()) | 1571 if (!style()->isHorizontalWritingMode()) |
1572 rect = rect.transposedRect(); | 1572 rect = rect.transposedRect(); |
1573 return rect; | 1573 return rect; |
1574 } | 1574 } |
1575 | 1575 |
1576 LayoutRect LayoutText::clippedOverflowRectForPaintInvalidation(const LayoutBoxMo
delObject* paintInvalidationContainer, const PaintInvalidationState* paintInvali
dationState) const | 1576 LayoutRect LayoutText::localOverflowRectForPaintInvalidation() const |
1577 { | 1577 { |
1578 if (style()->visibility() != VISIBLE) | 1578 if (style()->visibility() != VISIBLE) |
1579 return LayoutRect(); | 1579 return LayoutRect(); |
1580 | 1580 |
1581 LayoutRect paintInvalidationRect(visualOverflowRect()); | 1581 return visualOverflowRect(); |
1582 mapToVisibleRectInAncestorSpace(paintInvalidationContainer, paintInvalidatio
nRect, paintInvalidationState); | |
1583 return paintInvalidationRect; | |
1584 } | 1582 } |
1585 | 1583 |
1586 LayoutRect LayoutText::selectionRectForPaintInvalidation(const LayoutBoxModelObj
ect* paintInvalidationContainer) const | 1584 LayoutRect LayoutText::localSelectionRect() const |
1587 { | 1585 { |
1588 ASSERT(!needsLayout()); | 1586 ASSERT(!needsLayout()); |
1589 | 1587 |
1590 if (getSelectionState() == SelectionNone) | 1588 if (getSelectionState() == SelectionNone) |
1591 return LayoutRect(); | 1589 return LayoutRect(); |
1592 LayoutBlock* cb = containingBlock(); | 1590 LayoutBlock* cb = containingBlock(); |
1593 if (!cb) | 1591 if (!cb) |
1594 return LayoutRect(); | 1592 return LayoutRect(); |
1595 | 1593 |
1596 // Now calculate startPos and endPos for painting selection. | 1594 // Now calculate startPos and endPos for painting selection. |
(...skipping 14 matching lines...) Expand all Loading... |
1611 LayoutRect rect; | 1609 LayoutRect rect; |
1612 | 1610 |
1613 if (startPos == endPos) | 1611 if (startPos == endPos) |
1614 return rect; | 1612 return rect; |
1615 | 1613 |
1616 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { | 1614 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { |
1617 rect.unite(box->localSelectionRect(startPos, endPos)); | 1615 rect.unite(box->localSelectionRect(startPos, endPos)); |
1618 rect.unite(LayoutRect(ellipsisRectForBox(box, startPos, endPos))); | 1616 rect.unite(LayoutRect(ellipsisRectForBox(box, startPos, endPos))); |
1619 } | 1617 } |
1620 | 1618 |
1621 mapToVisibleRectInAncestorSpace(paintInvalidationContainer, rect, 0); | |
1622 // FIXME: groupedMapping() leaks the squashing abstraction. | |
1623 if (paintInvalidationContainer->layer()->groupedMapping()) | |
1624 PaintLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer,
rect); | |
1625 return rect; | 1619 return rect; |
1626 } | 1620 } |
1627 | 1621 |
1628 int LayoutText::caretMinOffset() const | 1622 int LayoutText::caretMinOffset() const |
1629 { | 1623 { |
1630 InlineTextBox* box = firstTextBox(); | 1624 InlineTextBox* box = firstTextBox(); |
1631 if (!box) | 1625 if (!box) |
1632 return 0; | 1626 return 0; |
1633 int minOffset = box->start(); | 1627 int minOffset = box->start(); |
1634 for (box = box->nextTextBox(); box; box = box->nextTextBox()) | 1628 for (box = box->nextTextBox(); box; box = box->nextTextBox()) |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1751 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { | 1745 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { |
1752 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in
validationReason); | 1746 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in
validationReason); |
1753 if (box->truncation() != cNoTruncation) { | 1747 if (box->truncation() != cNoTruncation) { |
1754 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox()) | 1748 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox()) |
1755 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(
*ellipsisBox, invalidationReason); | 1749 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(
*ellipsisBox, invalidationReason); |
1756 } | 1750 } |
1757 } | 1751 } |
1758 } | 1752 } |
1759 | 1753 |
1760 } // namespace blink | 1754 } // namespace blink |
OLD | NEW |