Граф коммитов

5452 Коммитов

Автор SHA1 Сообщение Дата
Ciure Andrei b37e54e443 Backed out 1 changesets (bug 1443902) for reftest failures reftest/tests/editor/reftests/1443902-2.html CLOSED TREE
Backed out changeset 4c31558d3481 (bug 1443902)
2018-07-10 05:50:31 +03:00
Makoto Kato 98611161ee Bug 1443902 - Reinitilize selection after destroying nsIEditingSession. r=masayuki
When setting contenteditable to false, editing session destroys HTMLEditor.
Destroying HTMLEditor means that selection visibility is reset by
FinalizeSelection.

So after calling TearDownEditorOnWindow on nsHTMLDocument, we should initialize
selection visibility if current focus is text control that has editor.

MozReview-Commit-ID: 4V8kZtOtKO3

--HG--
extra : rebase_source : 773c06bb22cf2da24fd11be9be8d7b0376da3e36
2018-07-09 16:53:47 +09:00
Masayuki Nakano 2b43129579 Bug 1473515 - Make AutoDisableUndo restores enabled state of undo/redo with previous number of maximum transactions r=m_kato
Calling EditorBase::EnableUndoRedo() without argument means that editor supports
unlimited undo/redo stack.  AutoDisableUndo class calls it without argument
when it needs to restore undo/redo feature.

However, <input type="text"> and <textarea> limits number of maximum
transactions up to 1,000, perhaps for footprint.  So, AutoDisableUndo should
store the last number of maximum transactions before disabling undo/redo from
the constructor.

MozReview-Commit-ID: CoI6ZXyTd3X

--HG--
extra : rebase_source : e2b9af17e5857dcc0a6781e254e45fdb790c9a9e
2018-07-05 19:44:23 +09:00
Masayuki Nakano 98a833407e Bug 1467794 - Split TextEditor::DeleteSelectionAsAction() to itself and TextEditor::DeleteSelectionAsSubAction() r=m_kato
TextEditor::DeleteSelectionAsAction() is called even if it's a part of edit
action.  For example, it's called to prepare for inserting text.

For bug 1465702, editor itself and edit rules classes should not call
public DeleteSelectionAsAction() directly.  Therefore, this patch creates
DeleteSelectionAsSubAction() for internal use.

Note that this patch adds NS_ASSERTION() to detect wrong caller.  However,
it cannot distinguish if the call is valid, for example, it's allowed to
call DeleteSelectionAsSelection() even if it's handling an edit action but
the method is called via mutation event listener.  So, we need to allow
some assertions with some tests.  But unfortunately, 1405747.html uses
mutation event listener too many times (about 1,000 times) and the number
of assertion isn't stable.  Therefore, this patch makes the test stop using
the mutation event listener 2nd time since I can reproduce the crash with
ESR 52 at the 2nd time.

MozReview-Commit-ID: 1TWaypmnoCC

--HG--
extra : rebase_source : a6a4fb1cbcaf2ab6f10c5f3e7168a6bc0fcb02ed
2018-06-29 20:16:50 +09:00
Makoto Kato afbbfcc910 Bug 1405897 - Move assertion before setting resizer attribute. r=masayuki
This assertion was added by review comment of bug 1487945. Since mutation event
handler of this test case hides resizer, this case hits this assertion.

Although 4th parameter of SetAttr can control mutation event, if this event
isn't fired, another test case (layout/base/tests/test_bug558663.html) becomes
failure.

So we should move the assertion before setting resizer attribute.

Differential Revision: https://phabricator.services.mozilla.com/D1854

--HG--
extra : moz-landing-system : lando
2018-06-29 04:47:21 +00:00
Sylvestre Ledru 6dd1af0903 Bug 1471596 - Simplify the code in HTMLEditor::GetSelectedOrParentTableElement r=m_kato
the first branch of the if was useless

MozReview-Commit-ID: GgKYOcI3sGX

--HG--
extra : rebase_source : eacfa0e86ae259e7940f92e1ad8e765949e9412e
2018-06-27 15:40:43 +02:00
Jeff Gilbert 5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Margareta Eliza Balazs 14cb8f1c23 Merge inbound to mozilla-central. a=merge 2018-06-26 17:53:19 +03:00
Chris Peterson 2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Makoto Kato 8bd7e4fabf Bug 1471115 - Remove unused methods in nsIHTMLEditor. r=masayuki
insertHTMLWithContext, getIndentState, setBodyAttribute and
getSelectionContainer are unused from script (inc. c-c and bluegriffon).

Differential Revision: https://phabricator.services.mozilla.com/D1822
2018-06-26 04:29:36 +00:00
Emilio Cobos Álvarez 6a2e3606ae Bug 1470361: Remove nsIEditorStyleSheets.addStyleSheet / removeStyleSheet / replaceStyleSheet. r=m_kato
These are effectively equivalent to appending a <link> element to the body, are
not unused, and bring in a fair amount of complexity because even though they're
owned by the document and stored in the document's mStyleSheets, they're not
owned by it per se, which causes confusion.

Unless I've missed something, both bluegriffon and common-central use the
*Override APIs, which this patch leaves untouched.

MozReview-Commit-ID: EOSMOHj3A95
2018-06-25 10:46:38 +02:00
Emilio Cobos Álvarez 9bed821e90 Bug 1467722: Don't return null for getComputedStyle when there's no pres shell. r=heycam
We need to deal with this case regardless from getPropertyValue, and this causes
pain and webcompat issues.

MozReview-Commit-ID: Gbpzq0N4O2T
2018-06-19 11:47:16 +02:00
Markus Stange 2fa0e26050 Bug 426246 - cmd_deleteToBeginningOfLine should delete to the beginning of the line, not the whole line. r=masayuki
MozReview-Commit-ID: 3OTOSz8u9Co

--HG--
extra : rebase_source : a2f9619c41add013e09cbb10b8ea21206f5709b4
2018-06-14 15:42:16 -04:00
Makoto Kato d7d2ea2a38 Bug 1468708 - Part 6. Move HTMLEditorCommands and HTMLEditorController to libeditor. r=masayuki
HTMLEditorController and HTMLEditorCommands is for execCommand, so we should
move from composer to libeditor since HTML editor code is in libeditor.

MozReview-Commit-ID: DEBoTqUsQnw

--HG--
rename : editor/composer/HTMLEditorCommands.cpp => editor/libeditor/HTMLEditorCommands.cpp
rename : editor/composer/HTMLEditorCommands.h => editor/libeditor/HTMLEditorCommands.h
rename : editor/composer/HTMLEditorController.cpp => editor/libeditor/HTMLEditorController.cpp
rename : editor/composer/HTMLEditorController.h => editor/libeditor/HTMLEditorController.h
rename : editor/composer/HTMLEditorDocumentCommands.cpp => editor/libeditor/HTMLEditorDocumentCommands.cpp
extra : rebase_source : 0b9627ac89803212da3377db3dfefedc3b57ce73
2018-06-13 14:49:06 -07:00
Andi-Bogdan Postelnicu d6e2c6a0f3 Bug 1453795 - Editor - Initialize member fields in classes/ structures. r=masayuki 2018-06-13 23:14:16 +03:00
Margareta Eliza Balazs bf81d741ff Merge inbound to mozilla-central. a=merge 2018-06-11 12:36:11 +03:00
Joel Maher 50b91c0a14 Bug 1405428 - skip-if = verify on mochitests which do not pass test-verify. r=gbrown 2018-06-10 05:01:47 -04:00
Masayuki Nakano 65a183e7d5 Bug 1467692 - Create EditorBase::SelectAllInternal() for internal use r=m_kato
For preparing to fix bug 1465702, we need to split public methods of editor
which are used by both outside and itself or friends.

SelectAll() is used by both outside and TextEditor.  So, we need to create
SelectAllInternal() and make TextEditor use it instead.

MozReview-Commit-ID: JtIlrfBYBSD

--HG--
extra : rebase_source : 5c29a9c1bb99f457f66f320b873b2c7b0f93fcde
2018-06-07 22:30:14 +09:00
Ryan VanderMeulen 8e415eb4c0 Merge m-c to autoland. a=merge 2018-06-09 11:41:36 -04:00
Bogdan Tara 04b9cbbc2b Merge autoland to mozilla-central. a=merge 2018-06-09 18:34:58 +03:00
Masayuki Nakano 235de70472 Bug 1467693 - Merge EditorBase::SwitchTextDirection() and EditorBase::SwitchTextDirectionTo() r=m_kato
There are two similar methods, but they are created with copy & paste.
So, the common code should be merged into new method, SetTextDirection().

Additionally, EditorBase::SwitchTextDirection() is a scriptable method but
nobody uses this from JS.  So, we can make it from nsIEditor and this
patch renames it to ToggleTextDirection() since current name is too
similar to SwitchTextDirectionTo().

MozReview-Commit-ID: BX3M1OKxiD5

--HG--
extra : rebase_source : 74a5ff65adc96ba69792f2e63daf14828c505270
2018-06-07 23:26:59 +09:00
Masayuki Nakano a6f0eec408 Bug 1467691 - Make some methods of EditorBase non-public r=m_kato
This moves NotifyEditorObservers() and GetInputEventTargetContent() into
protected member which should not be used by friends.

And also this moves IsModifiableNode() into protected member which can be
used by friends.

MozReview-Commit-ID: AxDBgTVED3V

--HG--
extra : rebase_source : 979c6cb0d075b3fd0106bd1c381aa3ef3b98ba78
2018-06-06 13:30:44 +09:00
Masayuki Nakano bb000aa73b Bug 1467690 - Make HTMLEditor use MaybeCollapseSelectionAtFirstEditableNode(false) instead of BeginningOfDocument() r=m_kato
HTMLEditor::BeginningOfDocument() is an XPCOM method and it just calls
MaybeCollapseSelectionAtFirstEditableNode(false).  So, HTMLEditor can call
MaybeCollapseSelectionAtFirstEditableNode(false) directly.

MozReview-Commit-ID: 8x4j0AwzISl

--HG--
extra : rebase_source : 40a9e9eea95b22c59dc007f6babfc518205702ea
2018-06-05 21:18:05 +09:00
Olli Pettay 5dad9cd69b Bug 1467790 - Inline nsINode::IsEditable, r=masayuki 2018-06-08 15:57:13 -04:00
Makoto Kato ef31f52f39 Bug 1467670 - Devirtualize InsertFromDrop. r=masayuki
InsertFromDrop is implemented on TextEditor only, so it can do devirtualize
this method.  Also, this method is only called by drop event handler of
EditorEventListener, so it should rename to better name (OnDrop).

Differential Revision: https://phabricator.services.mozilla.com/D1592
2018-06-08 05:19:51 +00:00
Makoto Kato b027fd188e Bug 1423776 - Return error when splitted node might be orphan. r=masayuki
This crash occurs when start container of range for range updater is nullptr
in GetNodesForOperation.

Splitted node by SplitNodeDeepWithTransaction can return orphan node, so we
should return error when splitted node is orphan node.

MozReview-Commit-ID: 3ySdzc9FAzL

--HG--
extra : rebase_source : 3c6f37e81641751d32b8a9777b8362baad301ecb
2018-06-04 16:31:38 +09:00
Makoto Kato 35f52b478b Bug 1466469 - Devirtialize nsIHTMLEditor.GetActiveEditingHost. r=masayuki
Since GetActiveEditingHost is noscript method, we should move this from
nsIHTMLEditor to HTMLEditor.

MozReview-Commit-ID: 3jLHSstixxk

--HG--
extra : rebase_source : 72e992a6c5643e1d0f0f5454f803139716c6309c
2018-06-04 17:45:34 +09:00
Miko Mynttinen 4c85ef17cc Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj
MozReview-Commit-ID: HpdFXqQdIOO

--HG--
extra : rebase_source : 1e7eea4f2d4ec16ec0c559a8afb26976ddbf4d07
2018-06-01 17:59:07 +02:00
arthur.iakab 7e765f798b Backed out 2 changesets (bug 1465060) for build bustages on security/sandbox/linux/reporter/SandboxReporter.cpp
Backed out changeset 7c8905b6b226 (bug 1465060)
Backed out changeset 10446073eca8 (bug 1465060)
2018-06-03 19:25:41 +03:00
Miko Mynttinen 8d9dc85cd4 Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj
MozReview-Commit-ID: HpdFXqQdIOO

--HG--
extra : rebase_source : 619d0e0ff63a2453c80f0c4d9beb906d43fa9b01
2018-06-01 17:59:07 +02:00
Boris Zbarsky 15b087c696 Bug 1465875 part 4. Eliminate random mentions of nsIDOMNSEditableElement. r=qdot 2018-06-01 22:35:23 -04:00
Boris Zbarsky 0cf65db1d3 Bug 1465875 part 2. Eliminate use of "instanceof nsIDOMNSEditablElement". r=qdot 2018-06-01 22:35:22 -04:00
Boris Zbarsky c7f378d7ab Bug 1465875 part 1. Eliminate pointless QIs to nsIDOMNSEditableElement. r=qdot
We expose the relevant APIs on textarea and input elements anyway
(chromeonly).  The QIs will throw on a non-input or non-textarea element, but
none of these consumers expect that to happen.
2018-06-01 22:35:22 -04:00
Emilio Cobos Álvarez fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Nazım Can Altınova 361380987c Bug 1464496 - Part 1: Merge ServoDeclarationBlock and DeclarationBlock r=emilio
MozReview-Commit-ID: By9fV70Oq0K

--HG--
extra : rebase_source : 837afe9c33b21d7db41ff19d3aaf6cf3e9eedbdf
2018-05-30 18:15:25 +02:00
Andreea Pavel 38bcf897f1 Merge mozilla-inbound to mozilla-central. a=merge 2018-05-31 13:04:21 +03:00
Emilio Cobos Álvarez fe09ffd3af Bug 1465478: Introduce Element::FromNode. r=smaug
And use it in a couple places I noticed.

MozReview-Commit-ID: 8baSMrbdEbF
2018-05-31 02:46:10 +02:00
Masayuki Nakano 908dbbfada Bug 1463985 - part 27: Replace EditSubAction::ignore with EditSubAction::eReplaceHeadWithHTMLSource and EditSubAction::eCreateBogusNode r=m_kato
EditSubAction::ignore is declared for making HTMLEditRules::AfterEditInner()
ignores post-processing of handling edit action.  Currently, this is used only
by TextEditRules::CreateBogusNodeIfNeeded() and
HTMLEditor::ReplaceHeadContentsWithHTML().  So, we should make them use
specific EditSubAction values which explain what they do and make
HTMLEditRules::AfterEditInner() ignore both of them.

MozReview-Commit-ID: JSHcgPfTrOE

--HG--
extra : rebase_source : c054c2db257dda7e1e3ace01f8e8831e07268f7e
2018-05-29 00:06:24 +09:00
Masayuki Nakano cc803498e8 Bug 1463985 - part 26: Rename EditSubAction::decreaseZIndex and EditSubAction::increaseZIndex to EditSubAction::eDecreaseZIndex and EditSubAction::eIncreaseZIndex r=m_kato
MozReview-Commit-ID: 87Pux0xZOM

--HG--
extra : rebase_source : cc89eb98558b32e31867ef9f6b1ab74acabadea5
2018-05-28 23:52:16 +09:00
Masayuki Nakano 0fe0c32b1a Bug 1463985 - part 25: Rename EditSubAction::setAbsolutePosition and EditSubAction::removeAbsolutePosition to EditSubAction::eSetPositionToAbsolute and EditSubAction::eSetPositionToStatic r=m_kato
MozReview-Commit-ID: DiyCAkGw2uo

--HG--
extra : rebase_source : e10f7af40ac3a21350526f803801683de5696182
2018-05-28 23:48:39 +09:00
Masayuki Nakano a48c9c34aa Bug 1463985 - part 24: Rename EditSubAction::resetTextProperties to EditSubAction::eRemoveAllTextProperties r=m_kato
MozReview-Commit-ID: 1QKUg361MSY

--HG--
extra : rebase_source : 7ed2f41e20e498e105fac8a88be90157dd812fa1
2018-05-28 23:40:45 +09:00
Masayuki Nakano a9c4b1bc58 Bug 1463985 - part 23: Rename EditSubAction::htmlPaste and EditSubAction::loadHTML to EditSubAction::ePasteHTMLContent and EditSubAction::eInsertHTMLSource r=m_kato
MozReview-Commit-ID: B1Ag1yP5PXl

--HG--
extra : rebase_source : 47b20d72c53f8c97c4ccbb20960d5bf571d9cde6
2018-05-28 23:37:12 +09:00
Masayuki Nakano 4db8c8a594 Bug 1463985 - part 22: Rename EditSubAction::insertQuotation to EditSubAction::eInsertQuotation r=m_kato
According to this usage, perhaps, we can remove this from EditSubAction and
this should be moved to new EditAction.

MozReview-Commit-ID: HzfcC051rNB

--HG--
extra : rebase_source : e42cade8436b082b4dc2adfcbbac75e17779cfd7
2018-05-28 23:22:19 +09:00
Masayuki Nakano 84aca99c88 Bug 1463985 - part 21: Rename EditSubAction::insertElement to EditSubAction::eInsertElement r=m_kato
MozReview-Commit-ID: 6nrm1zJ968f

--HG--
extra : rebase_source : 633824e9564dddd9d9b80414ab07e7aa960b8fb1
2018-05-28 23:13:41 +09:00
Masayuki Nakano 1affc933f7 Bug 1463985 - part 20: Rename EditSubAction::makeDefListItem to EditSubAction::eCreateOrChangeDefinitionList r=m_kato
MozReview-Commit-ID: 1ucTdFEjasz

--HG--
extra : rebase_source : 1c00f4b480ebc8c30ef5d6979319f6db01235dc9
2018-05-28 23:08:50 +09:00
Masayuki Nakano 220ec91e25 Bug 1463985 - part 19: Rename EditSubAction::removeList to EditSubAction::eRemoveList r=m_kato
MozReview-Commit-ID: DgsZwANcEdF

--HG--
extra : rebase_source : e0032e957ccc4448e210783a67ef83c1257c0a3b
2018-05-28 23:05:00 +09:00
Masayuki Nakano 7d6ea95d32 Bug 1463985 - part 18: Rename EditSubAction::makeBasicBlock to EditSubAction::eCreateOrRemoveBlock r=m_kato
MozReview-Commit-ID: 3GuscIcaWe9

--HG--
extra : rebase_source : 3f580a1d60296c232a70156d68a18a7b13c9d640
2018-05-28 23:01:19 +09:00
Masayuki Nakano 9a8bb4d35e Bug 1463985 - part 17: Rename EditSubAction::align to EditSubAction::eSetOrClearAlignment r=m_kato
MozReview-Commit-ID: KausJ4mihk9

--HG--
extra : rebase_source : 48fd37f2578714f46c0fcbf84788f9b0c69d3608
2018-05-28 22:51:31 +09:00
Masayuki Nakano b43f12de7f Bug 1463985 - part 16: Rename EditSubAction::indent and EditSubAction::outdent to EditSubAction::eIndent and EditSubAction::eOutdent r=m_kato
MozReview-Commit-ID: 2JDyYLT8V7Q

--HG--
extra : rebase_source : 5b0ebe706e8144fa6cbdf1ee16573d5166ef8028
2018-05-28 22:42:31 +09:00
Masayuki Nakano 004c690a96 Bug 1463985 - part 15: Rename EditSubAction::makeList to EditSubAction::eCreateOrChangeList r=m_kato
MozReview-Commit-ID: 4Mkh3Mfm6fY

--HG--
extra : rebase_source : 5509f3f2e05ce4fe25965ca69334309a9109a791
2018-05-28 22:36:19 +09:00