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

Unified Diff: Source/core/css/StyleSheetContents.cpp

Issue 1322543004: CSSStyleSheet::insertRule should respect the default namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/StyleSheetContents.h ('k') | Source/core/css/parser/CSSParser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/StyleSheetContents.cpp
diff --git a/Source/core/css/StyleSheetContents.cpp b/Source/core/css/StyleSheetContents.cpp
index 8769973ac24db5e64a08a10153db03957ce0627b..328cf80cc95b5ca97db57d8e6c35806663716e79 100644
--- a/Source/core/css/StyleSheetContents.cpp
+++ b/Source/core/css/StyleSheetContents.cpp
@@ -60,6 +60,7 @@ unsigned StyleSheetContents::estimatedSizeInBytes() const
StyleSheetContents::StyleSheetContents(StyleRuleImport* ownerRule, const String& originalURL, const CSSParserContext& context)
: m_ownerRule(ownerRule)
, m_originalURL(originalURL)
+ , m_defaultNamespace(starAtom)
, m_hasSyntacticallyValidCSSHeader(true)
, m_didLoadErrorOccur(false)
, m_isMutable(false)
@@ -77,6 +78,7 @@ StyleSheetContents::StyleSheetContents(const StyleSheetContents& o)
, m_importRules(o.m_importRules.size())
, m_childRules(o.m_childRules.size())
, m_namespaces(o.m_namespaces)
+ , m_defaultNamespace(o.m_defaultNamespace)
, m_hasSyntacticallyValidCSSHeader(o.m_hasSyntacticallyValidCSSHeader)
, m_didLoadErrorOccur(false)
, m_isMutable(false)
@@ -258,8 +260,11 @@ void StyleSheetContents::wrapperDeleteRule(unsigned index)
void StyleSheetContents::parserAddNamespace(const AtomicString& prefix, const AtomicString& uri)
{
- if (uri.isNull() || prefix.isNull())
+ ASSERT(!uri.isNull());
+ if (prefix.isNull()) {
+ m_defaultNamespace = uri;
return;
+ }
PrefixNamespaceURIMap::AddResult result = m_namespaces.add(prefix, uri);
if (result.isNewEntry)
return;
« no previous file with comments | « Source/core/css/StyleSheetContents.h ('k') | Source/core/css/parser/CSSParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698