OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google 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 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "core/dom/Range.h" | 40 #include "core/dom/Range.h" |
41 #include "core/dom/TreeScope.h" | 41 #include "core/dom/TreeScope.h" |
42 #include "core/editing/FrameSelection.h" | 42 #include "core/editing/FrameSelection.h" |
43 #include "core/editing/TextIterator.h" | 43 #include "core/editing/TextIterator.h" |
44 #include "core/editing/htmlediting.h" | 44 #include "core/editing/htmlediting.h" |
45 #include "core/frame/Frame.h" | 45 #include "core/frame/Frame.h" |
46 #include "wtf/text/WTFString.h" | 46 #include "wtf/text/WTFString.h" |
47 | 47 |
48 namespace WebCore { | 48 namespace WebCore { |
49 | 49 |
50 DEFINE_GC_INFO(DOMSelection); | |
51 | |
52 static Node* selectionShadowAncestor(Frame* frame) | 50 static Node* selectionShadowAncestor(Frame* frame) |
53 { | 51 { |
54 Node* node = frame->selection().selection().base().anchorNode(); | 52 Node* node = frame->selection().selection().base().anchorNode(); |
55 if (!node) | 53 if (!node) |
56 return 0; | 54 return 0; |
57 | 55 |
58 if (!node->isInShadowTree()) | 56 if (!node->isInShadowTree()) |
59 return 0; | 57 return 0; |
60 | 58 |
61 return frame->document()->ancestorInThisScope(node); | 59 return frame->document()->ancestorInThisScope(node); |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 | 530 |
533 bool DOMSelection::isValidForPosition(Node* node) const | 531 bool DOMSelection::isValidForPosition(Node* node) const |
534 { | 532 { |
535 ASSERT(m_frame); | 533 ASSERT(m_frame); |
536 if (!node) | 534 if (!node) |
537 return true; | 535 return true; |
538 return node->document() == m_frame->document(); | 536 return node->document() == m_frame->document(); |
539 } | 537 } |
540 | 538 |
541 } // namespace WebCore | 539 } // namespace WebCore |
OLD | NEW |