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

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

Issue 14508005: Support an Event Path API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Introduce TreeScope::isInclusiveAncestorOf Created 7 years, 7 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/TreeScope.h ('k') | no next file » | 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) 2011 Google Inc. All Rights Reserved. 2 * Copyright (C) 2011 Google Inc. All Rights Reserved.
3 * Copyright (C) 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 } 434 }
435 #endif 435 #endif
436 436
437 int TreeScope::refCount() const 437 int TreeScope::refCount() const
438 { 438 {
439 if (Node* root = rootNode()) 439 if (Node* root = rootNode())
440 return root->refCount(); 440 return root->refCount();
441 return 0; 441 return 0;
442 } 442 }
443 443
444 bool TreeScope::isInclusiveAncestorOf(const TreeScope* scope) const
445 {
446 ASSERT(scope);
447 for (; scope; scope = scope->parentTreeScope()) {
448 if (scope == this)
449 return true;
450 }
451 return false;
452 }
453
444 } // namespace WebCore 454 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/TreeScope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698