Commit bfdd0fcc authored by Emilio Cobos Álvarez's avatar Emilio Cobos Álvarez
Browse files

Bug 1733384 - Make inert not modify the computed style. r=sefeng,layout-reviewers,jfkthame

parent 9073f655
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -3367,7 +3367,6 @@ nsresult EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
        bool suppressBlur = false;
        if (mCurrentTarget) {
          mCurrentTarget->GetContentForEvent(aEvent, getter_AddRefs(newFocus));
          const nsStyleUI* ui = mCurrentTarget->StyleUI();
          activeContent = mCurrentTarget->GetContent();

          // In some cases, we do not want to even blur the current focused
@@ -3381,7 +3380,8 @@ nsresult EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
          // we click on a non-focusable element like a <div>.
          // We have to use |aEvent->mTarget| to not make sure we do not check
          // an anonymous node of the targeted element.
          suppressBlur = (ui->mUserFocus == StyleUserFocus::Ignore);
          suppressBlur =
              mCurrentTarget->StyleUI()->UserFocus() == StyleUserFocus::Ignore;

          nsCOMPtr<Element> element = do_QueryInterface(aEvent->mTarget);
          if (!suppressBlur && element) {
@@ -4067,7 +4067,7 @@ static CursorImage ComputeCustomCursor(nsPresContext* aPresContext,
  // If we are falling back because any cursor before us is loading, let the
  // consumer know.
  bool loading = false;
  for (const auto& image : style.StyleUI()->mCursor.images.AsSpan()) {
  for (const auto& image : style.StyleUI()->Cursor().images.AsSpan()) {
    MOZ_ASSERT(image.image.IsImageRequestType(),
               "Cursor image should only parse url() types");
    uint32_t status;
@@ -5602,12 +5602,10 @@ bool EventStateManager::SetContentState(nsIContent* aContent,

    // check to see that this state is allowed by style. Check dragover too?
    // XXX Is this even what we want?
    if (mCurrentTarget) {
      const nsStyleUI* ui = mCurrentTarget->StyleUI();
      if (ui->mUserInput == StyleUserInput::None) {
    if (mCurrentTarget &&
        mCurrentTarget->StyleUI()->UserInput() == StyleUserInput::None) {
      return false;
    }
    }

    if (aState == NS_EVENT_STATE_ACTIVE) {
      if (aContent && !CanContentHaveActiveState(*aContent)) {
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ void HTMLOptGroupElement::GetEventTargetParent(EventChainPreVisitor& aVisitor) {
  if (nsIFrame* frame = GetPrimaryFrame()) {
    // FIXME(emilio): This poking at the style of the frame is broken unless we
    // flush before every event handling, which we don't really want to.
    if (frame->StyleUI()->mUserInput == StyleUserInput::None) {
    if (frame->StyleUI()->UserInput() == StyleUserInput::None) {
      return;
    }
  }
+1 −1
Original line number Diff line number Diff line
@@ -1948,7 +1948,7 @@ bool nsGenericHTMLFormElement::IsElementDisabledForEvents(WidgetEvent* aEvent,

  // FIXME(emilio): This poking at the style of the frame is slightly bogus
  // unless we flush before every event, which we don't really want to do.
  if (aFrame && aFrame->StyleUI()->mUserInput == StyleUserInput::None) {
  if (aFrame && aFrame->StyleUI()->UserInput() == StyleUserInput::None) {
    return true;
  }

+2 −2
Original line number Diff line number Diff line
@@ -185,8 +185,8 @@ nsresult nsXULPopupListener::FireFocusOnTargetContent(
  nsIFrame* targetFrame = aTargetContent->GetPrimaryFrame();
  if (!targetFrame) return NS_ERROR_FAILURE;

  const nsStyleUI* ui = targetFrame->StyleUI();
  bool suppressBlur = (ui->mUserFocus == StyleUserFocus::Ignore);
  const bool suppressBlur =
      targetFrame->StyleUI()->UserFocus() == StyleUserFocus::Ignore;

  RefPtr<Element> newFocusElement;

+1 −1
Original line number Diff line number Diff line
@@ -225,7 +225,7 @@ static nsIContent* GetClickableAncestor(
  // this check to any non-auto cursor. Such a change would also pick up things
  // like contenteditable or input fields, which can then be removed from the
  // loop below, and would have better performance.
  if (aFrame->StyleUI()->mCursor.keyword == StyleCursorKind::Pointer) {
  if (aFrame->StyleUI()->Cursor().keyword == StyleCursorKind::Pointer) {
    return aFrame->GetContent();
  }

Loading