| 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 |
| 11 * notice, this list of conditions and the following disclaimer in the | 11 * notice, this list of conditions and the following disclaimer in the |
| 12 * documentation and/or other materials provided with the distribution. | 12 * documentation and/or other materials provided with the distribution. |
| 13 * | 13 * |
| 14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
| 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
| 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "sky/engine/config.h" | 27 #include "sky/engine/config.h" |
| 28 #include "sky/engine/core/editing/VisiblePosition.h" | 28 #include "sky/engine/core/editing/VisiblePosition.h" |
| 29 | 29 |
| 30 #include "sky/engine/bindings/core/v8/ExceptionState.h" | 30 #include "sky/engine/bindings2/exception_state.h" |
| 31 #include "sky/engine/core/dom/Document.h" | 31 #include "sky/engine/core/dom/Document.h" |
| 32 #include "sky/engine/core/dom/Range.h" | 32 #include "sky/engine/core/dom/Range.h" |
| 33 #include "sky/engine/core/dom/Text.h" | 33 #include "sky/engine/core/dom/Text.h" |
| 34 #include "sky/engine/core/editing/VisibleUnits.h" | 34 #include "sky/engine/core/editing/VisibleUnits.h" |
| 35 #include "sky/engine/core/editing/htmlediting.h" | 35 #include "sky/engine/core/editing/htmlediting.h" |
| 36 #include "sky/engine/core/html/HTMLElement.h" | 36 #include "sky/engine/core/html/HTMLElement.h" |
| 37 #include "sky/engine/core/rendering/RenderBlock.h" | 37 #include "sky/engine/core/rendering/RenderBlock.h" |
| 38 #include "sky/engine/core/rendering/RootInlineBox.h" | 38 #include "sky/engine/core/rendering/RootInlineBox.h" |
| 39 #include "sky/engine/platform/geometry/FloatQuad.h" | 39 #include "sky/engine/platform/geometry/FloatQuad.h" |
| 40 #include "sky/engine/wtf/text/CString.h" | 40 #include "sky/engine/wtf/text/CString.h" |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 return VisiblePosition(r->startPosition(), affinity); | 715 return VisiblePosition(r->startPosition(), affinity); |
| 716 } | 716 } |
| 717 | 717 |
| 718 bool setStart(Range *r, const VisiblePosition &visiblePosition) | 718 bool setStart(Range *r, const VisiblePosition &visiblePosition) |
| 719 { | 719 { |
| 720 if (!r) | 720 if (!r) |
| 721 return false; | 721 return false; |
| 722 Position p = visiblePosition.deepEquivalent().parentAnchoredEquivalent(); | 722 Position p = visiblePosition.deepEquivalent().parentAnchoredEquivalent(); |
| 723 TrackExceptionState exceptionState; | 723 TrackExceptionState exceptionState; |
| 724 r->setStart(p.containerNode(), p.offsetInContainerNode(), exceptionState); | 724 r->setStart(p.containerNode(), p.offsetInContainerNode(), exceptionState); |
| 725 return !exceptionState.hadException(); | 725 return !exceptionState.had_exception(); |
| 726 } | 726 } |
| 727 | 727 |
| 728 bool setEnd(Range *r, const VisiblePosition &visiblePosition) | 728 bool setEnd(Range *r, const VisiblePosition &visiblePosition) |
| 729 { | 729 { |
| 730 if (!r) | 730 if (!r) |
| 731 return false; | 731 return false; |
| 732 Position p = visiblePosition.deepEquivalent().parentAnchoredEquivalent(); | 732 Position p = visiblePosition.deepEquivalent().parentAnchoredEquivalent(); |
| 733 TrackExceptionState exceptionState; | 733 TrackExceptionState exceptionState; |
| 734 r->setEnd(p.containerNode(), p.offsetInContainerNode(), exceptionState); | 734 r->setEnd(p.containerNode(), p.offsetInContainerNode(), exceptionState); |
| 735 return !exceptionState.hadException(); | 735 return !exceptionState.had_exception(); |
| 736 } | 736 } |
| 737 | 737 |
| 738 Element* enclosingBlockFlowElement(const VisiblePosition& visiblePosition) | 738 Element* enclosingBlockFlowElement(const VisiblePosition& visiblePosition) |
| 739 { | 739 { |
| 740 if (visiblePosition.isNull()) | 740 if (visiblePosition.isNull()) |
| 741 return 0; | 741 return 0; |
| 742 | 742 |
| 743 return enclosingBlockFlowElement(*visiblePosition.deepEquivalent().deprecate
dNode()); | 743 return enclosingBlockFlowElement(*visiblePosition.deepEquivalent().deprecate
dNode()); |
| 744 } | 744 } |
| 745 | 745 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 776 if (vpos) | 776 if (vpos) |
| 777 vpos->showTreeForThis(); | 777 vpos->showTreeForThis(); |
| 778 } | 778 } |
| 779 | 779 |
| 780 void showTree(const blink::VisiblePosition& vpos) | 780 void showTree(const blink::VisiblePosition& vpos) |
| 781 { | 781 { |
| 782 vpos.showTreeForThis(); | 782 vpos.showTreeForThis(); |
| 783 } | 783 } |
| 784 | 784 |
| 785 #endif | 785 #endif |
| OLD | NEW |