| 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 | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 7 * rights reserved. | 7 * rights reserved. |
| 8 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 8 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| 11 * modify it under the terms of the GNU Library General Public | 11 * modify it under the terms of the GNU Library General Public |
| 12 * License as published by the Free Software Foundation; either | 12 * License as published by the Free Software Foundation; either |
| 13 * version 2 of the License, or (at your option) any later version. | 13 * version 2 of the License, or (at your option) any later version. |
| 14 * | 14 * |
| 15 * This library is distributed in the hope that it will be useful, | 15 * This library is distributed in the hope that it will be useful, |
| 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 18 * Library General Public License for more details. | 18 * Library General Public License for more details. |
| 19 * | 19 * |
| 20 * You should have received a copy of the GNU Library General Public License | 20 * You should have received a copy of the GNU Library General Public License |
| 21 * along with this library; see the file COPYING.LIB. If not, write to | 21 * along with this library; see the file COPYING.LIB. If not, write to |
| 22 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 22 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 23 * Boston, MA 02110-1301, USA. | 23 * Boston, MA 02110-1301, USA. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "core/dom/Range.h" | 26 #include "core/dom/Range.h" |
| 27 | 27 |
| 28 #include "bindings/core/v8/ExceptionState.h" | 28 #include "bindings/core/v8/ExceptionState.h" |
| 29 #include "core/dom/CharacterData.h" | 29 #include "core/dom/CharacterData.h" |
| 30 #include "core/dom/ClientRect.h" | |
| 31 #include "core/dom/ClientRectList.h" | 30 #include "core/dom/ClientRectList.h" |
| 32 #include "core/dom/ContainerNode.h" | 31 #include "core/dom/ContainerNode.h" |
| 33 #include "core/dom/DocumentFragment.h" | 32 #include "core/dom/DocumentFragment.h" |
| 34 #include "core/dom/ExceptionCode.h" | 33 #include "core/dom/ExceptionCode.h" |
| 35 #include "core/dom/Node.h" | 34 #include "core/dom/Node.h" |
| 36 #include "core/dom/NodeTraversal.h" | 35 #include "core/dom/NodeTraversal.h" |
| 37 #include "core/dom/NodeWithIndex.h" | 36 #include "core/dom/NodeWithIndex.h" |
| 38 #include "core/dom/ProcessingInstruction.h" | 37 #include "core/dom/ProcessingInstruction.h" |
| 39 #include "core/dom/Text.h" | 38 #include "core/dom/Text.h" |
| 40 #include "core/editing/EditingUtilities.h" | 39 #include "core/editing/EditingUtilities.h" |
| 41 #include "core/editing/EphemeralRange.h" | 40 #include "core/editing/EphemeralRange.h" |
| 42 #include "core/editing/FrameSelection.h" | 41 #include "core/editing/FrameSelection.h" |
| 43 #include "core/editing/VisiblePosition.h" | 42 #include "core/editing/VisiblePosition.h" |
| 44 #include "core/editing/VisibleUnits.h" | 43 #include "core/editing/VisibleUnits.h" |
| 45 #include "core/editing/iterators/TextIterator.h" | 44 #include "core/editing/iterators/TextIterator.h" |
| 46 #include "core/editing/serializers/Serialization.h" | 45 #include "core/editing/serializers/Serialization.h" |
| 47 #include "core/events/ScopedEventQueue.h" | 46 #include "core/events/ScopedEventQueue.h" |
| 48 #include "core/frame/Settings.h" | 47 #include "core/frame/Settings.h" |
| 48 #include "core/geometry/DOMRect.h" |
| 49 #include "core/html/HTMLBodyElement.h" | 49 #include "core/html/HTMLBodyElement.h" |
| 50 #include "core/html/HTMLElement.h" | 50 #include "core/html/HTMLElement.h" |
| 51 #include "core/layout/LayoutObject.h" | 51 #include "core/layout/LayoutObject.h" |
| 52 #include "core/layout/LayoutText.h" | 52 #include "core/layout/LayoutText.h" |
| 53 #include "core/svg/SVGSVGElement.h" | 53 #include "core/svg/SVGSVGElement.h" |
| 54 #include "platform/EventDispatchForbiddenScope.h" | 54 #include "platform/EventDispatchForbiddenScope.h" |
| 55 #include "platform/geometry/FloatQuad.h" | 55 #include "platform/geometry/FloatQuad.h" |
| 56 #include "platform/wtf/text/CString.h" | 56 #include "platform/wtf/text/CString.h" |
| 57 #include "platform/wtf/text/StringBuilder.h" | 57 #include "platform/wtf/text/StringBuilder.h" |
| 58 #ifndef NDEBUG | 58 #ifndef NDEBUG |
| (...skipping 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1598 | 1598 |
| 1599 ClientRectList* Range::getClientRects() const { | 1599 ClientRectList* Range::getClientRects() const { |
| 1600 owner_document_->UpdateStyleAndLayoutIgnorePendingStylesheets(); | 1600 owner_document_->UpdateStyleAndLayoutIgnorePendingStylesheets(); |
| 1601 | 1601 |
| 1602 Vector<FloatQuad> quads; | 1602 Vector<FloatQuad> quads; |
| 1603 GetBorderAndTextQuads(quads); | 1603 GetBorderAndTextQuads(quads); |
| 1604 | 1604 |
| 1605 return ClientRectList::Create(quads); | 1605 return ClientRectList::Create(quads); |
| 1606 } | 1606 } |
| 1607 | 1607 |
| 1608 ClientRect* Range::getBoundingClientRect() const { | 1608 DOMRect* Range::getBoundingClientRect() const { |
| 1609 return ClientRect::Create(BoundingRect()); | 1609 return DOMRect::Create(BoundingRect()); |
| 1610 } | 1610 } |
| 1611 | 1611 |
| 1612 void Range::GetBorderAndTextQuads(Vector<FloatQuad>& quads) const { | 1612 void Range::GetBorderAndTextQuads(Vector<FloatQuad>& quads) const { |
| 1613 Node* start_container = &start_.Container(); | 1613 Node* start_container = &start_.Container(); |
| 1614 Node* end_container = &end_.Container(); | 1614 Node* end_container = &end_.Container(); |
| 1615 Node* stop_node = PastLastNode(); | 1615 Node* stop_node = PastLastNode(); |
| 1616 | 1616 |
| 1617 HeapHashSet<Member<Node>> node_set; | 1617 HeapHashSet<Member<Node>> node_set; |
| 1618 for (Node* node = FirstNode(); node != stop_node; | 1618 for (Node* node = FirstNode(); node != stop_node; |
| 1619 node = NodeTraversal::Next(*node)) { | 1619 node = NodeTraversal::Next(*node)) { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1729 .data() | 1729 .data() |
| 1730 << "start offset: " << range->startOffset() | 1730 << "start offset: " << range->startOffset() |
| 1731 << ", end offset: " << range->endOffset(); | 1731 << ", end offset: " << range->endOffset(); |
| 1732 } else { | 1732 } else { |
| 1733 LOG(INFO) << "Cannot show tree if range is null, or if boundary points are " | 1733 LOG(INFO) << "Cannot show tree if range is null, or if boundary points are " |
| 1734 "invalid."; | 1734 "invalid."; |
| 1735 } | 1735 } |
| 1736 } | 1736 } |
| 1737 | 1737 |
| 1738 #endif | 1738 #endif |
| OLD | NEW |