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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 DOMSelection::DOMSelection(const TreeScope* treeScope) | 62 DOMSelection::DOMSelection(const TreeScope* treeScope) |
63 : DOMWindowProperty(treeScope->rootNode().document().frame()) | 63 : DOMWindowProperty(treeScope->rootNode().document().frame()) |
64 , m_treeScope(treeScope) | 64 , m_treeScope(treeScope) |
65 { | 65 { |
66 ScriptWrappable::init(this); | 66 ScriptWrappable::init(this); |
67 } | 67 } |
68 | 68 |
69 void DOMSelection::clearTreeScope() | 69 void DOMSelection::clearTreeScope() |
70 { | 70 { |
71 m_treeScope = 0; | 71 m_treeScope = nullptr; |
72 } | 72 } |
73 | 73 |
74 const VisibleSelection& DOMSelection::visibleSelection() const | 74 const VisibleSelection& DOMSelection::visibleSelection() const |
75 { | 75 { |
76 ASSERT(m_frame); | 76 ASSERT(m_frame); |
77 return m_frame->selection().selection(); | 77 return m_frame->selection().selection(); |
78 } | 78 } |
79 | 79 |
80 static Position anchorPosition(const VisibleSelection& selection) | 80 static Position anchorPosition(const VisibleSelection& selection) |
81 { | 81 { |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 return node->document() == m_frame->document(); | 550 return node->document() == m_frame->document(); |
551 } | 551 } |
552 | 552 |
553 void DOMSelection::addConsoleError(const String& message) | 553 void DOMSelection::addConsoleError(const String& message) |
554 { | 554 { |
555 if (m_treeScope) | 555 if (m_treeScope) |
556 m_treeScope->document().addConsoleMessage(JSMessageSource, ErrorMessageL
evel, message); | 556 m_treeScope->document().addConsoleMessage(JSMessageSource, ErrorMessageL
evel, message); |
557 } | 557 } |
558 | 558 |
559 } // namespace WebCore | 559 } // namespace WebCore |
OLD | NEW |