| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
| 3 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved. | 3 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 VisiblePosition endVisiblePosition(const Range *r, EAffinity affinity) | 742 VisiblePosition endVisiblePosition(const Range *r, EAffinity affinity) |
| 743 { | 743 { |
| 744 return VisiblePosition(r->endPosition(), affinity); | 744 return VisiblePosition(r->endPosition(), affinity); |
| 745 } | 745 } |
| 746 | 746 |
| 747 bool setStart(Range *r, const VisiblePosition &visiblePosition) | 747 bool setStart(Range *r, const VisiblePosition &visiblePosition) |
| 748 { | 748 { |
| 749 if (!r) | 749 if (!r) |
| 750 return false; | 750 return false; |
| 751 Position p = visiblePosition.deepEquivalent().parentAnchoredEquivalent(); | 751 Position p = visiblePosition.deepEquivalent().parentAnchoredEquivalent(); |
| 752 TrackExceptionState es; | 752 TrackExceptionState exceptionState; |
| 753 r->setStart(p.containerNode(), p.offsetInContainerNode(), es); | 753 r->setStart(p.containerNode(), p.offsetInContainerNode(), exceptionState); |
| 754 return !es.hadException(); | 754 return !exceptionState.hadException(); |
| 755 } | 755 } |
| 756 | 756 |
| 757 bool setEnd(Range *r, const VisiblePosition &visiblePosition) | 757 bool setEnd(Range *r, const VisiblePosition &visiblePosition) |
| 758 { | 758 { |
| 759 if (!r) | 759 if (!r) |
| 760 return false; | 760 return false; |
| 761 Position p = visiblePosition.deepEquivalent().parentAnchoredEquivalent(); | 761 Position p = visiblePosition.deepEquivalent().parentAnchoredEquivalent(); |
| 762 TrackExceptionState es; | 762 TrackExceptionState exceptionState; |
| 763 r->setEnd(p.containerNode(), p.offsetInContainerNode(), es); | 763 r->setEnd(p.containerNode(), p.offsetInContainerNode(), exceptionState); |
| 764 return !es.hadException(); | 764 return !exceptionState.hadException(); |
| 765 } | 765 } |
| 766 | 766 |
| 767 Element* enclosingBlockFlowElement(const VisiblePosition &visiblePosition) | 767 Element* enclosingBlockFlowElement(const VisiblePosition &visiblePosition) |
| 768 { | 768 { |
| 769 if (visiblePosition.isNull()) | 769 if (visiblePosition.isNull()) |
| 770 return NULL; | 770 return NULL; |
| 771 | 771 |
| 772 return visiblePosition.deepEquivalent().deprecatedNode()->enclosingBlockFlow
Element(); | 772 return visiblePosition.deepEquivalent().deprecatedNode()->enclosingBlockFlow
Element(); |
| 773 } | 773 } |
| 774 | 774 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 805 if (vpos) | 805 if (vpos) |
| 806 vpos->showTreeForThis(); | 806 vpos->showTreeForThis(); |
| 807 } | 807 } |
| 808 | 808 |
| 809 void showTree(const WebCore::VisiblePosition& vpos) | 809 void showTree(const WebCore::VisiblePosition& vpos) |
| 810 { | 810 { |
| 811 vpos.showTreeForThis(); | 811 vpos.showTreeForThis(); |
| 812 } | 812 } |
| 813 | 813 |
| 814 #endif | 814 #endif |
| OLD | NEW |