| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 } | 737 } |
| 738 } | 738 } |
| 739 | 739 |
| 740 // Correct the extent if necessary. | 740 // Correct the extent if necessary. |
| 741 if (baseEditableAncestor != lowestEditableAncestor(m_extent.containerNode())
) | 741 if (baseEditableAncestor != lowestEditableAncestor(m_extent.containerNode())
) |
| 742 m_extent = m_baseIsFirst ? m_end : m_start; | 742 m_extent = m_baseIsFirst ? m_end : m_start; |
| 743 } | 743 } |
| 744 | 744 |
| 745 VisiblePosition VisibleSelection::visiblePositionRespectingEditingBoundary(const
LayoutPoint& localPoint, Node* targetNode) const | 745 VisiblePosition VisibleSelection::visiblePositionRespectingEditingBoundary(const
LayoutPoint& localPoint, Node* targetNode) const |
| 746 { | 746 { |
| 747 if (!targetNode->renderer()) | 747 if (!targetNode->layoutObject()) |
| 748 return VisiblePosition(); | 748 return VisiblePosition(); |
| 749 | 749 |
| 750 LayoutPoint selectionEndPoint = localPoint; | 750 LayoutPoint selectionEndPoint = localPoint; |
| 751 Element* editableElement = rootEditableElement(); | 751 Element* editableElement = rootEditableElement(); |
| 752 | 752 |
| 753 if (editableElement && !editableElement->contains(targetNode)) { | 753 if (editableElement && !editableElement->contains(targetNode)) { |
| 754 if (!editableElement->renderer()) | 754 if (!editableElement->layoutObject()) |
| 755 return VisiblePosition(); | 755 return VisiblePosition(); |
| 756 | 756 |
| 757 FloatPoint absolutePoint = targetNode->renderer()->localToAbsolute(Float
Point(selectionEndPoint)); | 757 FloatPoint absolutePoint = targetNode->layoutObject()->localToAbsolute(F
loatPoint(selectionEndPoint)); |
| 758 selectionEndPoint = roundedLayoutPoint(editableElement->renderer()->abso
luteToLocal(absolutePoint)); | 758 selectionEndPoint = roundedLayoutPoint(editableElement->layoutObject()->
absoluteToLocal(absolutePoint)); |
| 759 targetNode = editableElement; | 759 targetNode = editableElement; |
| 760 } | 760 } |
| 761 | 761 |
| 762 return VisiblePosition(targetNode->renderer()->positionForPoint(selectionEnd
Point)); | 762 return VisiblePosition(targetNode->layoutObject()->positionForPoint(selectio
nEndPoint)); |
| 763 } | 763 } |
| 764 | 764 |
| 765 | 765 |
| 766 bool VisibleSelection::isContentEditable() const | 766 bool VisibleSelection::isContentEditable() const |
| 767 { | 767 { |
| 768 return isEditablePosition(start()); | 768 return isEditablePosition(start()); |
| 769 } | 769 } |
| 770 | 770 |
| 771 bool VisibleSelection::hasEditableStyle() const | 771 bool VisibleSelection::hasEditableStyle() const |
| 772 { | 772 { |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 sel.showTreeForThis(); | 909 sel.showTreeForThis(); |
| 910 } | 910 } |
| 911 | 911 |
| 912 void showTree(const blink::VisibleSelection* sel) | 912 void showTree(const blink::VisibleSelection* sel) |
| 913 { | 913 { |
| 914 if (sel) | 914 if (sel) |
| 915 sel->showTreeForThis(); | 915 sel->showTreeForThis(); |
| 916 } | 916 } |
| 917 | 917 |
| 918 #endif | 918 #endif |
| OLD | NEW |