OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
5 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. | 5 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 | 419 |
420 if (node()) { | 420 if (node()) { |
421 if (lineDirectionPosition <= logicalLeft() + (logicalWidth() / 2)) | 421 if (lineDirectionPosition <= logicalLeft() + (logicalWidth() / 2)) |
422 return createPositionWithAffinity(0, DOWNSTREAM); | 422 return createPositionWithAffinity(0, DOWNSTREAM); |
423 return createPositionWithAffinity(1, DOWNSTREAM); | 423 return createPositionWithAffinity(1, DOWNSTREAM); |
424 } | 424 } |
425 | 425 |
426 return RenderBox::positionForPoint(point); | 426 return RenderBox::positionForPoint(point); |
427 } | 427 } |
428 | 428 |
429 LayoutRect LayoutReplaced::selectionRectForPaintInvalidation(const LayoutLayerMo
delObject* paintInvalidationContainer) const | 429 LayoutRect LayoutReplaced::selectionRectForPaintInvalidation(const LayoutBoxMode
lObject* paintInvalidationContainer) const |
430 { | 430 { |
431 ASSERT(!needsLayout()); | 431 ASSERT(!needsLayout()); |
432 | 432 |
433 if (!isSelected()) | 433 if (!isSelected()) |
434 return LayoutRect(); | 434 return LayoutRect(); |
435 | 435 |
436 LayoutRect rect = localSelectionRect(); | 436 LayoutRect rect = localSelectionRect(); |
437 mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, 0); | 437 mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, 0); |
438 // FIXME: groupedMapping() leaks the squashing abstraction. | 438 // FIXME: groupedMapping() leaks the squashing abstraction. |
439 if (paintInvalidationContainer->layer()->groupedMapping()) | 439 if (paintInvalidationContainer->layer()->groupedMapping()) |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 | 490 |
491 int end = node()->hasChildren() ? node()->countChildren() : 1; | 491 int end = node()->hasChildren() ? node()->countChildren() : 1; |
492 if (s == SelectionEnd) | 492 if (s == SelectionEnd) |
493 return selectionEnd == end; | 493 return selectionEnd == end; |
494 if (s == SelectionBoth) | 494 if (s == SelectionBoth) |
495 return selectionStart == 0 && selectionEnd == end; | 495 return selectionStart == 0 && selectionEnd == end; |
496 | 496 |
497 ASSERT(0); | 497 ASSERT(0); |
498 return false; | 498 return false; |
499 } | 499 } |
500 LayoutRect LayoutReplaced::clippedOverflowRectForPaintInvalidation(const LayoutL
ayerModelObject* paintInvalidationContainer, const PaintInvalidationState* paint
InvalidationState) const | 500 LayoutRect LayoutReplaced::clippedOverflowRectForPaintInvalidation(const LayoutB
oxModelObject* paintInvalidationContainer, const PaintInvalidationState* paintIn
validationState) const |
501 { | 501 { |
502 if (style()->visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent
()) | 502 if (style()->visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent
()) |
503 return LayoutRect(); | 503 return LayoutRect(); |
504 | 504 |
505 // The selectionRect can project outside of the overflowRect, so take their
union | 505 // The selectionRect can project outside of the overflowRect, so take their
union |
506 // for paint invalidation to avoid selection painting glitches. | 506 // for paint invalidation to avoid selection painting glitches. |
507 LayoutRect r = isSelected() ? localSelectionRect() : visualOverflowRect(); | 507 LayoutRect r = isSelected() ? localSelectionRect() : visualOverflowRect(); |
508 mapRectToPaintInvalidationBacking(paintInvalidationContainer, r, paintInvali
dationState); | 508 mapRectToPaintInvalidationBacking(paintInvalidationContainer, r, paintInvali
dationState); |
509 return r; | 509 return r; |
510 } | 510 } |
511 | 511 |
512 } | 512 } |
OLD | NEW |