Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
webkit fails IETC namespaces/prefix-007.xml
https://bugs.webkit.org/show_bug.cgi?id=86137

Patch by Takashi Sakamoto <tasak@google.com> on 2012-08-12
Reviewed by Eric Seidel.

Source/WebCore:

If a namespace prefix or default namespace is declared more than once
only the last declaration shall be used.

parseAddNamespace doesn't check return value of WTF::HashMap<>::add.
If the return value's isNewEntry is true, the new entry is added with
the specified value. However, if isNewEntry is false, it is required
to update the store value.

No new tests. ietestcenter/css3/namespaces/prefix-007.xml and
ietestcenter/css3/namespaces/prefix-010.xml covers this change.

* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parserAddNamespace):
Modified to check m_namespaces.add's return value.
If the result says not a new entry, updated the value stored in
m_namespaces by using iterator in the result.

LayoutTests:

* platform/chromium/TestExpectations:
Enabled the layout tests, ietestcenter/css3/namespaces/prefix-007.xml
and ietestcenter/css3/namespaces/prefix-010.xml.
* platform/win/ietestcenter/css3/namespaces/prefix-007-expected.txt: Removed.
* platform/win/ietestcenter/css3/namespaces/prefix-010-expected.txt: Removed.
Removed old expectations.

Canonical link: https://commits.webkit.org/111646@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
tasak authored and webkit-commit-queue committed Aug 12, 2012
1 parent 0949f26 commit 3f70604
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 31 deletions.
14 changes: 14 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
2012-08-12 Takashi Sakamoto <tasak@google.com>

webkit fails IETC namespaces/prefix-007.xml
https://bugs.webkit.org/show_bug.cgi?id=86137

Reviewed by Eric Seidel.

* platform/chromium/TestExpectations:
Enabled the layout tests, ietestcenter/css3/namespaces/prefix-007.xml
and ietestcenter/css3/namespaces/prefix-010.xml.
* platform/win/ietestcenter/css3/namespaces/prefix-007-expected.txt: Removed.
* platform/win/ietestcenter/css3/namespaces/prefix-010-expected.txt: Removed.
Removed old expectations.

2012-08-11 Jon Lee <jonlee@apple.com>

webarchive/ignore-noscript-if-scripting.html expected results should use .webarchive extension
Expand Down
2 changes: 0 additions & 2 deletions LayoutTests/platform/chromium/TestExpectations
Expand Up @@ -3129,8 +3129,6 @@ BUGWK85308 DEBUG : ietestcenter/css3/valuesandunits/units-000.htm = CRASH
BUGWK85308 RELEASE : ietestcenter/css3/valuesandunits/units-000.htm = IMAGE
BUGWK85310 : ietestcenter/css3/valuesandunits/units-010.htm = IMAGE
// IETC namespace failures
BUGWK86137 : ietestcenter/css3/namespaces/prefix-007.xml = IMAGE
BUGWK86139 : ietestcenter/css3/namespaces/prefix-010.xml = IMAGE
BUGWK86142 : ietestcenter/css3/namespaces/syntax-021.xml = IMAGE

BUGWK84432 WIN : fast/filesystem/op-restricted-names.html = TEXT
Expand Down

This file was deleted.

This file was deleted.

24 changes: 24 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,27 @@
2012-08-12 Takashi Sakamoto <tasak@google.com>

webkit fails IETC namespaces/prefix-007.xml
https://bugs.webkit.org/show_bug.cgi?id=86137

Reviewed by Eric Seidel.

If a namespace prefix or default namespace is declared more than once
only the last declaration shall be used.

parseAddNamespace doesn't check return value of WTF::HashMap<>::add.
If the return value's isNewEntry is true, the new entry is added with
the specified value. However, if isNewEntry is false, it is required
to update the store value.

No new tests. ietestcenter/css3/namespaces/prefix-007.xml and
ietestcenter/css3/namespaces/prefix-010.xml covers this change.

* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parserAddNamespace):
Modified to check m_namespaces.add's return value.
If the result says not a new entry, updated the value stored in
m_namespaces by using iterator in the result.

2012-08-12 Benjamin Poulain <benjamin@webkit.org>

Move CSS's propertyNameStrings[] to from the header to the cpp file
Expand Down
5 changes: 4 additions & 1 deletion Source/WebCore/css/StyleSheetContents.cpp
Expand Up @@ -250,7 +250,10 @@ void StyleSheetContents::parserAddNamespace(const AtomicString& prefix, const At
{
if (uri.isNull() || prefix.isNull())
return;
m_namespaces.add(prefix, uri);
PrefixNamespaceURIMap::AddResult result = m_namespaces.add(prefix, uri);
if (result.isNewEntry)
return;
result.iterator->second = uri;
}

const AtomicString& StyleSheetContents::determineNamespace(const AtomicString& prefix)
Expand Down

0 comments on commit 3f70604

Please sign in to comment.