nsresult
HTMLTextAreaElement::GetSelectionDirection(nsAString& aDirection)
{
  ErrorResult error;
  GetSelectionDirection(aDirection, error);
  return error.ErrorCode();
}
示例#2
0
nsresult
nsEventListenerManager::HandleEventSubType(nsListenerStruct* aListenerStruct,
                                           const EventListenerHolder& aListener,
                                           nsIDOMEvent* aDOMEvent,
                                           EventTarget* aCurrentTarget,
                                           nsCxPusher* aPusher)
{
  nsresult result = NS_OK;

  // If this is a script handler and we haven't yet
  // compiled the event handler itself
  if ((aListenerStruct->mListenerType == eJSEventListener) &&
      aListenerStruct->mHandlerIsString) {
    nsIJSEventListener *jslistener = aListenerStruct->GetJSListener();
    result = CompileEventHandlerInternal(aListenerStruct,
                                         jslistener->GetEventContext() !=
                                           aPusher->GetCurrentScriptContext(),
                                         nullptr);
  }

  if (NS_SUCCEEDED(result)) {
    nsAutoMicroTask mt;
    // nsIDOMEvent::currentTarget is set in nsEventDispatcher.
    if (aListener.HasWebIDLCallback()) {
      ErrorResult rv;
      aListener.GetWebIDLCallback()->
        HandleEvent(aCurrentTarget, *(aDOMEvent->InternalDOMEvent()), rv);
      result = rv.ErrorCode();
    } else {
      result = aListener.GetXPCOMCallback()->HandleEvent(aDOMEvent);
    }
  }

  return result;
}
示例#3
0
NS_IMETHODIMP 
HTMLBodyElement::SetText(const nsAString& aText)
{
  ErrorResult rv;
  SetText(aText, rv);
  return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableCellElement::SetScope(const nsAString& aScope)
{
  ErrorResult rv;
  SetScope(aScope, rv);
  return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableCellElement::SetRowSpan(int32_t aRowSpan)
{
  ErrorResult rv;
  SetRowSpan(aRowSpan, rv);
  return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableCellElement::SetVAlign(const nsAString& aVAlign)
{
  ErrorResult rv;
  SetVAlign(aVAlign, rv);
  return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableCellElement::SetWidth(const nsAString& aWidth)
{
  ErrorResult rv;
  SetWidth(aWidth, rv);
  return rv.ErrorCode();
}
/* nsIDOMSVGRect getBBox (); */
NS_IMETHODIMP
SVGLocatableElement::GetBBox(nsIDOMSVGRect **_retval)
{
  ErrorResult rv;
  *_retval = GetBBox(rv).get();
  return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLFontElement::SetSize(const nsAString& aSize)
{
    ErrorResult rv;
    SetSize(aSize, rv);
    return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLProgressElement::SetValue(double aValue)
{
  ErrorResult rv;
  SetValue(aValue, rv);
  return rv.ErrorCode();
}
示例#11
0
NS_IMETHODIMP
nsDOMFileReader::Abort()
{
  ErrorResult rv;
  FileIOObject::Abort(rv);
  return rv.ErrorCode();
}
示例#12
0
nsresult
UDPSocket::DoPendingMcastCommand()
{
    MOZ_ASSERT(mReadyState == SocketReadyState::Open, "Multicast command can only be executed after socket opened");

    for (uint32_t i = 0; i < mPendingMcastCommands.Length(); ++i) {
        MulticastCommand& command = mPendingMcastCommands[i];
        ErrorResult rv;

        switch (command.mCommand) {
        case MulticastCommand::Join: {
            JoinMulticastGroup(command.mAddress, rv);
            break;
        }
        case MulticastCommand::Leave: {
            LeaveMulticastGroup(command.mAddress, rv);
            break;
        }
        }

        if (NS_WARN_IF(rv.Failed())) {
            return rv.ErrorCode();
        }
    }

    mPendingMcastCommands.Clear();
    return NS_OK;
}
示例#13
0
NS_IMETHODIMP ChangeAttributeTxn::DoTransaction(void)
{
    NS_ASSERTION(mEditor && mElement, "bad state");
    if (!mEditor || !mElement) {
        return NS_ERROR_NOT_INITIALIZED;
    }

    nsCOMPtr<nsIDOMElement> element = do_QueryInterface(mElement);
    // need to get the current value of the attribute and save it, and set mAttributeWasSet
    nsresult result = mEditor->GetAttributeValue(element, mAttribute, mUndoValue, &mAttributeWasSet);
    NS_ENSURE_SUCCESS(result, result);

    // XXX: hack until attribute-was-set code is implemented
    if (!mUndoValue.IsEmpty())
        mAttributeWasSet = true;
    // XXX: end hack

    ErrorResult rv;
    // now set the attribute to the new value
    if (!mRemoveAttribute)
        mElement->SetAttribute(mAttribute, mValue, rv);
    else
        mElement->RemoveAttribute(mAttribute, rv);

    return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTextAreaElement::SetSelectionDirection(const nsAString& aDirection)
{
  ErrorResult error;
  SetSelectionDirection(aDirection, error);
  return error.ErrorCode();
}
NS_IMETHODIMP
ImageDocument::GetImageRequest(imgIRequest** aImageRequest)
{
  ErrorResult rv;
  *aImageRequest = GetImageRequest(rv).get();
  return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLOptionsCollection::GetSelectedIndex(int32_t* aSelectedIndex)
{
  ErrorResult rv;
  *aSelectedIndex = GetSelectedIndex(rv);
  return rv.ErrorCode();
}
示例#17
0
NS_IMETHODIMP
HTMLTableCellElement::SetAbbr(const nsAString& aAbbr)
{
  ErrorResult rv;
  SetAbbr(aAbbr, rv);
  return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLOptionsCollection::SetSelectedIndex(int32_t aSelectedIndex)
{
  ErrorResult rv;
  SetSelectedIndex(aSelectedIndex, rv);
  return rv.ErrorCode();
}
示例#19
0
NS_IMETHODIMP
HTMLTableCellElement::SetChOff(const nsAString& aChOff)
{
  ErrorResult rv;
  SetChOff(aChOff, rv);
  return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLOptionsCollection::Remove(int32_t aIndex)
{
  ErrorResult rv;
  Remove(aIndex, rv);
  return rv.ErrorCode();
}
示例#21
0
NS_IMETHODIMP
HTMLTableCellElement::SetNoWrap(bool aNoWrap)
{
  ErrorResult rv;
  SetNoWrap(aNoWrap, rv);
  return rv.ErrorCode();
}
示例#22
0
NS_IMETHODIMP
inDOMUtils::SelectorMatchesElement(nsIDOMElement* aElement,
                                   nsIDOMCSSStyleRule* aRule,
                                   uint32_t aSelectorIndex,
                                   bool* aMatches)
{
  nsCOMPtr<Element> element = do_QueryInterface(aElement);
  NS_ENSURE_ARG_POINTER(element);

  ErrorResult rv;
  nsCSSSelectorList* tail = GetSelectorAtIndex(aRule, aSelectorIndex, rv);
  if (rv.Failed()) {
    return rv.ErrorCode();
  }

  // We want just the one list item, not the whole list tail
  nsAutoPtr<nsCSSSelectorList> sel(tail->Clone(false));

  element->OwnerDoc()->FlushPendingLinkUpdates();
  // XXXbz what exactly should we do with visited state here?
  TreeMatchContext matchingContext(false,
                                   nsRuleWalker::eRelevantLinkUnvisited,
                                   element->OwnerDoc(),
                                   TreeMatchContext::eNeverMatchVisited);
  *aMatches = nsCSSRuleProcessor::SelectorListMatches(element, matchingContext,
                                                      sel);
  return NS_OK;
}
示例#23
0
NS_IMETHODIMP
HTMLTableCellElement::SetHeaders(const nsAString& aHeaders)
{
  ErrorResult rv;
  SetHeaders(aHeaders, rv);
  return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLRangeAccessible::SetCurrentValue(double aValue)
{
  ErrorResult er;
  HTMLInputElement::FromContent(mContent)->SetValueAsNumber(aValue, er);
  return er.ErrorCode();
}
示例#25
0
NS_IMETHODIMP
Attr::SetValue(const nsAString& aValue)
{
  ErrorResult rv;
  SetValue(aValue, rv);
  return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLImageElement::SetHeight(uint32_t aHeight)
{
    ErrorResult rv;
    SetHeight(aHeight, rv);
    return rv.ErrorCode();
}
示例#27
0
NS_IMETHODIMP 
HTMLBodyElement::SetLink(const nsAString& aLink)
{
  ErrorResult rv;
  SetLink(aLink, rv);
  return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLImageElement::SetWidth(uint32_t aWidth)
{
    ErrorResult rv;
    SetWidth(aWidth, rv);
    return rv.ErrorCode();
}
示例#29
0
NS_IMETHODIMP 
HTMLBodyElement::SetBgColor(const nsAString& aBgColor)
{
  ErrorResult rv;
  SetBgColor(aBgColor, rv);
  return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTextAreaElement::SetSelectionEnd(int32_t aSelectionEnd)
{
  ErrorResult error;
  SetSelectionEnd(aSelectionEnd, error);
  return error.ErrorCode();
}