| 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 * (C) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
| 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 | 692 |
| 693 if (view() && view()->selectionStart()) { | 693 if (view() && view()->selectionStart()) { |
| 694 Node* startElement = view()->selectionStart()->node(); | 694 Node* startElement = view()->selectionStart()->node(); |
| 695 if (startElement && startElement->rootEditableElement() == node()) | 695 if (startElement && startElement->rootEditableElement() == node()) |
| 696 return true; | 696 return true; |
| 697 } | 697 } |
| 698 | 698 |
| 699 return false; | 699 return false; |
| 700 } | 700 } |
| 701 | 701 |
| 702 LayoutRect RenderBlock::selectionRectForPaintInvalidation(const RenderLayerModel
Object* paintInvalidationContainer, bool) | |
| 703 { | |
| 704 ASSERT(!needsLayout()); | |
| 705 | |
| 706 if (!shouldPaintSelectionGaps()) | |
| 707 return GapRects(); | |
| 708 | |
| 709 TransformState transformState(TransformState::ApplyTransformDirection, Float
Point()); | |
| 710 mapLocalToContainer(paintInvalidationContainer, transformState, ApplyContain
erFlip | UseTransforms); | |
| 711 LayoutPoint offsetFromPaintInvalidationContainer = roundedLayoutPoint(transf
ormState.mappedPoint()); | |
| 712 | |
| 713 if (hasOverflowClip()) | |
| 714 offsetFromPaintInvalidationContainer -= scrolledContentOffset(); | |
| 715 | |
| 716 LayoutUnit lastTop = 0; | |
| 717 LayoutUnit lastLeft = logicalLeftSelectionOffset(this, lastTop); | |
| 718 LayoutUnit lastRight = logicalRightSelectionOffset(this, lastTop); | |
| 719 | |
| 720 return selectionGaps(this, offsetFromPaintInvalidationContainer, IntSize(),
lastTop, lastLeft, lastRight); | |
| 721 } | |
| 722 | |
| 723 void RenderBlock::paintSelection(PaintInfo& paintInfo, const LayoutPoint& paintO
ffset) | 702 void RenderBlock::paintSelection(PaintInfo& paintInfo, const LayoutPoint& paintO
ffset) |
| 724 { | 703 { |
| 725 if (shouldPaintSelectionGaps() && paintInfo.phase == PaintPhaseForeground) { | 704 if (shouldPaintSelectionGaps() && paintInfo.phase == PaintPhaseForeground) { |
| 726 LayoutUnit lastTop = 0; | 705 LayoutUnit lastTop = 0; |
| 727 LayoutUnit lastLeft = logicalLeftSelectionOffset(this, lastTop); | 706 LayoutUnit lastLeft = logicalLeftSelectionOffset(this, lastTop); |
| 728 LayoutUnit lastRight = logicalRightSelectionOffset(this, lastTop); | 707 LayoutUnit lastRight = logicalRightSelectionOffset(this, lastTop); |
| 729 GraphicsContextStateSaver stateSaver(*paintInfo.context); | 708 GraphicsContextStateSaver stateSaver(*paintInfo.context); |
| 730 | 709 |
| 731 // TODO(ojan): In sky, we don't use the return value, but we | 710 // TODO(ojan): In sky, we don't use the return value, but we |
| 732 // need this in order to actually paint selection gaps. | 711 // need this in order to actually paint selection gaps. |
| (...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1969 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const | 1948 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const |
| 1970 { | 1949 { |
| 1971 showRenderObject(); | 1950 showRenderObject(); |
| 1972 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 1951 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
| 1973 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 1952 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
| 1974 } | 1953 } |
| 1975 | 1954 |
| 1976 #endif | 1955 #endif |
| 1977 | 1956 |
| 1978 } // namespace blink | 1957 } // namespace blink |
| OLD | NEW |