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

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

Issue 415243003: Drop slower Node::hasID() / Node::hasClass() methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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/Element.h ('k') | 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 Element* rootEditableElement(EditableType) const; 334 Element* rootEditableElement(EditableType) const;
335 335
336 bool inSameContainingBlockFlowElement(Node*); 336 bool inSameContainingBlockFlowElement(Node*);
337 337
338 // For <link> and <style> elements. 338 // For <link> and <style> elements.
339 virtual bool sheetLoaded() { return true; } 339 virtual bool sheetLoaded() { return true; }
340 virtual void notifyLoadedSheetAndAllCriticalSubresources(bool /* error loadi ng subresource */) { } 340 virtual void notifyLoadedSheetAndAllCriticalSubresources(bool /* error loadi ng subresource */) { }
341 virtual void startLoadingDynamicSheet() { ASSERT_NOT_REACHED(); } 341 virtual void startLoadingDynamicSheet() { ASSERT_NOT_REACHED(); }
342 342
343 bool hasName() const { return !isTextNode() && getFlag(HasNameOrIsEditingTex tFlag); } 343 bool hasName() const { return !isTextNode() && getFlag(HasNameOrIsEditingTex tFlag); }
344 bool hasID() const;
345 bool hasClass() const;
346 344
347 bool isUserActionElement() const { return getFlag(IsUserActionElementFlag); } 345 bool isUserActionElement() const { return getFlag(IsUserActionElementFlag); }
348 void setUserActionElement(bool flag) { setFlag(flag, IsUserActionElementFlag ); } 346 void setUserActionElement(bool flag) { setFlag(flag, IsUserActionElementFlag ); }
349 347
350 bool active() const { return isUserActionElement() && isUserActionElementAct ive(); } 348 bool active() const { return isUserActionElement() && isUserActionElementAct ive(); }
351 bool inActiveChain() const { return isUserActionElement() && isUserActionEle mentInActiveChain(); } 349 bool inActiveChain() const { return isUserActionElement() && isUserActionEle mentInActiveChain(); }
352 bool hovered() const { return isUserActionElement() && isUserActionElementHo vered(); } 350 bool hovered() const { return isUserActionElement() && isUserActionElementHo vered(); }
353 bool focused() const { return isUserActionElement() && isUserActionElementFo cused(); } 351 bool focused() const { return isUserActionElement() && isUserActionElementFo cused(); }
354 352
355 bool needsAttach() const { return styleChangeType() == NeedsReattachStyleCha nge; } 353 bool needsAttach() const { return styleChangeType() == NeedsReattachStyleCha nge; }
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 } // namespace blink 897 } // namespace blink
900 898
901 #ifndef NDEBUG 899 #ifndef NDEBUG
902 // Outside the WebCore namespace for ease of invocation from gdb. 900 // Outside the WebCore namespace for ease of invocation from gdb.
903 void showNode(const blink::Node*); 901 void showNode(const blink::Node*);
904 void showTree(const blink::Node*); 902 void showTree(const blink::Node*);
905 void showNodePath(const blink::Node*); 903 void showNodePath(const blink::Node*);
906 #endif 904 #endif
907 905
908 #endif 906 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698