| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 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 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 return 0; | 812 return 0; |
| 813 } | 813 } |
| 814 | 814 |
| 815 // FIXME: Shouldn't these functions be in the editing code? Code that asks ques
tions about HTML in the core DOM class | 815 // FIXME: Shouldn't these functions be in the editing code? Code that asks ques
tions about HTML in the core DOM class |
| 816 // is obviously misplaced. | 816 // is obviously misplaced. |
| 817 bool Node::canStartSelection() const | 817 bool Node::canStartSelection() const |
| 818 { | 818 { |
| 819 if (hasEditableStyle()) | 819 if (hasEditableStyle()) |
| 820 return true; | 820 return true; |
| 821 | 821 |
| 822 if (renderer()) { | |
| 823 RenderStyle* style = renderer()->style(); | |
| 824 // We allow selections to begin within an element that has -webkit-user-
select: none set, | |
| 825 // but if the element is draggable then dragging should take priority ov
er selection. | |
| 826 if (style->userDrag() == DRAG_ELEMENT && style->userSelect() == SELECT_N
ONE) | |
| 827 return false; | |
| 828 } | |
| 829 return parentOrShadowHostNode() ? parentOrShadowHostNode()->canStartSelectio
n() : true; | 822 return parentOrShadowHostNode() ? parentOrShadowHostNode()->canStartSelectio
n() : true; |
| 830 } | 823 } |
| 831 | 824 |
| 832 Element* Node::shadowHost() const | 825 Element* Node::shadowHost() const |
| 833 { | 826 { |
| 834 if (ShadowRoot* root = containingShadowRoot()) | 827 if (ShadowRoot* root = containingShadowRoot()) |
| 835 return root->host(); | 828 return root->host(); |
| 836 return 0; | 829 return 0; |
| 837 } | 830 } |
| 838 | 831 |
| (...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1662 node->showTreeForThis(); | 1655 node->showTreeForThis(); |
| 1663 } | 1656 } |
| 1664 | 1657 |
| 1665 void showNodePath(const blink::Node* node) | 1658 void showNodePath(const blink::Node* node) |
| 1666 { | 1659 { |
| 1667 if (node) | 1660 if (node) |
| 1668 node->showNodePathForThis(); | 1661 node->showNodePathForThis(); |
| 1669 } | 1662 } |
| 1670 | 1663 |
| 1671 #endif | 1664 #endif |
| OLD | NEW |