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

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: Updated change after Doug's review. 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
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/NodeLayoutStyle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 } 1033 }
1034 1034
1035 // FIXME: Shouldn't these functions be in the editing code? Code that asks ques tions about HTML in the core DOM class 1035 // FIXME: Shouldn't these functions be in the editing code? Code that asks ques tions about HTML in the core DOM class
1036 // is obviously misplaced. 1036 // is obviously misplaced.
1037 bool Node::canStartSelection() const 1037 bool Node::canStartSelection() const
1038 { 1038 {
1039 if (hasEditableStyle()) 1039 if (hasEditableStyle())
1040 return true; 1040 return true;
1041 1041
1042 if (renderer()) { 1042 if (renderer()) {
1043 LayoutStyle* style = renderer()->style(); 1043 const LayoutStyle& style = renderer()->styleRef();
1044 // We allow selections to begin within an element that has -webkit-user- select: none set, 1044 // We allow selections to begin within an element that has -webkit-user- select: none set,
1045 // but if the element is draggable then dragging should take priority ov er selection. 1045 // but if the element is draggable then dragging should take priority ov er selection.
1046 if (style->userDrag() == DRAG_ELEMENT && style->userSelect() == SELECT_N ONE) 1046 if (style.userDrag() == DRAG_ELEMENT && style.userSelect() == SELECT_NON E)
1047 return false; 1047 return false;
1048 } 1048 }
1049 return parentOrShadowHostNode() ? parentOrShadowHostNode()->canStartSelectio n() : true; 1049 return parentOrShadowHostNode() ? parentOrShadowHostNode()->canStartSelectio n() : true;
1050 } 1050 }
1051 1051
1052 bool Node::canParticipateInComposedTree() const 1052 bool Node::canParticipateInComposedTree() const
1053 { 1053 {
1054 return !isShadowRoot() && !isActiveInsertionPoint(*this); 1054 return !isShadowRoot() && !isActiveInsertionPoint(*this);
1055 } 1055 }
1056 1056
(...skipping 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after
2438 node->showTreeForThis(); 2438 node->showTreeForThis();
2439 } 2439 }
2440 2440
2441 void showNodePath(const blink::Node* node) 2441 void showNodePath(const blink::Node* node)
2442 { 2442 {
2443 if (node) 2443 if (node)
2444 node->showNodePathForThis(); 2444 node->showNodePathForThis();
2445 } 2445 }
2446 2446
2447 #endif 2447 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/NodeLayoutStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698