Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutText.cpp

Issue 1516683002: Introducing LayoutObject::mapToVisibleRectInContainerSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Fix flipping logic Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after
1577 rect = rect.transposedRect(); 1577 rect = rect.transposedRect();
1578 return rect; 1578 return rect;
1579 } 1579 }
1580 1580
1581 LayoutRect LayoutText::clippedOverflowRectForPaintInvalidation(const LayoutBoxMo delObject* paintInvalidationContainer, const PaintInvalidationState* paintInvali dationState) const 1581 LayoutRect LayoutText::clippedOverflowRectForPaintInvalidation(const LayoutBoxMo delObject* paintInvalidationContainer, const PaintInvalidationState* paintInvali dationState) const
1582 { 1582 {
1583 if (style()->visibility() != VISIBLE) 1583 if (style()->visibility() != VISIBLE)
1584 return LayoutRect(); 1584 return LayoutRect();
1585 1585
1586 LayoutRect paintInvalidationRect(visualOverflowRect()); 1586 LayoutRect paintInvalidationRect(visualOverflowRect());
1587 mapRectToPaintInvalidationBacking(paintInvalidationContainer, paintInvalidat ionRect, paintInvalidationState); 1587 mapToVisibleRectInContainerSpace(paintInvalidationContainer, paintInvalidati onRect, paintInvalidationState);
1588 return paintInvalidationRect; 1588 return paintInvalidationRect;
1589 } 1589 }
1590 1590
1591 LayoutRect LayoutText::selectionRectForPaintInvalidation(const LayoutBoxModelObj ect* paintInvalidationContainer) const 1591 LayoutRect LayoutText::selectionRectForPaintInvalidation(const LayoutBoxModelObj ect* paintInvalidationContainer) const
1592 { 1592 {
1593 ASSERT(!needsLayout()); 1593 ASSERT(!needsLayout());
1594 1594
1595 if (selectionState() == SelectionNone) 1595 if (selectionState() == SelectionNone)
1596 return LayoutRect(); 1596 return LayoutRect();
1597 LayoutBlock* cb = containingBlock(); 1597 LayoutBlock* cb = containingBlock();
(...skipping 18 matching lines...) Expand all
1616 LayoutRect rect; 1616 LayoutRect rect;
1617 1617
1618 if (startPos == endPos) 1618 if (startPos == endPos)
1619 return rect; 1619 return rect;
1620 1620
1621 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { 1621 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
1622 rect.unite(box->localSelectionRect(startPos, endPos)); 1622 rect.unite(box->localSelectionRect(startPos, endPos));
1623 rect.unite(LayoutRect(ellipsisRectForBox(box, startPos, endPos))); 1623 rect.unite(LayoutRect(ellipsisRectForBox(box, startPos, endPos)));
1624 } 1624 }
1625 1625
1626 mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, 0); 1626 mapToVisibleRectInContainerSpace(paintInvalidationContainer, rect, 0);
1627 // FIXME: groupedMapping() leaks the squashing abstraction. 1627 // FIXME: groupedMapping() leaks the squashing abstraction.
1628 if (paintInvalidationContainer->layer()->groupedMapping()) 1628 if (paintInvalidationContainer->layer()->groupedMapping())
1629 PaintLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, rect); 1629 PaintLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, rect);
1630 return rect; 1630 return rect;
1631 } 1631 }
1632 1632
1633 int LayoutText::caretMinOffset() const 1633 int LayoutText::caretMinOffset() const
1634 { 1634 {
1635 InlineTextBox* box = firstTextBox(); 1635 InlineTextBox* box = firstTextBox();
1636 if (!box) 1636 if (!box)
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1882 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { 1882 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
1883 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in validationReason, paintInvalidationRect); 1883 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in validationReason, paintInvalidationRect);
1884 if (box->truncation() != cNoTruncation) { 1884 if (box->truncation() != cNoTruncation) {
1885 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox()) 1885 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox())
1886 paintInvalidationContainer.invalidateDisplayItemClientOnBacking( *ellipsisBox, invalidationReason, paintInvalidationRect); 1886 paintInvalidationContainer.invalidateDisplayItemClientOnBacking( *ellipsisBox, invalidationReason, paintInvalidationRect);
1887 } 1887 }
1888 } 1888 }
1889 } 1889 }
1890 1890
1891 } // namespace blink 1891 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableCell.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698