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


C++ GetParsedAttr函数代码示例

本文整理汇总了C++中GetParsedAttr函数的典型用法代码示例。如果您正苦于以下问题:C++ GetParsedAttr函数的具体用法?C++ GetParsedAttr怎么用?C++ GetParsedAttr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: GetParsedAttr

uint32_t
HTMLIFrameElement::GetSandboxFlags()
{
  const nsAttrValue* sandboxAttr = GetParsedAttr(nsGkAtoms::sandbox);
  // No sandbox attribute, no sandbox flags.
  if (!sandboxAttr) {
    return 0;
  }

  //  Start off by setting all the restriction flags.
  uint32_t out = SANDBOX_ALL_FLAGS;

// Macro for updating the flag according to the keywords
#define SANDBOX_KEYWORD(string, atom, flags)                             \
  if (sandboxAttr->Contains(nsGkAtoms::atom, eIgnoreCase)) { out &= ~(flags); }
#include "IframeSandboxKeywordList.h"
#undef SANDBOX_KEYWORD

  if (GetParsedAttr(nsGkAtoms::allowfullscreen) ||
      GetParsedAttr(nsGkAtoms::mozallowfullscreen)) {
    out &= ~SANDBOXED_FULLSCREEN;
  }

  return out;
}
开发者ID:SJasoria,项目名称:gecko-dev,代码行数:25,代码来源:HTMLIFrameElement.cpp

示例2: NS_PRECONDITION

nsresult
HTMLFrameSetElement::GetRowSpec(int32_t *aNumValues,
                                const nsFramesetSpec** aSpecs)
{
  NS_PRECONDITION(aNumValues, "Must have a pointer to an integer here!");
  NS_PRECONDITION(aSpecs, "Must have a pointer to an array of nsFramesetSpecs");
  *aNumValues = 0;
  *aSpecs = nullptr;
  
  if (!mRowSpecs) {
    const nsAttrValue* value = GetParsedAttr(nsGkAtoms::rows);
    if (value && value->Type() == nsAttrValue::eString) {
      nsresult rv = ParseRowCol(value->GetStringValue(), mNumRows,
                                getter_Transfers(mRowSpecs));
      NS_ENSURE_SUCCESS(rv, rv);
    }

    if (!mRowSpecs) {  // we may not have had an attr or had an empty attr
      mRowSpecs = new nsFramesetSpec[1];
      if (!mRowSpecs) {
        mNumRows = 0;
        return NS_ERROR_OUT_OF_MEMORY;
      }
      mNumRows = 1;
      mRowSpecs[0].mUnit  = eFramesetUnit_Relative;
      mRowSpecs[0].mValue = 1;
    }
  }

  *aSpecs = mRowSpecs;
  *aNumValues = mNumRows;
  return NS_OK;
}
开发者ID:JSilver99,项目名称:mozilla-central,代码行数:33,代码来源:HTMLFrameSetElement.cpp

示例3: NS_PRECONDITION

nsresult
HTMLFrameSetElement::GetColSpec(int32_t *aNumValues,
                                const nsFramesetSpec** aSpecs)
{
  NS_PRECONDITION(aNumValues, "Must have a pointer to an integer here!");
  NS_PRECONDITION(aSpecs, "Must have a pointer to an array of nsFramesetSpecs");
  *aNumValues = 0;
  *aSpecs = nullptr;

  if (!mColSpecs) {
    const nsAttrValue* value = GetParsedAttr(nsGkAtoms::cols);
    if (value && value->Type() == nsAttrValue::eString) {
      nsresult rv = ParseRowCol(value->GetStringValue(), mNumCols,
                                &mColSpecs);
      NS_ENSURE_SUCCESS(rv, rv);
    }

    if (!mColSpecs) {  // we may not have had an attr or had an empty attr
      mColSpecs = MakeUnique<nsFramesetSpec[]>(1);
      mNumCols = 1;
      mColSpecs[0].mUnit  = eFramesetUnit_Relative;
      mColSpecs[0].mValue = 1;
    }
  }

  *aSpecs = mColSpecs.get();
  *aNumValues = mNumCols;
  return NS_OK;
}
开发者ID:bgrins,项目名称:gecko-dev,代码行数:29,代码来源:HTMLFrameSetElement.cpp

示例4: Nothing

Maybe<nsStyleLinkElement::SheetInfo> SVGStyleElement::GetStyleSheetInfo() {
  if (!IsCSSMimeTypeAttribute(*this)) {
    return Nothing();
  }

  nsAutoString title;
  nsAutoString media;
  GetTitleAndMediaForElement(*this, title, media);

  return Some(SheetInfo{
      *OwnerDoc(),
      this,
      nullptr,
      // FIXME(bug 1459822): Why doesn't this need a principal, but
      // HTMLStyleElement does?
      nullptr,
      net::ReferrerPolicy::RP_Unset,
      // FIXME(bug 1459822): Why does this need a crossorigin attribute, but
      // HTMLStyleElement doesn't?
      AttrValueToCORSMode(GetParsedAttr(nsGkAtoms::crossorigin)),
      title,
      media,
      HasAlternateRel::No,
      IsInline::Yes,
  });
}
开发者ID:jasonLaster,项目名称:gecko-dev,代码行数:26,代码来源:SVGStyleElement.cpp

示例5: GetSrclang

void
HTMLTrackElement::CreateTextTrack()
{
  nsString label, srcLang;
  GetSrclang(srcLang);
  GetLabel(label);

  TextTrackKind kind;
  if (const nsAttrValue* value = GetParsedAttr(nsGkAtoms::kind)) {
    kind = static_cast<TextTrackKind>(value->GetEnumValue());
  } else {
    kind = TextTrackKind::Subtitles;
  }

  bool hasHadScriptObject = true;
  nsIScriptGlobalObject* scriptObject =
    OwnerDoc()->GetScriptHandlingObject(hasHadScriptObject);

  NS_ENSURE_TRUE_VOID(scriptObject || !hasHadScriptObject);

  nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(scriptObject);
  mTrack = new TextTrack(window, kind, label, srcLang,
                         TextTrackMode::Disabled,
                         TextTrackReadyState::NotLoaded,
                         TextTrackSource::Track);
  mTrack->SetTrackElement(this);

  if (mMediaParent) {
    mMediaParent->AddTextTrack(mTrack);
  }
}
开发者ID:CodeSpeaker,项目名称:gecko-dev,代码行数:31,代码来源:HTMLTrackElement.cpp

示例6: GetParsedAttr

HTMLTextAreaElement::GetRows() {
  const nsAttrValue* attr = GetParsedAttr(nsGkAtoms::rows);
  if (attr && attr->Type() == nsAttrValue::eInteger) {
    int32_t rows = attr->GetIntegerValue();
    return (rows <= 0) ? DEFAULT_ROWS_TEXTAREA : rows;
  }

  return DEFAULT_ROWS_TEXTAREA;
}
开发者ID:jasonLaster,项目名称:gecko-dev,代码行数:9,代码来源:HTMLTextAreaElement.cpp

示例7: GetParsedAttr

TextTrackKind
HTMLTrackElement::Kind() const
{
  const nsAttrValue* value = GetParsedAttr(nsGkAtoms::kind);
  if (!value) {
    return TextTrackKind::Subtitles;
  }
  return static_cast<TextTrackKind>(value->GetEnumValue());
}
开发者ID:Pulfer,项目名称:Pale-Moon,代码行数:9,代码来源:HTMLTrackElement.cpp

示例8: GetParsedAttr

uint32_t
HTMLIFrameElement::GetSandboxFlags()
{
  const nsAttrValue* sandboxAttr = GetParsedAttr(nsGkAtoms::sandbox);
  // No sandbox attribute, no sandbox flags.
  if (!sandboxAttr) {
    return SANDBOXED_NONE;
  }
  return nsContentUtils::ParseSandboxAttributeToFlags(sandboxAttr);
}
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:10,代码来源:HTMLIFrameElement.cpp

示例9: GetParsedAttr

HTMLTextAreaElement::GetCols()
{
  const nsAttrValue* attr = GetParsedAttr(nsGkAtoms::cols);
  if (attr) {
    int32_t cols = attr->Type() == nsAttrValue::eInteger ?
                   attr->GetIntegerValue() : 0;
    // XXX why a default of 1 char, why hide it
    return (cols <= 0) ? 1 : cols;
  }

  return DEFAULT_COLS;
}
开发者ID:JuannyWang,项目名称:gecko-dev,代码行数:12,代码来源:HTMLTextAreaElement.cpp

示例10: GetParsedAttr

NS_IMETHODIMP
nsDOMTokenList::Item(PRUint32 aIndex, nsAString& aResult)
{
  const nsAttrValue* attr = GetParsedAttr();

  if (!attr || aIndex >= static_cast<PRUint32>(attr->GetAtomCount())) {
    SetDOMStringToNull(aResult);
    return NS_OK;
  }
  attr->AtomAt(aIndex)->ToString(aResult);

  return NS_OK;
}
开发者ID:Acidburn0zzz,项目名称:mozilla-central,代码行数:13,代码来源:nsDOMTokenList.cpp

示例11: CheckToken

NS_IMETHODIMP
nsDOMTokenList::Add(const nsAString& aToken)
{
  nsresult rv = CheckToken(aToken);
  NS_ENSURE_SUCCESS(rv, rv);

  const nsAttrValue* attr = GetParsedAttr();

  if (attr && attr->Contains(aToken)) {
    return NS_OK;
  }

  AddInternal(attr, aToken);

  return NS_OK;
}
开发者ID:Acidburn0zzz,项目名称:mozilla-central,代码行数:16,代码来源:nsDOMTokenList.cpp

示例12: GetSrclang

void
HTMLTrackElement::CreateTextTrack()
{
  nsString label, srcLang;
  GetSrclang(srcLang);
  GetLabel(label);

  TextTrackKind kind;
  if (const nsAttrValue* value = GetParsedAttr(nsGkAtoms::kind)) {
    kind = static_cast<TextTrackKind>(value->GetEnumValue());
  } else {
    kind = TextTrackKind::Subtitles;
  }

  mTrack = new TextTrack(OwnerDoc()->GetParentObject(), kind, label, srcLang);

  if (mMediaParent) {
    mMediaParent->AddTextTrack(mTrack);
  }
}
开发者ID:Incognito,项目名称:mozilla-central,代码行数:20,代码来源:HTMLTrackElement.cpp

示例13: GetParsedAttr

uint32_t
SVGIFrameElement::GetSandboxFlags()
{
  const nsAttrValue* sandboxAttr = GetParsedAttr(nsGkAtoms::sandbox);
  return nsContentUtils::ParseSandboxAttributeToFlags(sandboxAttr);
}
开发者ID:CodeSpeaker,项目名称:gecko-dev,代码行数:6,代码来源:SVGIFrameElement.cpp

示例14: AttrValueToCORSMode

CORSMode
SVGStyleElement::GetCORSMode() const
{
  return AttrValueToCORSMode(GetParsedAttr(nsGkAtoms::crossorigin));
}
开发者ID:bbondy,项目名称:mozilla-central,代码行数:5,代码来源:SVGStyleElement.cpp

示例15: AttrValueToCORSMode

CORSMode
HTMLImageElement::GetCORSMode()
{
  return AttrValueToCORSMode(GetParsedAttr(nsGkAtoms::crossorigin));
}
开发者ID:Manishearth,项目名称:gecko-dev,代码行数:5,代码来源:HTMLImageElement.cpp


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