Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit afb39e27 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Empty attribute values in styles should be strings"

parents 1d8d319e fc3874ac
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -769,16 +769,14 @@ std::unique_ptr<Item> ResourceParser::ParseXml(xml::XmlPullParser* parser,
    return std::move(string);
  }

  // If the text is empty, and the value is not allowed to be a string, encode it as a @null.
  if (util::TrimWhitespace(raw_value).empty()) {
    return ResourceUtils::MakeNull();
  }

  if (allow_raw_value) {
    // We can't parse this so return a RawString if we are allowed.
    return util::make_unique<RawString>(
        table_->string_pool.MakeRef(util::TrimWhitespace(raw_value),
                                    StringPool::Context(config_)));
  } else if (util::TrimWhitespace(raw_value).empty()) {
    // If the text is empty, and the value is not allowed to be a string, encode it as a @null.
    return ResourceUtils::MakeNull();
  }
  return {};
}