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

Side by Side Diff: Source/core/css/StyleSheetContents.cpp

Issue 1305973007: Clean up empty namespace handling and fix empty namespaces in compound selectors (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@defaultns
Patch Set: Created 5 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
« no previous file with comments | « Source/core/css/CSSSelectorList.cpp ('k') | Source/core/css/parser/CSSSelectorParser.h » ('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 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 } 267 }
268 PrefixNamespaceURIMap::AddResult result = m_namespaces.add(prefix, uri); 268 PrefixNamespaceURIMap::AddResult result = m_namespaces.add(prefix, uri);
269 if (result.isNewEntry) 269 if (result.isNewEntry)
270 return; 270 return;
271 result.storedValue->value = uri; 271 result.storedValue->value = uri;
272 } 272 }
273 273
274 const AtomicString& StyleSheetContents::determineNamespace(const AtomicString& p refix) 274 const AtomicString& StyleSheetContents::determineNamespace(const AtomicString& p refix)
275 { 275 {
276 if (prefix.isNull()) 276 if (prefix.isNull())
277 return nullAtom; // No namespace. If an element/attribute has a namespac e, we won't match it. 277 return defaultNamespace();
278 if (prefix.isEmpty())
279 return emptyAtom; // No namespace. If an element/attribute has a namespa ce, we won't match it.
278 if (prefix == starAtom) 280 if (prefix == starAtom)
279 return starAtom; // We'll match any namespace. 281 return starAtom; // We'll match any namespace.
280 return m_namespaces.get(prefix); 282 return m_namespaces.get(prefix);
281 } 283 }
282 284
283 void StyleSheetContents::parseAuthorStyleSheet(const CSSStyleSheetResource* cach edStyleSheet, const SecurityOrigin* securityOrigin) 285 void StyleSheetContents::parseAuthorStyleSheet(const CSSStyleSheetResource* cach edStyleSheet, const SecurityOrigin* securityOrigin)
284 { 286 {
285 TRACE_EVENT1("blink,devtools.timeline", "ParseAuthorStyleSheet", "data", Ins pectorParseAuthorStyleSheetEvent::data(cachedStyleSheet)); 287 TRACE_EVENT1("blink,devtools.timeline", "ParseAuthorStyleSheet", "data", Ins pectorParseAuthorStyleSheetEvent::data(cachedStyleSheet));
286 288
287 bool isSameOriginRequest = securityOrigin && securityOrigin->canRequest(base URL()); 289 bool isSameOriginRequest = securityOrigin && securityOrigin->canRequest(base URL());
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 visitor->trace(m_ownerRule); 632 visitor->trace(m_ownerRule);
631 visitor->trace(m_importRules); 633 visitor->trace(m_importRules);
632 visitor->trace(m_childRules); 634 visitor->trace(m_childRules);
633 visitor->trace(m_loadingClients); 635 visitor->trace(m_loadingClients);
634 visitor->trace(m_completedClients); 636 visitor->trace(m_completedClients);
635 visitor->trace(m_ruleSet); 637 visitor->trace(m_ruleSet);
636 #endif 638 #endif
637 } 639 }
638 640
639 } 641 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSSelectorList.cpp ('k') | Source/core/css/parser/CSSSelectorParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698