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

7898 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 1bbc0d5920 Bug 1387317 - part4: Make editor flag setters use new AddFlags() or RemoveFlags() if useful r=m_kato
MozReview-Commit-ID: EMDeGfK37Lx

--HG--
extra : rebase_source : 8a2b4e809c608649fbb41edd32d2165db7e77516
2017-08-08 12:36:29 +09:00
Masayuki Nakano 8437aa287b Bug 1387317 - part3: HTMLEditor should use RefPtr<HTMLEditor> rather than nsCOMPtr<nsIHTMLEditor> for kungFuDeathGrip r=m_kato
MozReview-Commit-ID: 1F6wwjvdD8H

--HG--
extra : rebase_source : 23c2fefa67e11b584868d349bd043148c4b91770
2017-08-08 12:06:10 +09:00
Masayuki Nakano 7c54bc878b Bug 1387317 - part2: EditorEventListener should stop using interface methods as far as possible r=m_kato
MozReview-Commit-ID: EPQeBez2tJh

--HG--
extra : rebase_source : b18b3399f703d3cdcb6f26cec3fcb8f707fb9519
2017-08-08 11:25:36 +09:00
Masayuki Nakano 20fc8ab477 Bug 1387317 - part1: Make AutoSelectionSetterAfterTableEdit use HTMLEditor instead of nsITableEditor r=m_kato
nsITableEditor is now a builtin class.  So, it's implemented only by HTMLEditor.  Therefore, AutoSelectionSetterAfterTableEdit can use HTMLEditor.

Then, nsITableEditor.setSelectionAfterTableEdit() can be removed from nsITableEditor and moved to HTMLEditor as non-virtual method since nobody uses it from JS.

MozReview-Commit-ID: KnN6Fw4TYyn

--HG--
extra : rebase_source : 48412a5f81f30d9ada47550fdb4d1ee0d88de6f4
2017-08-08 10:57:19 +09:00
Carsten "Tomcat" Book bcbc42d4e3 Merge mozilla-central to mozilla-inbound 2017-08-15 13:09:01 +02:00
Yoshi Huang 60b7d9f697 Bug 1390398: fix failures on windows for new data: URI inheritance model. r=smaug 2017-08-15 18:09:28 +08:00
Carsten "Tomcat" Book 6b36e00b7c merge mozilla-inbound to mozilla-central a=merge 2017-08-15 11:42:11 +02:00
Makoto Kato 357fdca523 Bug 1390053 - Enable editor/libeditor/tests/test_bug830600.html on mochitest-e10s. r=masayuki
This test is turned off by bug 1269209 on e10s.  But there is no exactly reason why this test on e10s is turned off.

Although I run this test on e10s now, it seems to pass this.  So we should turn on this test even if e10s.

MozReview-Commit-ID: JHQP2ZYvsHL

--HG--
extra : rebase_source : 2bc45f0d2b5cc99bad93267f40191866264af414
2017-08-14 18:29:40 +09:00
Masayuki Nakano 9ee491b79f Bug 1388001 - part3: Remove nsIEditor argument of nsIHTMLDocument::TearingDownEditor() since it's unused r=smaug
nsIHTMLDocument::TearingDownEditor() takes nsIEditor as an argument.  However, it's not used in it.  So, we can remove it.

MozReview-Commit-ID: KUmIsnVGB6H

--HG--
extra : rebase_source : ddd344b9df18e0b33d54d2f99e6335449f55df81
2017-08-07 14:25:52 +09:00
Masayuki Nakano d66337db9a Bug 1388001 - part2: nsEditingSession should treat editor as HTMLEditor r=m_kato
nsEditingSession should treat editor as HTMLEditor in its internal handling.

MozReview-Commit-ID: 51SfY4oeq3p

--HG--
extra : rebase_source : 90535267e62de17755fff9f21b6a0f74244d849a
2017-08-04 22:53:28 +09:00
Masayuki Nakano fc87c572fa Bug 1388001 - part1: Create nsIEditingSession::GetHTMLEditorForWindow() r=smaug
Some users of HTMLEditor retrieve pointer to editors with nsIEditingSession::GetEditorForWindow() but it returns nsIEditor.  So, there should be a method which returns HTMLEditor*.

MozReview-Commit-ID: Bzc1LIlTSDF

--HG--
extra : rebase_source : f6fb3e5852809487883e3e6fedda9580206b2cb5
2017-08-12 11:44:16 +09:00
Sebastian Hengst d98ea1f774 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: FzIkMLHbOh2
2017-08-14 01:30:32 +02:00
Aryeh Gregor 99a150fe57 Bug 1359397 - Don't allow Selection in nodes not in the document; r=masayuki
This matches the spec and Chrome, and seems to bring us closer to Edge
and WebKit as well.  It also matches our own behavior for addRange(),
which was changed in bug 1341137.

For collapse and selectAllChildren, we match the tests and browsers, but
the spec is incorrect at the time of this writing:
https://github.com/w3c/selection-api/pull/86

The removeAllRanges test hadn't been updated for the spec change.

MozReview-Commit-ID: DTK8283k5IP

--HG--
extra : rebase_source : 54701e7136c33ebce651d5f74c3dc1d8b944f9a3
2017-08-10 15:02:08 +03:00
Kyle Machulis 649634a721 Bug 1387184 - Remove nsIDOMHTMLEmbedElement; r=bz
Removes nsIDOMHTMLEmbedElement and all references. HTML elements are
now handled by WebIDL. With the deprecation of extensions, XPCOM
interfaces to HTML elements are no longer needed.

MozReview-Commit-ID: DI4XVvdgPDI

--HG--
extra : rebase_source : 74bd92619e3d1db04c3dd40ec3022474fe1d647c
2017-08-09 12:05:08 -07:00
Wes Kocher 936a9461f6 Merge inbound to m-c a=merge
MozReview-Commit-ID: KRQeIGmhAPA
2017-08-10 18:14:34 -07:00
Sebastian Hengst 51d351f567 merge mozilla-central to mozilla-inbound. r=merge a=merge 2017-08-10 17:41:11 +02:00
Ehsan Akhgari 3ab3b25fad Bug 1388917 - Fix moving of SelectionState in PlaceholderTransaction's constructor; r=masayuki 2017-08-10 08:35:19 -04:00
Masayuki Nakano 19dc3194d7 Bug 1319340 - part9: Make nsComposerDocumentCommands use concrete class when calling methods of editor r=m_kato
MozReview-Commit-ID: 15WBfUpfo6L

--HG--
extra : rebase_source : 0e729ea9f2a37555836cca869ea1da4174895960
2017-08-07 18:27:16 +09:00
Masayuki Nakano de893ee82e Bug 1319340 - part8: EditorCommands should use TextEditor instead of nsIEditor, nsIPlaintextEditor and nsIEditorMailSupport r=m_kato
EditorCommands implements common edit commands.  So, we can use TextEditor even if the instance is HTMLEditor.

Then, EditorCommands can use non-virtual methods of the concrete classes.

MozReview-Commit-ID: DgKHqC0osRb

--HG--
extra : rebase_source : e9abd7ef8b48cfdc65bbeb56ebe81dc0548005dd
2017-08-04 20:41:20 +09:00
Masayuki Nakano 2978474960 Bug 1319340 - part7: Fix some warnings in nsComposerCommands.h r=m_kato
MozReview-Commit-ID: A0KnOCCWqYZ

--HG--
extra : rebase_source : 35f0ad7b68e8c010eb98532e50bfc107abeefb7f
2017-08-04 18:50:26 +09:00
Masayuki Nakano b5b8d1064d Bug 1319340 - part6: Implement some interface methods as non-virtual methods of EditorBase or HTMLEditor r=m_kato
nsComposerCommands uses some simple getter methods.  They can be simpler non-virtual methods.  So, we should do it.

Note that this changes that EditorBase::GetIsSelectionEditable() won't return error.  However, it has returned error only when selection controller isn't available.  That means that the selection controller has been destroyed and the editor will be destroyed.  So, this must not be problem since it returns false (non-editable) instead and won't break any behavior since the editor won't be editable by users nor JS anymore.

MozReview-Commit-ID: E9ccFspG6na

--HG--
extra : rebase_source : bcd1314cb386fcaf175adabfefde5885decd87c0
2017-08-04 18:30:13 +09:00
Masayuki Nakano efae799abd Bug 1319340 - part5: Make nsComposerCommands use concrete class when calling methods of editor r=m_kato
Compiler may can optimize to call virtual methods at build time if we call them with concrete classes because some of them may have final keyword.

Even if not so, we can optimize some methods with creating non-virtual methods.

MozReview-Commit-ID: K3bRlc0URml

--HG--
extra : rebase_source : 4a76635c7aed29501f71ae74f3f73e2b22ca219e
2017-08-04 17:12:01 +09:00
Masayuki Nakano 6b4db6ec7f Bug 1319340 - part4: SetState() of nsComposerCommands should take HTMLEditor* instead of nsIEditor* r=m_kato
All SetState() methods in nsComposerCommands require HTMLEditor.  So, it should take HTMLEditor* rather than nsIEditor*.

MozReview-Commit-ID: AVbnRsMsmeY

--HG--
extra : rebase_source : 23bcc585a045a39620102c4fef9c1a9e12b9ea37
2017-08-04 16:20:56 +09:00
Masayuki Nakano 505c529148 Bug 1319340 - part3: ToggleState() in nsComposerCommands should take HTMLEditor* instead of nsIEditor* r=m_kato
Similar to GetCurrentState(), all ToggleState() methods require HTMLEditor.  So, they should take HTMLEditor* instead of nsIEditor*.

MozReview-Commit-ID: BwM6WRKFn6Q

--HG--
extra : rebase_source : 425b7b405b5881b97e8113c3ab88e9d0514b6a07
2017-08-04 15:57:57 +09:00
Masayuki Nakano cf8f0ec404 Bug 1319340 - part2: GetCurrentState() of the classes in nsComposerCommands should take HTMLEditor instead of nsIEditor r=m_kato
All GetCurrentState() methods in nsComposerCommands require HTMLEditor but its argument is nsIEditor*.  So, it should take HTMLEditor* and it shouldn't be called if given editor isn't HTMLEditor since it's virtual method.

MozReview-Commit-ID: HsvYJN8hIxN

--HG--
extra : rebase_source : f8f9c8de902af5311771b71a96c76d63325970a5
2017-08-04 15:41:42 +09:00
Masayuki Nakano 722bf07347 Bug 1319340 - part1 Move AsTextEditor() and AsHTMLEditor() to nsIEditor r=m_kato
nsIEditor is still first contact with editor class for some modules.  They should be accessible to the concrete classes without QI.  Therefore, nsIEditor should have As*Editor() methods.

Additionally, this adds AsEditorBase().  That is always implemented but it might be necessary for some files for minimizing its include files.

MozReview-Commit-ID: 8WqkDJLiVDs

--HG--
extra : rebase_source : e51282df244efad62bc6fe04ab449e3beab440f9
2017-08-04 15:01:36 +09:00
Makoto Kato b04d5091db Bug 1388638 - Use RAII class for StartBatchChanges/EndBatchChanges. r=masayuki
CompositionTransaction forgets to call EndBatchChanges when GetSelectionController returns error, so we should use RAII class instead.

MozReview-Commit-ID: HI9kutRVzx6

--HG--
extra : rebase_source : d276f4349c5a64d4610581ae1a76d160841f7d7b
2017-08-09 18:06:36 +09:00
Masayuki Nakano a2333fc4bb Bug 1060051 - Make editor related interfaces builtin classes if it's possible r=Ehsan,smaug
If we make nsIEditor a builtin class, that means that its instance can be only TextEditor or HTMLEditor.  Then, users of nsIEditor can use concrete classes such as EditorBase, TextEditor or HTMLEditor instead.  Then, the users can reduce unnecessary QI and a lot of virtual calls if we'll create non-virtual methods.

So, let's make editor related interfaces builtin classes.

MozReview-Commit-ID: 93WfsSDuJiJ

--HG--
extra : rebase_source : 39151eb4ffaaf195fec57234ea84c9f4066c58d1
2017-08-04 13:57:56 +09:00
Carsten "Tomcat" Book e02df09b7c Merge mozilla-central to mozilla-inbound 2017-08-08 13:23:59 +02:00
Carsten "Tomcat" Book 0f16d437cc merge mozilla-inbound to mozilla-central a=merge 2017-08-08 13:18:14 +02:00
Nicholas Nethercote 1a6f1a62fa Bug 1387381 - Remove nsXPIDLString local variables. r=erahm.
nsXPIDLStrings are marked as VOIDED upon initialization. Most of these local
nsXPIDLString variables are immediately set via getter_Copies(), which will
either assign a string value (using Adopt()) or do SetIsVoid(). These can be
trivially converted to nsString, which will get the same treatment.

The patch suitably converts the remaining nsXPIDLString local variable as well.

--HG--
extra : rebase_source : 5fff9f2c6844559198f601853f8db08564add7d5
2017-08-08 16:07:55 +10:00
Makoto Kato e9bdbc5bb1 Bug 1387945 - Use nsIContent for CreateAnonymousElement. r=masayuki
CreateAnonymousElement still uses nsIDOMNode, but we should use nsIContent for it.

MozReview-Commit-ID: 2xgzlE6NVra

--HG--
extra : rebase_source : c93a9acb230604da391f705b0038e3cf7fbd4f23
2017-08-07 14:09:51 +09:00
Stone Shih 55c5359fa6 Bug 1351148 Part4: Revise those test cases that have some tasks have to be processed before or after the synthesized key events. r=smaug.
Make sure input events are processed before or after the dependent tasks.

MozReview-Commit-ID: 8KfZnT2wjJR
2017-06-07 14:28:16 +08:00
Wes Kocher 7a772df5bf Merge m-c to inbound, a=merge
MozReview-Commit-ID: BYZASFIrXxp
2017-08-14 17:58:17 -07:00
Christoph Kerschbaumer 824e01cc12 Bug 1388142 - Convert editor/libeditor/tests/test_CF_HTML_clipboard.html to comply with new data: URI inheritance model. r=smaug 2017-08-07 21:21:59 +02:00
Cameron McCormack 536fe8ffa0 Bug 1387481 - Part 1: Don't eagerly style editor-created NAC if it's appended to an element in a display:none subtree. r=hiro
MozReview-Commit-ID: 7bucY7JKRS0

--HG--
extra : rebase_source : 8a4fd542fe72c6abc0636784841d3851c69b6fb4
2017-08-05 17:36:09 +08:00
Sebastian Hengst 765cc1b925 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: JhesEg4Bxjy
2017-08-04 19:28:27 +02:00
Ehsan Akhgari 4c8d604bfc Bug 1386485 - Part 5: Avoid manipulating the refcount of all visited nodes in CreateBogusNodeIfNeeded(); r=masayuki 2017-08-04 03:47:14 -04:00
Ehsan Akhgari 4018b56c7c Bug 1386485 - Part 4: Devirtualize and inline EditorBase::IsEditable(); r=masayuki 2017-08-04 03:47:14 -04:00
Ehsan Akhgari c6b7fe866d Bug 1386485 - Part 3: Devirtualize EditorBase::AsTextEditor()/AsHTMLEditor(); r=masayuki 2017-08-04 03:47:14 -04:00
Ehsan Akhgari b638df20b4 Bug 1386485 - Part 2: Hoist the body editablity check out of the loop; r=masayuki 2017-08-04 03:47:13 -04:00
Ehsan Akhgari 01af645785 Bug 1386485 - Part 1: Inline EditorBase::IsMozEditorBogusNode(); r=masayuki 2017-08-04 03:47:13 -04:00
Wes Kocher e371c2bbf3 Merge m-c to inbound, a=merge CLOSED TREE
MozReview-Commit-ID: AHCROxMdKPB
2017-08-03 18:13:23 -07:00
Wes Kocher 2196b718d3 Merge inbound to central, a=merge
MozReview-Commit-ID: DlSLhaepjeU
2017-08-03 18:06:53 -07:00
Ehsan Akhgari cf4e6a817c Bug 1386411 - Part 7: Inline EditorBase::GetSelection(); r=masayuki 2017-08-03 17:06:31 -04:00
Ehsan Akhgari ad87011a1d Bug 1386411 - Part 5: Make BaseEditor::GetSelectionController() return nsISelectionController*, and inline it; r=masayuki
This method can be extremely hot, so we need to remove all sources of XPCOM
overhead from it.  This includes the usages of weak pointers (thanks to the
previous parts), refcounting, and QueryInterface.

I kept the callers hold the selection controller alive by assigning the
return value to an nsCOMPtr in places where the methods called on it could
have a remote chance of messing with the lifetime of objects.
2017-08-03 17:05:22 -04:00
Ehsan Akhgari 697fb3f83d Bug 1386411 - Part 4: Don't store the document as a weak reference on EditorBase; r=masayuki
This one also doesn't need to be a weak reference, and can be a strong
reference that the cycle collector knows about instead.
2017-08-03 17:05:21 -04:00
Ehsan Akhgari ace85f9311 Bug 1386411 - Part 1: Don't store the selection controller as a weak reference on EditorBase; r=masayuki
This doesn't need to be a weak reference, and can instead be a simple strong
reference that we introduce to the cycle collector.
2017-08-03 17:05:15 -04:00
Jim Mathies 57d9bf0aee Bug 1360666 - Update IME state when nsObjectLoadingContent content changes type from 'loading' to a valid content type. r=masayuki
MozReview-Commit-ID: JC3YGS75gpN
2017-08-03 14:07:14 -05:00
Geoff Brown d45ed676c8 Bug 1376382 - Skip test_bug586662.html for frequent intermittent failures; r=me,test-only 2017-08-03 09:20:56 -06:00