| 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) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 } | 37 } |
| 38 | 38 |
| 39 const VisibleSelection& PendingSelection::visibleSelection() const | 39 const VisibleSelection& PendingSelection::visibleSelection() const |
| 40 { | 40 { |
| 41 return m_frameSelection->selection(); | 41 return m_frameSelection->selection(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 static bool isSelectionInDocument(const VisibleSelectionInFlatTree& visibleSelec
tion, const Document& document) | 44 static bool isSelectionInDocument(const VisibleSelectionInFlatTree& visibleSelec
tion, const Document& document) |
| 45 { | 45 { |
| 46 const PositionInFlatTree& start = visibleSelection.start(); | 46 const PositionInFlatTree& start = visibleSelection.start(); |
| 47 if (start.isNotNull() && (!start.inShadowIncludingDocument() || start.docume
nt() != document)) | 47 if (start.isNotNull() && (!start.isConnected() || start.document() != docume
nt)) |
| 48 return false; | 48 return false; |
| 49 const PositionInFlatTree& end = visibleSelection.end(); | 49 const PositionInFlatTree& end = visibleSelection.end(); |
| 50 if (end.isNotNull() && (!end.inShadowIncludingDocument() || end.document() !
= document)) | 50 if (end.isNotNull() && (!end.isConnected() || end.document() != document)) |
| 51 return false; | 51 return false; |
| 52 const PositionInFlatTree extent = visibleSelection.extent(); | 52 const PositionInFlatTree extent = visibleSelection.extent(); |
| 53 if (extent.isNotNull() && (!extent.inShadowIncludingDocument() || extent.doc
ument() != document)) | 53 if (extent.isNotNull() && (!extent.isConnected() || extent.document() != doc
ument)) |
| 54 return false; | 54 return false; |
| 55 return true; | 55 return true; |
| 56 } | 56 } |
| 57 | 57 |
| 58 VisibleSelectionInFlatTree PendingSelection::calcVisibleSelection(const VisibleS
electionInFlatTree& originalSelection) const | 58 VisibleSelectionInFlatTree PendingSelection::calcVisibleSelection(const VisibleS
electionInFlatTree& originalSelection) const |
| 59 { | 59 { |
| 60 const PositionInFlatTree& start = originalSelection.start(); | 60 const PositionInFlatTree& start = originalSelection.start(); |
| 61 const PositionInFlatTree& end = originalSelection.end(); | 61 const PositionInFlatTree& end = originalSelection.end(); |
| 62 SelectionType selectionType = originalSelection.getSelectionType(); | 62 SelectionType selectionType = originalSelection.getSelectionType(); |
| 63 const TextAffinity affinity = originalSelection.affinity(); | 63 const TextAffinity affinity = originalSelection.affinity(); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 DCHECK(layoutView == endLayoutObject->view()); | 134 DCHECK(layoutView == endLayoutObject->view()); |
| 135 layoutView.setSelection(startLayoutObject, startPos.computeEditingOffset(),
endLayoutObject, endPos.computeEditingOffset()); | 135 layoutView.setSelection(startLayoutObject, startPos.computeEditingOffset(),
endLayoutObject, endPos.computeEditingOffset()); |
| 136 } | 136 } |
| 137 | 137 |
| 138 DEFINE_TRACE(PendingSelection) | 138 DEFINE_TRACE(PendingSelection) |
| 139 { | 139 { |
| 140 visitor->trace(m_frameSelection); | 140 visitor->trace(m_frameSelection); |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace blink | 143 } // namespace blink |
| OLD | NEW |