| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 if (!node->isInShadowTree()) | 57 if (!node->isInShadowTree()) |
| 58 return 0; | 58 return 0; |
| 59 | 59 |
| 60 return frame->document()->ancestorInThisScope(node); | 60 return frame->document()->ancestorInThisScope(node); |
| 61 } | 61 } |
| 62 | 62 |
| 63 DOMSelection::DOMSelection(const TreeScope* treeScope) | 63 DOMSelection::DOMSelection(const TreeScope* treeScope) |
| 64 : DOMWindowProperty(treeScope->rootNode().document().frame()) | 64 : DOMWindowProperty(treeScope->rootNode().document().frame()) |
| 65 , m_treeScope(treeScope) | 65 , m_treeScope(treeScope) |
| 66 { | 66 { |
| 67 ScriptWrappable::init(this); | |
| 68 } | 67 } |
| 69 | 68 |
| 70 void DOMSelection::clearTreeScope() | 69 void DOMSelection::clearTreeScope() |
| 71 { | 70 { |
| 72 m_treeScope = nullptr; | 71 m_treeScope = nullptr; |
| 73 } | 72 } |
| 74 | 73 |
| 75 const VisibleSelection& DOMSelection::visibleSelection() const | 74 const VisibleSelection& DOMSelection::visibleSelection() const |
| 76 { | 75 { |
| 77 ASSERT(m_frame); | 76 ASSERT(m_frame); |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 return node->document() == m_frame->document(); | 547 return node->document() == m_frame->document(); |
| 549 } | 548 } |
| 550 | 549 |
| 551 void DOMSelection::addConsoleError(const String& message) | 550 void DOMSelection::addConsoleError(const String& message) |
| 552 { | 551 { |
| 553 if (m_treeScope) | 552 if (m_treeScope) |
| 554 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa
geSource, ErrorMessageLevel, message)); | 553 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa
geSource, ErrorMessageLevel, message)); |
| 555 } | 554 } |
| 556 | 555 |
| 557 } // namespace blink | 556 } // namespace blink |
| OLD | NEW |