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

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

Issue 23516004: Have CSSParserContext take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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/SelectorQuery.h ('k') | Source/core/html/HTMLLinkElement.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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 PassRefPtr<NodeList> SelectorQuery::queryAll(Node* rootNode) const 473 PassRefPtr<NodeList> SelectorQuery::queryAll(Node* rootNode) const
474 { 474 {
475 return m_selectors.queryAll(rootNode); 475 return m_selectors.queryAll(rootNode);
476 } 476 }
477 477
478 PassRefPtr<Element> SelectorQuery::queryFirst(Node* rootNode) const 478 PassRefPtr<Element> SelectorQuery::queryFirst(Node* rootNode) const
479 { 479 {
480 return m_selectors.queryFirst(rootNode); 480 return m_selectors.queryFirst(rootNode);
481 } 481 }
482 482
483 SelectorQuery* SelectorQueryCache::add(const AtomicString& selectors, Document* document, ExceptionState& es) 483 SelectorQuery* SelectorQueryCache::add(const AtomicString& selectors, const Docu ment& document, ExceptionState& es)
484 { 484 {
485 HashMap<AtomicString, OwnPtr<SelectorQuery> >::iterator it = m_entries.find( selectors); 485 HashMap<AtomicString, OwnPtr<SelectorQuery> >::iterator it = m_entries.find( selectors);
486 if (it != m_entries.end()) 486 if (it != m_entries.end())
487 return it->value.get(); 487 return it->value.get();
488 488
489 CSSParser parser(document); 489 CSSParser parser(document);
490 CSSSelectorList selectorList; 490 CSSSelectorList selectorList;
491 parser.parseSelector(selectors, selectorList); 491 parser.parseSelector(selectors, selectorList);
492 492
493 if (!selectorList.first()) { 493 if (!selectorList.first()) {
(...skipping 16 matching lines...) Expand all
510 m_entries.add(selectors, selectorQuery.release()); 510 m_entries.add(selectors, selectorQuery.release());
511 return rawSelectorQuery; 511 return rawSelectorQuery;
512 } 512 }
513 513
514 void SelectorQueryCache::invalidate() 514 void SelectorQueryCache::invalidate()
515 { 515 {
516 m_entries.clear(); 516 m_entries.clear();
517 } 517 }
518 518
519 } 519 }
OLDNEW
« no previous file with comments | « Source/core/dom/SelectorQuery.h ('k') | Source/core/html/HTMLLinkElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698