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

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

Issue 2140733003: [Editing][CodeHealth] Make Node::rootEditableElement static (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 328
329 // Returns the enclosing event parent Element (or self) that, when clicked, would trigger a navigation. 329 // Returns the enclosing event parent Element (or self) that, when clicked, would trigger a navigation.
330 Element* enclosingLinkEventParentOrSelf() const; 330 Element* enclosingLinkEventParentOrSelf() const;
331 331
332 // These low-level calls give the caller responsibility for maintaining the integrity of the tree. 332 // These low-level calls give the caller responsibility for maintaining the integrity of the tree.
333 void setPreviousSibling(Node* previous) { m_previous = previous; } 333 void setPreviousSibling(Node* previous) { m_previous = previous; }
334 void setNextSibling(Node* next) { m_next = next; } 334 void setNextSibling(Node* next) { m_next = next; }
335 335
336 virtual bool canContainRangeEndPoint() const { return false; } 336 virtual bool canContainRangeEndPoint() const { return false; }
337 337
338 bool isRootEditableElement() const;
339 Element* rootEditableElement() const;
340 Element* rootEditableElement(EditableType) const;
341
342 // For <link> and <style> elements. 338 // For <link> and <style> elements.
343 virtual bool sheetLoaded() { return true; } 339 virtual bool sheetLoaded() { return true; }
344 enum LoadedSheetErrorStatus { 340 enum LoadedSheetErrorStatus {
345 NoErrorLoadingSubresource, 341 NoErrorLoadingSubresource,
346 ErrorOccurredLoadingSubresource 342 ErrorOccurredLoadingSubresource
347 }; 343 };
348 virtual void notifyLoadedSheetAndAllCriticalSubresources(LoadedSheetErrorSta tus) { } 344 virtual void notifyLoadedSheetAndAllCriticalSubresources(LoadedSheetErrorSta tus) { }
349 virtual void startLoadingDynamicSheet() { ASSERT_NOT_REACHED(); } 345 virtual void startLoadingDynamicSheet() { ASSERT_NOT_REACHED(); }
350 346
351 bool hasName() const { DCHECK(!isTextNode()); return getFlag(HasNameOrIsEdit ingTextFlag); } 347 bool hasName() const { DCHECK(!isTextNode()); return getFlag(HasNameOrIsEdit ingTextFlag); }
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 return node.isDocumentNode() || node.isShadowRoot(); 883 return node.isDocumentNode() || node.isShadowRoot();
888 } 884 }
889 885
890 // See the comment at the declaration of ScriptWrappable::fromNode in 886 // See the comment at the declaration of ScriptWrappable::fromNode in
891 // bindings/core/v8/ScriptWrappable.h about why this method is defined here. 887 // bindings/core/v8/ScriptWrappable.h about why this method is defined here.
892 inline ScriptWrappable* ScriptWrappable::fromNode(Node* node) 888 inline ScriptWrappable* ScriptWrappable::fromNode(Node* node)
893 { 889 {
894 return node; 890 return node;
895 } 891 }
896 892
893 // TODO(yoichio): Move to core/editing
894 CORE_EXPORT bool isRootEditableElement(const Node&);
895 CORE_EXPORT Element* rootEditableElement(const Node&);
896 CORE_EXPORT Element* rootEditableElement(const Node&, EditableType);
897
897 // Allow equality comparisons of Nodes by reference or pointer, interchangeably. 898 // Allow equality comparisons of Nodes by reference or pointer, interchangeably.
898 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Node) 899 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Node)
899 900
900 901
901 #define DEFINE_NODE_TYPE_CASTS(thisType, predicate) \ 902 #define DEFINE_NODE_TYPE_CASTS(thisType, predicate) \
902 template<typename T> inline thisType* to##thisType(const RefPtr<T>& node) { return to##thisType(node.get()); } \ 903 template<typename T> inline thisType* to##thisType(const RefPtr<T>& node) { return to##thisType(node.get()); } \
903 DEFINE_TYPE_CASTS(thisType, Node, node, node->predicate, node.predicate) 904 DEFINE_TYPE_CASTS(thisType, Node, node, node->predicate, node.predicate)
904 905
905 // This requires isClassName(const Node&). 906 // This requires isClassName(const Node&).
906 #define DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType) \ 907 #define DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType) \
(...skipping 14 matching lines...) Expand all
921 } // namespace blink 922 } // namespace blink
922 923
923 #ifndef NDEBUG 924 #ifndef NDEBUG
924 // Outside the WebCore namespace for ease of invocation from gdb. 925 // Outside the WebCore namespace for ease of invocation from gdb.
925 void showNode(const blink::Node*); 926 void showNode(const blink::Node*);
926 void showTree(const blink::Node*); 927 void showTree(const blink::Node*);
927 void showNodePath(const blink::Node*); 928 void showNodePath(const blink::Node*);
928 #endif 929 #endif
929 930
930 #endif // Node_h 931 #endif // Node_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698