| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) | 3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) |
| 4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) | 4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) |
| 5 * (C) 2001 Peter Kelly (pmk@post.com) | 5 * (C) 2001 Peter Kelly (pmk@post.com) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 7 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 inline Range::Range(Document& ownerDocument) | 57 inline Range::Range(Document& ownerDocument) |
| 58 : m_ownerDocument(&ownerDocument) | 58 : m_ownerDocument(&ownerDocument) |
| 59 , m_start(m_ownerDocument) | 59 , m_start(m_ownerDocument) |
| 60 , m_end(m_ownerDocument) | 60 , m_end(m_ownerDocument) |
| 61 { | 61 { |
| 62 #ifndef NDEBUG | 62 #ifndef NDEBUG |
| 63 rangeCounter.increment(); | 63 rangeCounter.increment(); |
| 64 #endif | 64 #endif |
| 65 | 65 |
| 66 ScriptWrappable::init(this); | |
| 67 m_ownerDocument->attachRange(this); | 66 m_ownerDocument->attachRange(this); |
| 68 } | 67 } |
| 69 | 68 |
| 70 PassRefPtr<Range> Range::create(Document& ownerDocument) | 69 PassRefPtr<Range> Range::create(Document& ownerDocument) |
| 71 { | 70 { |
| 72 return adoptRef(new Range(ownerDocument)); | 71 return adoptRef(new Range(ownerDocument)); |
| 73 } | 72 } |
| 74 | 73 |
| 75 inline Range::Range(Document& ownerDocument, Node* startContainer, int startOffs
et, Node* endContainer, int endOffset) | 74 inline Range::Range(Document& ownerDocument, Node* startContainer, int startOffs
et, Node* endContainer, int endOffset) |
| 76 : m_ownerDocument(&ownerDocument) | 75 : m_ownerDocument(&ownerDocument) |
| 77 , m_start(m_ownerDocument) | 76 , m_start(m_ownerDocument) |
| 78 , m_end(m_ownerDocument) | 77 , m_end(m_ownerDocument) |
| 79 { | 78 { |
| 80 #ifndef NDEBUG | 79 #ifndef NDEBUG |
| 81 rangeCounter.increment(); | 80 rangeCounter.increment(); |
| 82 #endif | 81 #endif |
| 83 | 82 |
| 84 ScriptWrappable::init(this); | |
| 85 m_ownerDocument->attachRange(this); | 83 m_ownerDocument->attachRange(this); |
| 86 | 84 |
| 87 // Simply setting the containers and offsets directly would not do any of th
e checking | 85 // Simply setting the containers and offsets directly would not do any of th
e checking |
| 88 // that setStart and setEnd do, so we call those functions. | 86 // that setStart and setEnd do, so we call those functions. |
| 89 setStart(startContainer, startOffset); | 87 setStart(startContainer, startOffset); |
| 90 setEnd(endContainer, endOffset); | 88 setEnd(endContainer, endOffset); |
| 91 } | 89 } |
| 92 | 90 |
| 93 PassRefPtr<Range> Range::create(Document& ownerDocument, Node* startContainer, i
nt startOffset, Node* endContainer, int endOffset) | 91 PassRefPtr<Range> Range::create(Document& ownerDocument, Node* startContainer, i
nt startOffset, Node* endContainer, int endOffset) |
| 94 { | 92 { |
| (...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1542 | 1540 |
| 1543 void showTree(const blink::Range* range) | 1541 void showTree(const blink::Range* range) |
| 1544 { | 1542 { |
| 1545 if (range && range->boundaryPointsValid()) { | 1543 if (range && range->boundaryPointsValid()) { |
| 1546 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); | 1544 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); |
| 1547 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); | 1545 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); |
| 1548 } | 1546 } |
| 1549 } | 1547 } |
| 1550 | 1548 |
| 1551 #endif | 1549 #endif |
| OLD | NEW |