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

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

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed web/mac/WebSubstringUtil.mm Created 5 years, 10 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 | Annotate | Revision Log
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 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 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 } 1029 }
1030 1030
1031 // FIXME: Shouldn't these functions be in the editing code? Code that asks ques tions about HTML in the core DOM class 1031 // FIXME: Shouldn't these functions be in the editing code? Code that asks ques tions about HTML in the core DOM class
1032 // is obviously misplaced. 1032 // is obviously misplaced.
1033 bool Node::canStartSelection() const 1033 bool Node::canStartSelection() const
1034 { 1034 {
1035 if (hasEditableStyle()) 1035 if (hasEditableStyle())
1036 return true; 1036 return true;
1037 1037
1038 if (renderer()) { 1038 if (renderer()) {
1039 LayoutStyle* style = renderer()->style(); 1039 const LayoutStyle& style = renderer()->styleRef();
1040 // We allow selections to begin within an element that has -webkit-user- select: none set, 1040 // We allow selections to begin within an element that has -webkit-user- select: none set,
1041 // but if the element is draggable then dragging should take priority ov er selection. 1041 // but if the element is draggable then dragging should take priority ov er selection.
1042 if (style->userDrag() == DRAG_ELEMENT && style->userSelect() == SELECT_N ONE) 1042 if (style.userDrag() == DRAG_ELEMENT && style.userSelect() == SELECT_NON E)
1043 return false; 1043 return false;
1044 } 1044 }
1045 return parentOrShadowHostNode() ? parentOrShadowHostNode()->canStartSelectio n() : true; 1045 return parentOrShadowHostNode() ? parentOrShadowHostNode()->canStartSelectio n() : true;
1046 } 1046 }
1047 1047
1048 bool Node::canParticipateInComposedTree() const 1048 bool Node::canParticipateInComposedTree() const
1049 { 1049 {
1050 return !isShadowRoot() && !isActiveInsertionPoint(*this); 1050 return !isShadowRoot() && !isActiveInsertionPoint(*this);
1051 } 1051 }
1052 1052
(...skipping 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after
2434 node->showTreeForThis(); 2434 node->showTreeForThis();
2435 } 2435 }
2436 2436
2437 void showNodePath(const blink::Node* node) 2437 void showNodePath(const blink::Node* node)
2438 { 2438 {
2439 if (node) 2439 if (node)
2440 node->showNodePathForThis(); 2440 node->showNodePathForThis();
2441 } 2441 }
2442 2442
2443 #endif 2443 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698