当前位置: 首页>>代码示例>>C++>>正文


C++ HTMLObjectElement::name方法代码示例

本文整理汇总了C++中HTMLObjectElement::name方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLObjectElement::name方法的具体用法?C++ HTMLObjectElement::name怎么用?C++ HTMLObjectElement::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTMLObjectElement的用法示例。


在下文中一共展示了HTMLObjectElement::name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateWidget

void RenderPartObject::updateWidget(bool onlyCreateNonNetscapePlugins)
{
  String url;
  String serviceType;
  Vector<String> paramNames;
  Vector<String> paramValues;
  Frame* frame = m_view->frame();
  
  if (element()->hasTagName(objectTag)) {

      HTMLObjectElement* o = static_cast<HTMLObjectElement*>(element());

      o->setNeedWidgetUpdate(false);
      if (!o->isFinishedParsingChildren())
        return;
      // Check for a child EMBED tag.
      HTMLEmbedElement* embed = 0;
      for (Node* child = o->firstChild(); child;) {
          if (child->hasTagName(embedTag)) {
              embed = static_cast<HTMLEmbedElement*>(child);
              break;
          } else if (child->hasTagName(objectTag))
              child = child->nextSibling();         // Don't descend into nested OBJECT tags
          else
              child = child->traverseNextNode(o);   // Otherwise descend (EMBEDs may be inside COMMENT tags)
      }
      
      // Use the attributes from the EMBED tag instead of the OBJECT tag including WIDTH and HEIGHT.
      HTMLElement *embedOrObject;
      if (embed) {
          embedOrObject = (HTMLElement *)embed;
          url = embed->url();
          serviceType = embed->serviceType();
      } else
          embedOrObject = (HTMLElement *)o;
      
      // If there was no URL or type defined in EMBED, try the OBJECT tag.
      if (url.isEmpty())
          url = o->m_url;
      if (serviceType.isEmpty())
          serviceType = o->m_serviceType;
      
      HashSet<StringImpl*, CaseFoldingHash> uniqueParamNames;
      
      // Scan the PARAM children.
      // Get the URL and type from the params if we don't already have them.
      // Get the attributes from the params if there is no EMBED tag.
      Node *child = o->firstChild();
      while (child && (url.isEmpty() || serviceType.isEmpty() || !embed)) {
          if (child->hasTagName(paramTag)) {
              HTMLParamElement* p = static_cast<HTMLParamElement*>(child);
              String name = p->name().lower();
              if (url.isEmpty() && (name == "src" || name == "movie" || name == "code" || name == "url"))
                  url = p->value();
              if (serviceType.isEmpty() && name == "type") {
                  serviceType = p->value();
                  int pos = serviceType.find(";");
                  if (pos != -1)
                      serviceType = serviceType.left(pos);
              }
              if (!embed && !name.isEmpty()) {
                  uniqueParamNames.add(p->name().impl());
                  paramNames.append(p->name());
                  paramValues.append(p->value());
              }
          }
          child = child->nextSibling();
      }
      
      // When OBJECT is used for an applet via Sun's Java plugin, the CODEBASE attribute in the tag
      // points to the Java plugin itself (an ActiveX component) while the actual applet CODEBASE is
      // in a PARAM tag. See <http://java.sun.com/products/plugin/1.2/docs/tags.html>. This means
      // we have to explicitly suppress the tag's CODEBASE attribute if there is none in a PARAM,
      // else our Java plugin will misinterpret it. [4004531]
      String codebase;
      if (!embed && MIMETypeRegistry::isJavaAppletMIMEType(serviceType)) {
          codebase = "codebase";
          uniqueParamNames.add(codebase.impl()); // pretend we found it in a PARAM already
      }
      
      // Turn the attributes of either the EMBED tag or OBJECT tag into arrays, but don't override PARAM values.
      NamedAttrMap* attributes = embedOrObject->attributes();
      if (attributes) {
          for (unsigned i = 0; i < attributes->length(); ++i) {
              Attribute* it = attributes->attributeItem(i);
              const AtomicString& name = it->name().localName();
              if (embed || !uniqueParamNames.contains(name.impl())) {
                  paramNames.append(name.string());
                  paramValues.append(it->value().string());
              }
          }
      }
      
      // If we still don't have a type, try to map from a specific CLASSID to a type.
      if (serviceType.isEmpty() && !o->m_classId.isEmpty())
          mapClassIdToServiceType(o->m_classId, serviceType);
      
      if (!isURLAllowed(document(), url))
          return;

//.........这里部分代码省略.........
开发者ID:Chingliu,项目名称:EAWebkit,代码行数:101,代码来源:RenderPartObject.cpp

示例2: getValueProperty

JSValue* JSHTMLObjectElement::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case FormAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return toJS(exec, WTF::getPtr(imp->form()));
    }
    case CodeAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return jsString(imp->code());
    }
    case AlignAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return jsString(imp->align());
    }
    case ArchiveAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return jsString(imp->archive());
    }
    case BorderAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return jsString(imp->border());
    }
    case CodeBaseAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return jsString(imp->codeBase());
    }
    case CodeTypeAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return jsString(imp->codeType());
    }
    case DataAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return jsString(imp->data());
    }
    case DeclareAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return jsBoolean(imp->declare());
    }
    case HeightAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return jsString(imp->height());
    }
    case HspaceAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return jsNumber(imp->hspace());
    }
    case NameAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return jsString(imp->name());
    }
    case StandbyAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return jsString(imp->standby());
    }
    case TabIndexAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return jsNumber(imp->tabIndex());
    }
    case TypeAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return jsString(imp->type());
    }
    case UseMapAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return jsString(imp->useMap());
    }
    case VspaceAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return jsNumber(imp->vspace());
    }
    case WidthAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return jsString(imp->width());
    }
    case ContentDocumentAttrNum: {
        HTMLObjectElement* imp = static_cast<HTMLObjectElement*>(impl());

        return checkNodeSecurity(exec, imp->contentDocument()) ? toJS(exec, WTF::getPtr(imp->contentDocument())) : jsUndefined();
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
//.........这里部分代码省略.........
开发者ID:Crawping,项目名称:davinci,代码行数:101,代码来源:JSHTMLObjectElement.cpp


注:本文中的HTMLObjectElement::name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。