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 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1580 return rect; | 1580 return rect; |
1581 } | 1581 } |
1582 | 1582 |
1583 LayoutRect RenderText::clippedOverflowRectForPaintInvalidation(const RenderLayer
ModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInva
lidationState) const | 1583 LayoutRect RenderText::clippedOverflowRectForPaintInvalidation(const RenderLayer
ModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInva
lidationState) const |
1584 { | 1584 { |
1585 // This method doesn't support paintInvalidationState, but invalidateTreeIfN
eeded() never reaches RenderText. | 1585 // This method doesn't support paintInvalidationState, but invalidateTreeIfN
eeded() never reaches RenderText. |
1586 ASSERT(!paintInvalidationState); | 1586 ASSERT(!paintInvalidationState); |
1587 return parent()->clippedOverflowRectForPaintInvalidation(paintInvalidationCo
ntainer); | 1587 return parent()->clippedOverflowRectForPaintInvalidation(paintInvalidationCo
ntainer); |
1588 } | 1588 } |
1589 | 1589 |
1590 LayoutRect RenderText::selectionRectForPaintInvalidation(const RenderLayerModelO
bject* paintInvalidationContainer, bool clipToVisibleContent) const | 1590 LayoutRect RenderText::selectionRectForPaintInvalidation(const RenderLayerModelO
bject* paintInvalidationContainer) const |
1591 { | 1591 { |
1592 ASSERT(!needsLayout()); | 1592 ASSERT(!needsLayout()); |
1593 | 1593 |
1594 if (selectionState() == SelectionNone) | 1594 if (selectionState() == SelectionNone) |
1595 return LayoutRect(); | 1595 return LayoutRect(); |
1596 RenderBlock* cb = containingBlock(); | 1596 RenderBlock* cb = containingBlock(); |
1597 if (!cb) | 1597 if (!cb) |
1598 return LayoutRect(); | 1598 return LayoutRect(); |
1599 | 1599 |
1600 // Now calculate startPos and endPos for painting selection. | 1600 // Now calculate startPos and endPos for painting selection. |
(...skipping 13 matching lines...) Expand all Loading... |
1614 | 1614 |
1615 if (startPos == endPos) | 1615 if (startPos == endPos) |
1616 return IntRect(); | 1616 return IntRect(); |
1617 | 1617 |
1618 LayoutRect rect; | 1618 LayoutRect rect; |
1619 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { | 1619 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { |
1620 rect.unite(box->localSelectionRect(startPos, endPos)); | 1620 rect.unite(box->localSelectionRect(startPos, endPos)); |
1621 rect.unite(ellipsisRectForBox(box, startPos, endPos)); | 1621 rect.unite(ellipsisRectForBox(box, startPos, endPos)); |
1622 } | 1622 } |
1623 | 1623 |
1624 if (clipToVisibleContent) { | 1624 if (cb->hasColumns()) |
1625 mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, 0); | 1625 cb->adjustRectForColumns(rect); |
1626 } else { | |
1627 if (cb->hasColumns()) | |
1628 cb->adjustRectForColumns(rect); | |
1629 | 1626 |
1630 rect = localToContainerQuad(FloatRect(rect), paintInvalidationContainer)
.enclosingBoundingBox(); | 1627 return localToContainerQuad(FloatRect(rect), paintInvalidationContainer).enc
losingBoundingBox(); |
1631 } | |
1632 | |
1633 return rect; | |
1634 } | 1628 } |
1635 | 1629 |
1636 int RenderText::caretMinOffset() const | 1630 int RenderText::caretMinOffset() const |
1637 { | 1631 { |
1638 InlineTextBox* box = firstTextBox(); | 1632 InlineTextBox* box = firstTextBox(); |
1639 if (!box) | 1633 if (!box) |
1640 return 0; | 1634 return 0; |
1641 int minOffset = box->start(); | 1635 int minOffset = box->start(); |
1642 for (box = box->nextTextBox(); box; box = box->nextTextBox()) | 1636 for (box = box->nextTextBox(); box; box = box->nextTextBox()) |
1643 minOffset = std::min<int>(minOffset, box->start()); | 1637 minOffset = std::min<int>(minOffset, box->start()); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1870 } | 1864 } |
1871 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); | 1865 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); |
1872 } | 1866 } |
1873 | 1867 |
1874 PassRefPtr<AbstractInlineTextBox> RenderText::firstAbstractInlineTextBox() | 1868 PassRefPtr<AbstractInlineTextBox> RenderText::firstAbstractInlineTextBox() |
1875 { | 1869 { |
1876 return AbstractInlineTextBox::getOrCreate(this, m_firstTextBox); | 1870 return AbstractInlineTextBox::getOrCreate(this, m_firstTextBox); |
1877 } | 1871 } |
1878 | 1872 |
1879 } // namespace blink | 1873 } // namespace blink |
OLD | NEW |