Commit 6e4e9856 authored by hyatt@apple.com's avatar hyatt@apple.com
Browse files

Fix for bug 32032, empty namespaces should be allowed in @namespace directives in CSS.

Reviewed by Simon Fraser.

Added fast/css/namespaces/namespaces-empty.xml

* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::addNamespace):
(WebCore::CSSStyleSheet::determineNamespace):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51556 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 197accca
<root>
<head xmlns="http://www.w3.org/1999/xhtml">
<link rel="author" title="Anne van Kesteren" href="http://annevankesteren.nl/"/>
<link rel="author" title="Opera Software ASA" href="http://opera.com/"/>
<link rel="help" href="http://www.w3.org/TR/css3-namespace/#prefixes"/>
<title>CSS Namespaces Test Suite: empty string default namespace</title>
<style>
@namespace "";
@namespace x "test";
*|t, *|root { display:block }
*|t, t[x] { background:lime }
t { background:red }
</style>
</head>
<t x="">This sentence should have a green background.</t>
<t xmlns="test">This sentence should have a green background.</t>
</root>
a5fef65ca47bf453402a4928d1bafec9
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x36
RenderBlock {root} at (0,0) size 800x36
RenderBlock {t} at (0,0) size 800x18 [bgcolor=#00FF00]
RenderText {#text} at (0,0) size 299x18
text run at (0,0) width 299: "This sentence should have a green background."
RenderBlock {t} at (0,18) size 800x18 [bgcolor=#00FF00]
RenderText {#text} at (0,0) size 299x18
text run at (0,0) width 299: "This sentence should have a green background."
2009-12-01 Dave Hyatt <hyatt@apple.com>
Reviewed by Simon Fraser.
Fix for bug 32032, empty namespaces should be allowed in @namespace directives in CSS.
Added fast/css/namespaces/namespaces-empty.xml
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::addNamespace):
(WebCore::CSSStyleSheet::determineNamespace):
2009-12-01 Joseph Pecoraro <joepeck@webkit.org>
 
Reviewed by Timothy Hatcher.
......@@ -138,7 +138,7 @@ void CSSStyleSheet::deleteRule(unsigned index, ExceptionCode& ec)
void CSSStyleSheet::addNamespace(CSSParser* p, const AtomicString& prefix, const AtomicString& uri)
{
if (uri.isEmpty())
if (uri.isNull())
return;
m_namespaces = new CSSNamespace(prefix, uri, m_namespaces);
......@@ -151,11 +151,11 @@ void CSSStyleSheet::addNamespace(CSSParser* p, const AtomicString& prefix, const
const AtomicString& CSSStyleSheet::determineNamespace(const AtomicString& prefix)
{
if (prefix.isEmpty())
if (prefix.isNull())
return nullAtom; // No namespace. If an element/attribute has a namespace, we won't match it.
else if (prefix == starAtom)
if (prefix == starAtom)
return starAtom; // We'll match any namespace.
else if (m_namespaces) {
if (m_namespaces) {
CSSNamespace* ns = m_namespaces->namespaceForPrefix(prefix);
if (ns)
return ns->uri();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment