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

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

Issue 2121313003: [Editing][DOM][CodeHealth] Make Node::isContentEditable and Node::isRichEditable global functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Node.cpp » ('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-2011, 2014 Apple Inc. All rights reserved. 5 * Copyright (C) 2004-2011, 2014 Apple Inc. All rights reserved.
6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 virtual short tabIndex() const; 409 virtual short tabIndex() const;
410 410
411 virtual Node* focusDelegate(); 411 virtual Node* focusDelegate();
412 // This is called only when the node is focused. 412 // This is called only when the node is focused.
413 virtual bool shouldHaveFocusAppearance() const; 413 virtual bool shouldHaveFocusAppearance() const;
414 414
415 // Whether the node is inert. This can't be in Element because text nodes 415 // Whether the node is inert. This can't be in Element because text nodes
416 // must be recognized as inert to prevent text selection. 416 // must be recognized as inert to prevent text selection.
417 bool isInert() const; 417 bool isInert() const;
418 418
419 bool isContentEditable() const;
420 bool isContentRichlyEditable() const;
421
422 virtual LayoutRect boundingBox() const; 419 virtual LayoutRect boundingBox() const;
423 IntRect pixelSnappedBoundingBox() const { return pixelSnappedIntRect(boundin gBox()); } 420 IntRect pixelSnappedBoundingBox() const { return pixelSnappedIntRect(boundin gBox()); }
424 421
425 unsigned nodeIndex() const; 422 unsigned nodeIndex() const;
426 423
427 // Returns the DOM ownerDocument attribute. This method never returns null, except in the case 424 // Returns the DOM ownerDocument attribute. This method never returns null, except in the case
428 // of a Document node. 425 // of a Document node.
429 Document* ownerDocument() const; 426 Document* ownerDocument() const;
430 427
431 // Returns the document associated with this node. A Document node returns i tself. 428 // Returns the document associated with this node. A Document node returns i tself.
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 { 853 {
857 return node; 854 return node;
858 } 855 }
859 856
860 // TODO(yoichio): Move to core/editing 857 // TODO(yoichio): Move to core/editing
861 CORE_EXPORT bool isRootEditableElement(const Node&); 858 CORE_EXPORT bool isRootEditableElement(const Node&);
862 CORE_EXPORT Element* rootEditableElement(const Node&); 859 CORE_EXPORT Element* rootEditableElement(const Node&);
863 CORE_EXPORT Element* rootEditableElement(const Node&, EditableType); 860 CORE_EXPORT Element* rootEditableElement(const Node&, EditableType);
864 CORE_EXPORT bool hasEditableStyle(const Node&, EditableType = ContentIsEditable) ; 861 CORE_EXPORT bool hasEditableStyle(const Node&, EditableType = ContentIsEditable) ;
865 CORE_EXPORT bool layoutObjectIsRichlyEditable(const Node&, EditableType = Conten tIsEditable); 862 CORE_EXPORT bool layoutObjectIsRichlyEditable(const Node&, EditableType = Conten tIsEditable);
863 CORE_EXPORT bool isContentEditable(const Node&);
864 CORE_EXPORT bool isContentRichlyEditable(const Node&);
866 865
867 // Allow equality comparisons of Nodes by reference or pointer, interchangeably. 866 // Allow equality comparisons of Nodes by reference or pointer, interchangeably.
868 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Node) 867 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Node)
869 868
870 869
871 #define DEFINE_NODE_TYPE_CASTS(thisType, predicate) \ 870 #define DEFINE_NODE_TYPE_CASTS(thisType, predicate) \
872 template<typename T> inline thisType* to##thisType(const RefPtr<T>& node) { return to##thisType(node.get()); } \ 871 template<typename T> inline thisType* to##thisType(const RefPtr<T>& node) { return to##thisType(node.get()); } \
873 DEFINE_TYPE_CASTS(thisType, Node, node, node->predicate, node.predicate) 872 DEFINE_TYPE_CASTS(thisType, Node, node, node->predicate, node.predicate)
874 873
875 // This requires isClassName(const Node&). 874 // This requires isClassName(const Node&).
(...skipping 15 matching lines...) Expand all
891 } // namespace blink 890 } // namespace blink
892 891
893 #ifndef NDEBUG 892 #ifndef NDEBUG
894 // Outside the WebCore namespace for ease of invocation from gdb. 893 // Outside the WebCore namespace for ease of invocation from gdb.
895 void showNode(const blink::Node*); 894 void showNode(const blink::Node*);
896 void showTree(const blink::Node*); 895 void showTree(const blink::Node*);
897 void showNodePath(const blink::Node*); 896 void showNodePath(const blink::Node*);
898 #endif 897 #endif
899 898
900 #endif // Node_h 899 #endif // Node_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698