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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 | 966 |
967 // FIXME: Shouldn't these functions be in the editing code? Code that asks ques
tions about HTML in the core DOM class | 967 // FIXME: Shouldn't these functions be in the editing code? Code that asks ques
tions about HTML in the core DOM class |
968 // is obviously misplaced. | 968 // is obviously misplaced. |
969 bool Node::canStartSelection() const | 969 bool Node::canStartSelection() const |
970 { | 970 { |
971 if (hasEditableStyle()) | 971 if (hasEditableStyle()) |
972 return true; | 972 return true; |
973 | 973 |
974 if (layoutObject()) { | 974 if (layoutObject()) { |
975 const ComputedStyle& style = layoutObject()->styleRef(); | 975 const ComputedStyle& style = layoutObject()->styleRef(); |
976 // We allow selections to begin within an element that has -webkit-user-
select: none set, | 976 // We don't allow selections to begin within an element that has |
977 // but if the element is draggable then dragging should take priority ov
er selection. | 977 // -webkit-user-select: none set, |
978 if (style.userDrag() == DRAG_ELEMENT && style.userSelect() == SELECT_NON
E) | 978 // https://drafts.csswg.org/css-ui-4/#valdef-user-select-none |
| 979 if (style.userSelect() == SELECT_NONE) |
979 return false; | 980 return false; |
980 } | 981 } |
981 ContainerNode* parent = FlatTreeTraversal::parent(*this); | 982 ContainerNode* parent = FlatTreeTraversal::parent(*this); |
982 return parent ? parent->canStartSelection() : true; | 983 return parent ? parent->canStartSelection() : true; |
983 } | 984 } |
984 | 985 |
985 bool Node::canParticipateInFlatTree() const | 986 bool Node::canParticipateInFlatTree() const |
986 { | 987 { |
987 return !isShadowRoot() && !isSlotOrActiveInsertionPoint(); | 988 return !isShadowRoot() && !isSlotOrActiveInsertionPoint(); |
988 } | 989 } |
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2474 | 2475 |
2475 void showNodePath(const blink::Node* node) | 2476 void showNodePath(const blink::Node* node) |
2476 { | 2477 { |
2477 if (node) | 2478 if (node) |
2478 node->showNodePathForThis(); | 2479 node->showNodePathForThis(); |
2479 else | 2480 else |
2480 fprintf(stderr, "Cannot showNodePath for (nil)\n"); | 2481 fprintf(stderr, "Cannot showNodePath for (nil)\n"); |
2481 } | 2482 } |
2482 | 2483 |
2483 #endif | 2484 #endif |
OLD | NEW |