Fix overwriting value of content's encoding attribute by type attribute.
authorZbigniew Kostrzewa <z.kostrzewa@samsung.com>
Thu, 11 Apr 2013 14:47:29 +0000 (16:47 +0200)
committerGerrit Code Review <gerrit2@kim11>
Fri, 12 Apr 2013 09:38:37 +0000 (18:38 +0900)
[Issue#] N/A
[Problem] Though content encoding is specified the actual encoding value
is taken from type attribute if type attribute is set after encoding
attribute in the configuration file.
[Cause] Value from the last attribute parsed overwrites encoding of the
page even if it has been already read from encoding attribute.
[Solution] Check while parsing type attribute whether encoding has
already been set.
[SCMRequest] N/A

[Verification]
1. Build repository.
2. Run `wrt-extra-tests-w3c --output=text --regexp='ta_aaaaaaaaaa_z1'`

Change-Id: Ie49f4caf4111e3de00394a203acc3cee805d33de

src/configuration_parser/widget_parser.cpp

index 39b139c..a7e68d5 100644 (file)
@@ -702,7 +702,8 @@ class ContentParser : public ElementParser
             m_type = value;
             MimeTypeUtils::MimeAttributes mimeAttributes =
                 MimeTypeUtils::getMimeAttributes(value);
-            if (mimeAttributes.count(L"charset") > 0) {
+            if ((mimeAttributes.count(L"charset") > 0) && m_encoding.IsNull())
+            {
                 m_encoding = mimeAttributes[L"charset"];
             }
         } else if (attribute.name == L"encoding") {