Skip to content

Commit

Permalink
Backed out 3 changesets (bug 1597679) for Android debug build bustage…
Browse files Browse the repository at this point in the history
… at build/src/dom/base/nsContentAreaDragDrop.cpp

Backed out changeset 6a73b58e0db4 (bug 1597679)
Backed out changeset 90a172eff2de (bug 1597679)
Backed out changeset d4a156cf28ff (bug 1597679)

--HG--
rename : dom/html/TextControlElement.h => dom/html/nsITextControlElement.h
  • Loading branch information
ccoroiu committed Nov 24, 2019
1 parent 1243740 commit 84bf2b6
Show file tree
Hide file tree
Showing 28 changed files with 511 additions and 562 deletions.
1 change: 1 addition & 0 deletions accessible/generic/HyperTextAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "nsPersistentProperties.h"
#include "nsIScrollableFrame.h"
#include "nsIServiceManager.h"
#include "nsITextControlElement.h"
#include "nsIMathMLFrame.h"
#include "nsRange.h"
#include "nsTextFragment.h"
Expand Down
6 changes: 3 additions & 3 deletions accessible/html/HTMLFormControlAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
#include "nsIPersistentProperties2.h"
#include "nsISelectionController.h"
#include "nsIServiceManager.h"
#include "nsITextControlElement.h"
#include "nsITextControlFrame.h"
#include "nsNameSpaceManager.h"
#include "mozilla/dom/ScriptSettings.h"

#include "mozilla/EventStates.h"
#include "mozilla/FloatingPoint.h"
#include "mozilla/Preferences.h"
#include "mozilla/TextControlElement.h"
#include "mozilla/TextEditor.h"

using namespace mozilla;
Expand Down Expand Up @@ -385,8 +385,8 @@ bool HTMLTextFieldAccessible::DoAction(uint8_t aIndex) const {
}

already_AddRefed<TextEditor> HTMLTextFieldAccessible::GetEditor() const {
RefPtr<TextControlElement> textControlElement =
TextControlElement::FromNodeOrNull(mContent);
nsCOMPtr<nsITextControlElement> textControlElement =
do_QueryInterface(mContent);
if (!textControlElement) {
return nullptr;
}
Expand Down
3 changes: 1 addition & 2 deletions accessible/html/HTMLFormControlAccessible.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ class HTMLTextFieldAccessible final : public HyperTextAccessibleWrap {
HyperTextAccessibleWrap)

// HyperTextAccessible
MOZ_CAN_RUN_SCRIPT_BOUNDARY virtual already_AddRefed<TextEditor> GetEditor()
const override;
virtual already_AddRefed<TextEditor> GetEditor() const override;

// Accessible
virtual void Value(nsString& aValue) const override;
Expand Down
14 changes: 8 additions & 6 deletions dom/base/Document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include "mozilla/StaticPrefs_privacy.h"
#include "mozilla/StaticPrefs_security.h"
#include "mozilla/StorageAccess.h"
#include "mozilla/TextControlElement.h"
#include "mozilla/TextEditor.h"
#include "mozilla/URLDecorationStripper.h"
#include "mozilla/URLExtraData.h"
Expand Down Expand Up @@ -284,6 +283,7 @@
#include "nsDOMCaretPosition.h"
#include "nsViewportInfo.h"
#include "mozilla/StaticPtr.h"
#include "nsITextControlElement.h"
#include "nsIHttpChannelInternal.h"
#include "nsISecurityConsoleMessage.h"
#include "nsCharSeparatedTokenizer.h"
Expand Down Expand Up @@ -5009,12 +5009,14 @@ nsresult Document::TurnEditingOff() {

// Editor resets selection since it is being destroyed. But if focus is
// still into editable control, we have to initialize selection again.
if (nsFocusManager* fm = nsFocusManager::GetFocusManager()) {
if (RefPtr<TextControlElement> textControlElement =
TextControlElement::FromNodeOrNull(fm->GetFocusedElement())) {
RefPtr<TextEditor> textEditor = textControlElement->GetTextEditor();
nsFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm) {
Element* element = fm->GetFocusedElement();
nsCOMPtr<nsITextControlElement> txtCtrl = do_QueryInterface(element);
if (txtCtrl) {
RefPtr<TextEditor> textEditor = txtCtrl->GetTextEditor();
if (textEditor) {
textEditor->ReinitializeSelection(*textControlElement);
textEditor->ReinitializeSelection(*element);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion dom/base/Document.h
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,7 @@ class Document : public nsINode,
/* Midas implementation */
nsCommandManager* GetMidasCommandManager();

MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult TurnEditingOff();
nsresult TurnEditingOff();

// MOZ_CAN_RUN_SCRIPT_BOUNDARY because this is called from all sorts
// of places, and I'm pretty sure the exact ExecCommand call it
Expand Down
7 changes: 3 additions & 4 deletions dom/base/Element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
#include "mozilla/RestyleManager.h"
#include "mozilla/ScrollTypes.h"
#include "mozilla/SizeOfState.h"
#include "mozilla/TextControlElement.h"
#include "mozilla/TextEditor.h"
#include "mozilla/TextEvents.h"
#include "mozilla/dom/DirectionalityUtils.h"
Expand Down Expand Up @@ -134,6 +133,7 @@
#include "mozilla/dom/NodeListBinding.h"

#include "nsStyledElement.h"
#include "nsITextControlElement.h"
#include "nsITextControlFrame.h"
#include "nsISupportsImpl.h"
#include "mozilla/dom/CSSPseudoElement.h"
Expand Down Expand Up @@ -3568,9 +3568,8 @@ void Element::InsertAdjacentText(const nsAString& aWhere,
}

TextEditor* Element::GetTextEditorInternal() {
TextControlElement* textControlElement = TextControlElement::FromNode(this);
return textControlElement ? MOZ_KnownLive(textControlElement)->GetTextEditor()
: nullptr;
nsCOMPtr<nsITextControlElement> textCtrl = do_QueryInterface(this);
return textCtrl ? textCtrl->GetTextEditor() : nullptr;
}

nsresult Element::SetBoolAttr(nsAtom* aAttr, bool aValue) {
Expand Down
2 changes: 1 addition & 1 deletion dom/base/Element.h
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ class Element : public FragmentOrElement {
/**
* Locate a TextEditor rooted at this content node, if there is one.
*/
MOZ_CAN_RUN_SCRIPT_BOUNDARY mozilla::TextEditor* GetTextEditorInternal();
mozilla::TextEditor* GetTextEditorInternal();

/**
* Gets value of boolean attribute. Only works for attributes in null
Expand Down
14 changes: 7 additions & 7 deletions dom/base/nsContentAreaDragDrop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "nsIContent.h"
#include "nsIContentInlines.h"
#include "nsIImageLoadingContent.h"
#include "nsITextControlElement.h"
#include "nsUnicharUtils.h"
#include "nsIURL.h"
#include "nsIURIMutator.h"
Expand All @@ -48,7 +49,6 @@
#include "nsIMIMEInfo.h"
#include "nsRange.h"
#include "BrowserParent.h"
#include "mozilla/TextControlElement.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/HTMLAreaElement.h"
#include "mozilla/dom/HTMLAnchorElement.h"
Expand Down Expand Up @@ -513,11 +513,11 @@ nsresult DragDataProducer::Produce(DataTransfer* aDataTransfer, bool* aCanDrag,
nsIContent* editingElement = mSelectionTargetNode->IsEditable()
? mSelectionTargetNode->GetEditingHost()
: nullptr;
RefPtr<TextControlElement> textControlElement =
TextControlElement::GetTextControlElementFromEditingHost(editingElement);
if (textControlElement) {
nsISelectionController* selcon =
textControlElement->GetSelectionController();
nsCOMPtr<nsITextControlElement> textControl =
nsITextControlElement::GetTextControlElementFromEditingHost(
editingElement);
if (textControl) {
nsISelectionController* selcon = textControl->GetSelectionController();
if (selcon) {
selection =
selcon->GetSelection(nsISelectionController::SELECTION_NORMAL);
Expand Down Expand Up @@ -556,7 +556,7 @@ nsresult DragDataProducer::Produce(DataTransfer* aDataTransfer, bool* aCanDrag,
return NS_OK;
}

if (isChromeShell && textControlElement) {
if (isChromeShell && textControl) {
// Only use the selection if the target node is in the selection.
if (!selection->ContainsNode(*mSelectionTargetNode, false, IgnoreErrors()))
return NS_OK;
Expand Down
4 changes: 3 additions & 1 deletion dom/base/nsContentUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4087,7 +4087,9 @@ nsresult nsContentUtils::DispatchInputEvent(Element* aEventTargetElement,
}
#ifdef DEBUG
else {
MOZ_ASSERT(!aEventTargetElement->IsTextControlElement(),
nsCOMPtr<nsITextControlElement> textControlElement =
do_QueryInterface(aEventTargetElement);
MOZ_ASSERT(!textControlElement,
"The event target may have editor, but we've not known it yet.");
}
#endif // #ifdef DEBUG
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsCopySupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ bool nsCopySupport::FireClipboardEvent(EventMessage aEventMessage,
// there is unmasked range but it's collapsed or it'll be masked
// automatically, the selected password shouldn't be copied into the
// clipboard.
if (RefPtr<HTMLInputElement> inputElement =
if (HTMLInputElement* inputElement =
HTMLInputElement::FromNodeOrNull(sourceContent)) {
if (TextEditor* textEditor = inputElement->GetTextEditor()) {
if (textEditor->IsPasswordEditor() &&
Expand Down
1 change: 1 addition & 0 deletions dom/base/nsIContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class nsAttrValue;
class nsAttrName;
class nsTextFragment;
class nsIFrame;
class nsITextControlElement;

namespace mozilla {
class EventChainPreVisitor;
Expand Down
2 changes: 0 additions & 2 deletions dom/base/nsINode.h
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,6 @@ class nsINode : public mozilla::dom::EventTarget {
*/
bool IsElement() const { return GetBoolFlag(NodeIsElement); }

virtual bool IsTextControlElement() const { return false; }

/**
* Return this node as an Element. Should only be used for nodes
* for which IsElement() is true. This is defined inline in Element.h.
Expand Down
1 change: 1 addition & 0 deletions dom/events/EventStateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include "mozilla/dom/Document.h"
#include "nsIFrame.h"
#include "nsFrameLoaderOwner.h"
#include "nsITextControlElement.h"
#include "nsIWidget.h"
#include "nsPresContext.h"
#include "nsGkAtoms.h"
Expand Down
6 changes: 3 additions & 3 deletions dom/events/WheelHandlingHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs_mousewheel.h"
#include "mozilla/StaticPrefs_test.h"
#include "mozilla/TextControlElement.h"
#include "mozilla/dom/WheelEventBinding.h"
#include "nsCOMPtr.h"
#include "nsContentUtils.h"
Expand All @@ -24,6 +23,7 @@
#include "mozilla/dom/Document.h"
#include "DocumentInlines.h" // for Document and HTMLBodyElement
#include "nsIScrollableFrame.h"
#include "nsITextControlElement.h"
#include "nsITimer.h"
#include "nsPluginFrame.h"
#include "nsPresContext.h"
Expand Down Expand Up @@ -87,11 +87,11 @@ WheelHandlingUtils::GetDisregardedWheelScrollDirection(const nsIFrame* aFrame) {
if (!content) {
return Nothing();
}
TextControlElement* textControlElement = TextControlElement::FromNodeOrNull(
nsCOMPtr<nsITextControlElement> ctrl = do_QueryInterface(
content->IsInNativeAnonymousSubtree()
? content->GetClosestNativeAnonymousSubtreeRootParent()
: content);
if (!textControlElement || !textControlElement->IsSingleLineTextControl()) {
if (!ctrl || !ctrl->IsSingleLineTextControl()) {
return Nothing();
}
// Disregard scroll in the block-flow direction by mouse wheel on a
Expand Down
Loading

0 comments on commit 84bf2b6

Please sign in to comment.