Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Side by Side Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 2882093002: Make EUserSelect an enum class. (Closed)
Patch Set: Rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 // questions about HTML in the core DOM class is obviously misplaced. 1040 // questions about HTML in the core DOM class is obviously misplaced.
1041 bool Node::CanStartSelection() const { 1041 bool Node::CanStartSelection() const {
1042 if (HasEditableStyle(*this)) 1042 if (HasEditableStyle(*this))
1043 return true; 1043 return true;
1044 1044
1045 if (GetLayoutObject()) { 1045 if (GetLayoutObject()) {
1046 const ComputedStyle& style = GetLayoutObject()->StyleRef(); 1046 const ComputedStyle& style = GetLayoutObject()->StyleRef();
1047 // We allow selections to begin within an element that has 1047 // We allow selections to begin within an element that has
1048 // -webkit-user-select: none set, but if the element is draggable then 1048 // -webkit-user-select: none set, but if the element is draggable then
1049 // dragging should take priority over selection. 1049 // dragging should take priority over selection.
1050 if (style.UserDrag() == DRAG_ELEMENT && style.UserSelect() == SELECT_NONE) 1050 if (style.UserDrag() == DRAG_ELEMENT &&
1051 style.UserSelect() == EUserSelect::kNone)
1051 return false; 1052 return false;
1052 } 1053 }
1053 ContainerNode* parent = FlatTreeTraversal::Parent(*this); 1054 ContainerNode* parent = FlatTreeTraversal::Parent(*this);
1054 return parent ? parent->CanStartSelection() : true; 1055 return parent ? parent->CanStartSelection() : true;
1055 } 1056 }
1056 1057
1057 // StyledElements allow inline style (style="border: 1px"), presentational 1058 // StyledElements allow inline style (style="border: 1px"), presentational
1058 // attributes (ex. color), class names (ex. class="foo bar") and other non-basic 1059 // attributes (ex. color), class names (ex. class="foo bar") and other non-basic
1059 // styling features. They also control if this element can participate in style 1060 // styling features. They also control if this element can participate in style
1060 // sharing. 1061 // sharing.
(...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after
2622 if (node) { 2623 if (node) {
2623 std::stringstream stream; 2624 std::stringstream stream;
2624 node->PrintNodePathTo(stream); 2625 node->PrintNodePathTo(stream);
2625 LOG(INFO) << stream.str(); 2626 LOG(INFO) << stream.str();
2626 } else { 2627 } else {
2627 LOG(INFO) << "Cannot showNodePath for <null>"; 2628 LOG(INFO) << "Cannot showNodePath for <null>";
2628 } 2629 }
2629 } 2630 }
2630 2631
2631 #endif 2632 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698