コード例 #1
0
ファイル: HTMLDocument.cpp プロジェクト: mirror/chromium
static HashSet<StringImpl*>* createHtmlCaseInsensitiveAttributesSet() {
  // This is the list of attributes in HTML 4.01 with values marked as "[CI]" or
  // case-insensitive.  Mozilla treats all other values as case-sensitive, thus
  // so do we.
  HashSet<StringImpl*>* attrSet = new HashSet<StringImpl*>;

  const QualifiedName* caseInsensitiveAttributes[] = {
      &accept_charsetAttr, &acceptAttr,     &alignAttr,    &alinkAttr,
      &axisAttr,           &bgcolorAttr,    &charsetAttr,  &checkedAttr,
      &clearAttr,          &codetypeAttr,   &colorAttr,    &compactAttr,
      &declareAttr,        &deferAttr,      &dirAttr,      &directionAttr,
      &disabledAttr,       &enctypeAttr,    &faceAttr,     &frameAttr,
      &hreflangAttr,       &http_equivAttr, &langAttr,     &languageAttr,
      &linkAttr,           &mediaAttr,      &methodAttr,   &multipleAttr,
      &nohrefAttr,         &noresizeAttr,   &noshadeAttr,  &nowrapAttr,
      &readonlyAttr,       &relAttr,        &revAttr,      &rulesAttr,
      &scopeAttr,          &scrollingAttr,  &selectedAttr, &shapeAttr,
      &targetAttr,         &textAttr,       &typeAttr,     &valignAttr,
      &valuetypeAttr,      &vlinkAttr};

  attrSet->reserveCapacityForSize(WTF_ARRAY_LENGTH(caseInsensitiveAttributes));
  for (const QualifiedName* attr : caseInsensitiveAttributes)
    attrSet->add(attr->localName().impl());

  return attrSet;
}