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

8513 Коммитов

Автор SHA1 Сообщение Дата
Makoto Kato 250a70b6ca Bug 1446861 - Remove more nsIDOMElement usages from editor. r=masayuki
Except table access and XPCOM methods for c-c, tests and etc, we can remove
more nsIDOMElement usages to avoid QI.

MozReview-Commit-ID: HO5kAaZAs6Q

--HG--
extra : rebase_source : 41ede0bace33504ad852dc4e0016ea346cd7bdee
2018-03-19 14:14:45 +09:00
Gurzau Raul 3057041352 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-03-16 19:58:27 +02:00
Sylvestre Ledru fa45a3c670 Bug 1443080 - Use the static call for static methods (not instance) r=Ehsan
MozReview-Commit-ID: JwHh4bzxuTR

--HG--
extra : rebase_source : 5f5e37517aa80c2e7b5933962178d761074886e7
2018-03-16 14:29:15 +01:00
Boris Zbarsky 4e402f9b99 Bug 1445983. <bdi> should be an HTMLElement, not HTMLUnknownElement. r=hsivonen
MozReview-Commit-ID: 9eJ45uXRDfR
2018-03-16 11:26:09 -04:00
Masayuki Nakano 4a54352ab1 Bug 1445935 - HTMLEditRules::SplitMailCites() remove left node of split node if it becomes empty r=m_kato
Before bug 1413181, HTMLEditRules::SplitMailCites() receives left node of
split node with |leftCite| from SplitNodeDeep().  However, the out argument
was removed by the bug and now, it can be retrieved with
SplitNodeResult::GetPreviousNode().  Its result is used for creating <br>
element etc, but not set to |leftCite| but HTMLEditRules::SplitMailCites()
still checks if |leftCite| is empty to remove it from the DOM tree.

So, now, both |leftCite| and |rightCite| are not necessary and
HTMLEditRules::SplitMailCites() should use |previousNodeOfSplitPoint|
instead of |leftCite|.

MozReview-Commit-ID: 408MJt6X1IV

--HG--
extra : rebase_source : fa6095ccc972d33afe8deb0f124adffea7371f4e
2018-03-15 22:34:57 +09:00
Masayuki Nakano 24e6e1496b Bug 1445569 - part 4: Get rid of EditorBase::GetStartNodeAndOffset() and EditorBase::GetEndNodeAndOffset() r=m_kato
EditorBase::GetStartNodeAndOffset() and EditorBase::GetEndNodeAndOffset() are
just wrappers of EditorBase::GetStartPoint() and EditorBase::GetEndPoint().
They may *compute* offset in the container node even if some callers don't
need the offset.  Therefore, we should get rid of them and make all callers
use EditorBase::GetStartPoint() or EditorBase::GetEndPoint() directly.

Note that EditorBase::GetStartNodeAndOffset() and
EditorBase::GetEndNodeAndOffset() returns NS_ERROR_FAILURE if
EditorBase::GetStartPoint() or EditorBase::GetEndPoint() returns not set point.
Therefore, checking the result is set equals checking the old nsresult as
an error.

MozReview-Commit-ID: JLwqRMFLjHC

--HG--
extra : rebase_source : 0eb6bf4ba80e8139c6b9f36723d77d23f2b9099e
2018-03-15 21:25:41 +09:00
Masayuki Nakano 16c36d15f7 Bug 1445569 - part 3: Make TextEditRules::CheckBidiLevelForDeletion() take |const EditorRawDOMPoint&| instead of |nsINode*| and offset in it r=m_kato
There are 2 callers of TextEditRules::CheckBidiLevelForDeletion().  One of them
will start to use EditorRawDOMPoint.  Therefore, making it take
|const EditorRawDOMPoint&| instead of |nsINode*| and offset in it keeps the
caller simpler.

MozReview-Commit-ID: DRJXo8gnzba

--HG--
extra : rebase_source : a64d1033699245f54a8f8e6a9b93457e12f33e6c
2018-03-15 18:38:46 +09:00
Masayuki Nakano 456069944a Bug 1445569 - part 2: Make WSRunObject::PriorVisibleNode() and WSRunObject::NextVisibleNode() take |const Editor(Raw)DOMPoint&| instead of a pair of |nsINode*| and offset in it r=m_kato
Similar to the constructor of WSRunObject, PriorVisibleNode() and
NextVisibleNode() callers may become ugly if the callers start to use
Editor(Raw)DOMPoint.  So, let's make them take Editor(Raw)DOMPoint instead of
a pair of nsINode* and offset in it.

Note that a lot of callers of them already use Editor(Raw)DOMPoint.  So, we
don't need to keep maintain overloads which takes nsINode* and offset in it
directly.

MozReview-Commit-ID: 3avMtL000nd

--HG--
extra : rebase_source : f8c83e2fabeb5a94a1729c626583a6699636b06c
2018-03-15 18:23:50 +09:00
Masayuki Nakano fb2eb05e02 Bug 1445569 - part 1: Create WSRunObject constructor which takes |const Editor(Raw)DOMPoint&| instead of |nsINode*| and offset in it r=m_kato
The following patches make some WSRunObject users use EditorRawDOMPoint or
EditorDOMPoint instead of a pair of nsINode and offset in it.  Then, the
code becomes too long like:

> WSRunObject object(mHTMLEditor, pointToDoSomething.GetContainer(),
>                    pointToDoSomething.Offset());

This is ugly and not easier to read than:

> WSRunObject object(mHTMLEditor, pointToDoSomething);

So, we should create alternative constructor of WSRunObject first.

MozReview-Commit-ID: GiNWRBLl7zB

--HG--
extra : rebase_source : 8616956b9745db130283a4bdbd82155b1cfb2803
2018-03-15 17:56:20 +09:00
Masayuki Nakano f3c761c198 Bug 1445929 - Make Editor(Raw)DOMPoint::IsEndOfContainer() check if mParent is container node before checking mChild r=m_kato
Editor(Raw)DOMPoint::IsEndOfContainer() checks mIsChildInitialized before
referring mChild.  However, it may be true even if mParent is not a container
node like a text node.  Therefore, if mParent is a text node and
mIsChildInitialized is true, it always returns true (i.e., even if mOffset
isn't same as length of mParent).

This patch makes it check mParent->IsContainerNode() before checking
mIsChildInitialized because after checking mIsChildInitialized, it validates
the relation of the members.  So, this keeps the validation simple.

MozReview-Commit-ID: K2XrAZoNv2I

--HG--
extra : rebase_source : cba8190f199ab2e9d99547948ab50f0cc8c8ff88
2018-03-15 22:08:19 +09:00
Emilio Cobos Álvarez 7536928a98 Bug 1445605: Make GetCSSFloatValue use GetPropertyValue instead of GetPropertyCSSValue. r=masayuki
We only use it for properties that return pixels anyway, so we can use it
without much problem.

This also fixes bug 1428974.

MozReview-Commit-ID: 5BbVOUdQT7o
2018-03-15 18:22:31 +01:00
Emilio Cobos Álvarez bf16aa2b2b Bug 1445599: Unbreak HTMLEditor::GetTemporaryStyleForFocusedPositionedElement, and make it stop using GetPropertyCSSValue. r=masayuki
MozReview-Commit-ID: 4cRQ8sJfT3a
2018-03-15 18:22:31 +01:00
Boris Zbarsky 7f7ce9b56c Bug 1444686 part 13. Remove remaining nsIDOMDataTransfer uses. r=mystor
MozReview-Commit-ID: EFauqLMGz5S
2018-03-13 16:24:00 -04:00
Boris Zbarsky 145e566cd8 Bug 1444686 part 10. Remove nsIDOMDragEvent::GetDataTransfer. r=mystor
MozReview-Commit-ID: LwKqWBGXVcN
2018-03-13 16:24:00 -04:00
Boris Zbarsky 0da7198eee Bug 1444686 part 4. Get rid of nsIDOMDataTransfer::Get/SetDropEffectInt. r=mystor
MozReview-Commit-ID: EQ8KXMf4mnR
2018-03-13 16:23:59 -04:00
Boris Zbarsky 6139d9be8f Bug 1444686 part 2. Get rid of nsIDOMDataTransfer::GetMozItemCount. r=mystor
MozReview-Commit-ID: 1eo6czER8Qw
2018-03-13 16:23:59 -04:00
Emilio Cobos Álvarez 06bfed73ea Bug 1446451: GetPropertyValue can indeed not return an integer if the node is not displayed. r=masayuki
MozReview-Commit-ID: Gk0PffVE7bz

--HG--
extra : rebase_source : ded727b58d4184a9723d9f2d196882462384bce7
2018-03-16 18:07:33 +01:00
Makoto Kato 492ea93b80 Bug 1443714 - Remove already_AddRefed for GetDocument and GetPresSehll on EditorBase. r=masayuki
It is unnecessary to use already_AddRefed for GetDocument and GetPresShell.
Then, if we remove already_AddRefed, we can replace this with const method.

MozReview-Commit-ID: KTVS0rYrY2i

--HG--
extra : rebase_source : 0199026410fc674f112c960b599a09bc7906cf85
2018-03-07 18:26:00 +09:00
Tiberius Oros f3c2b2ecf8 Merge autoland to mozilla-central. a=merge 2018-03-06 11:52:14 +02:00
Olli Pettay 51b6aa1b21 Bug 1066965, make contentEditable and spellchecking to work in ShadowDOM, r=mrbkap 2018-03-06 09:34:40 +09:00
Masayuki Nakano 9d71742b36 Bug 662591 - HTMLEditor should set caret to start of first editable text node or before first editable inline node r=m_kato
Currently, HTMLEditor doesn't initialize caret position when it gets focus by
itself in most cases.  Only when it's in designMode, it may move caret to the
first visible (not checking CSS actually).

In most cases, caret position is adjusted when EditorBase::InitializeSelection()
calls Selection::SetAncestorLimiter().  If selected range is outside of
new limiter, it moves caret to start of the new limiter.  However, this is
really different behavior from the other browsers.  The other browsers try
to move caret to the first editable text node or before the first editable
content such as <img>, <input>, etc.

This difference causes a serious incompatible issue with Draft.js.  It doesn't
initialize caret position when it gets focus but it assumes that caret is
always set to before <br> element if there is no other content.

So, let's try to behave as what other browsers do as far as possible.

This patch makes editor behave as:
* if selection is already in the editing host except start of the editing host,
  does nothing.
* if there is non-editable element before any editable node, move caret to
  start of the editing host.
* if there is editable text node or element node which cannot have a text node,
  move its start or before it.
* if there is no editable nodes which can contain text nodes, move caret to
  start of the editing host.

Note that before applying this patch, in designMode, BeginningOfDocument() used
document element instead of <body> element.  Therefore, it may set odd position
if <head> element has some text nodes with <script> or <style>.  However,
this doesn't make sense and for making more consistent behavior between
designMode and contenteditable, this patch makes it use editing host (it's
<body> element if it's in designMode).

MozReview-Commit-ID: 5neYoTMq6Cc

--HG--
extra : rebase_source : c4d06b6864a221d7cd2833a007d73f7d67821e95
2018-03-02 14:20:25 +09:00
Makoto Kato 00cc8e57e1 Bug 1442500 - Part 3. Move spellchecker tests to editor/spellchecker. r=masayuki
Many tests in composer are for spellchecker, so we should move it to
/editor/spellchecker/tests.

MozReview-Commit-ID: 7qmNymVXyZP

--HG--
rename : editor/composer/test/bug1200533_subframe.html => editor/spellchecker/tests/bug1200533_subframe.html
rename : editor/composer/test/bug1204147_subframe.html => editor/spellchecker/tests/bug1204147_subframe.html
rename : editor/composer/test/bug1204147_subframe2.html => editor/spellchecker/tests/bug1204147_subframe2.html
rename : editor/composer/test/bug678842_subframe.html => editor/spellchecker/tests/bug678842_subframe.html
rename : editor/composer/test/bug717433_subframe.html => editor/spellchecker/tests/bug717433_subframe.html
rename : editor/composer/test/de-DE/de_DE.aff => editor/spellchecker/tests/de-DE/de_DE.aff
rename : editor/composer/test/de-DE/de_DE.dic => editor/spellchecker/tests/de-DE/de_DE.dic
rename : editor/composer/test/en-AU/en_AU.aff => editor/spellchecker/tests/en-AU/en_AU.aff
rename : editor/composer/test/en-AU/en_AU.dic => editor/spellchecker/tests/en-AU/en_AU.dic
rename : editor/composer/test/en-GB/en_GB.aff => editor/spellchecker/tests/en-GB/en_GB.aff
rename : editor/composer/test/en-GB/en_GB.dic => editor/spellchecker/tests/en-GB/en_GB.dic
rename : editor/composer/test/mochitest.ini => editor/spellchecker/tests/mochitest.ini
rename : editor/composer/test/test_async_UpdateCurrentDictionary.html => editor/spellchecker/tests/test_async_UpdateCurrentDictionary.html
rename : editor/composer/test/test_bug1200533.html => editor/spellchecker/tests/test_bug1200533.html
rename : editor/composer/test/test_bug1204147.html => editor/spellchecker/tests/test_bug1204147.html
rename : editor/composer/test/test_bug1205983.html => editor/spellchecker/tests/test_bug1205983.html
rename : editor/composer/test/test_bug1209414.html => editor/spellchecker/tests/test_bug1209414.html
rename : editor/composer/test/test_bug1219928.html => editor/spellchecker/tests/test_bug1219928.html
rename : editor/composer/test/test_bug1365383.html => editor/spellchecker/tests/test_bug1365383.html
rename : editor/composer/test/test_bug338427.html => editor/spellchecker/tests/test_bug338427.html
rename : editor/composer/test/test_bug678842.html => editor/spellchecker/tests/test_bug678842.html
rename : editor/composer/test/test_bug697981.html => editor/spellchecker/tests/test_bug697981.html
rename : editor/composer/test/test_bug717433.html => editor/spellchecker/tests/test_bug717433.html
extra : rebase_source : 21c17f40d234670be1eefa680747c9085c843e94
2018-03-02 12:57:54 +09:00
Makoto Kato 6d4d7659bb Bug 1442500 - Part 2. Move some spellchecker source files in /editor/composer to /editor/spellchecker. r=masayuki
Per bug 1439813, some files in composer is for spellchecker, so we should move
it to /editor/spellchecker.

MozReview-Commit-ID: 6vlhC1TcZp5

--HG--
rename : editor/composer/EditorSpellCheck.cpp => editor/spellchecker/EditorSpellCheck.cpp
rename : editor/composer/EditorSpellCheck.h => editor/spellchecker/EditorSpellCheck.h
rename : editor/composer/nsComposeTxtSrvFilter.cpp => editor/spellchecker/nsComposeTxtSrvFilter.cpp
rename : editor/composer/nsComposeTxtSrvFilter.h => editor/spellchecker/nsComposeTxtSrvFilter.h
extra : rebase_source : b9c3fcf7e557a2ff4b58e81020fa7a9ec938d3af
2018-03-02 12:56:44 +09:00
Makoto Kato 43ea41434e Bug 1442500 - Part 1. Rename editor/txtsvc to editor/spellchecker. r=masayuki
txtsvc is ambiguous name, so we should use functional name instead.

XPIDL_MODULE still keeps 'txtsvc' because 'spellchecker' is already used by
extensions/spellchek/idl.  And all IDLs for editor may move to /editor since
most IDLs for editor is on /editor.

MozReview-Commit-ID: v9a5ENEs2M

--HG--
rename : editor/txtsvc/TextServicesDocument.cpp => editor/spellchecker/TextServicesDocument.cpp
rename : editor/txtsvc/TextServicesDocument.h => editor/spellchecker/TextServicesDocument.h
rename : editor/txtsvc/moz.build => editor/spellchecker/moz.build
rename : editor/txtsvc/nsFilteredContentIterator.cpp => editor/spellchecker/nsFilteredContentIterator.cpp
rename : editor/txtsvc/nsFilteredContentIterator.h => editor/spellchecker/nsFilteredContentIterator.h
rename : editor/txtsvc/nsIInlineSpellChecker.idl => editor/spellchecker/nsIInlineSpellChecker.idl
rename : editor/txtsvc/nsISpellChecker.h => editor/spellchecker/nsISpellChecker.h
rename : editor/txtsvc/nsITextServicesFilter.idl => editor/spellchecker/nsITextServicesFilter.idl
extra : rebase_source : 38ea55fe974614b7bb829b614f7de1ee649dbbb1
2018-03-02 12:55:26 +09:00
Emilio Cobos Álvarez 2988d4e66d Bug 1442207: Remove unneeded arguments to nsIMutationObserver. r=smaug
aDocument is always content->OwnerDoc().
aContainer is always content->GetParent().

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

MozReview-Commit-ID: 4xwPCOnhyIL
2018-03-01 22:45:17 +01:00
Sebastian Hengst 71f42f588a merge mozilla-central to autoland CLOSED TREE 2018-02-28 20:17:53 +02:00
Florian Quèze f3ee8dd20b Bug 1433175 - more aggressive scripted patch to replace remaining Components.classes, Components.interfaces, Components.utils and Components.results uses with Cc, Ci, Cu and Cr, r=Mossop. 2018-02-28 18:51:35 +01:00
Florian Quèze 6df7549a3e Bug 1433175 - semi-automated indent fix, r=Mossop. 2018-02-28 18:51:34 +01:00
Florian Quèze c714053d73 Bug 1433175 - scripted patch to replace Components.classes[, Components.interfaces.nsI, Components.utils. and Components.results. with Cc, Ci, Cu and Cr, r=Mossop. 2018-02-28 18:51:33 +01:00
Makoto Kato 75f1d82f9b Bug 1436285 - Part 2. Get a rid of nsIDOMNode version of GetNodeLocation, GetStartNodeAndOffset, GetEndNodeAndOffset and etc. r=masayuki
Remove unused methods...

MozReview-Commit-ID: 4A8924wsEq3

--HG--
extra : rebase_source : dc3cc6c263bdd213e7dd2fb2442ad1ff16662aaf
2018-02-28 11:33:16 +09:00
Makoto Kato d89148b69b Bug 1436285 - Part 1. Don't use nsIDOMNode version of GetStartNodeAndOffset and GetEndNodeAndOffset. r=masayuki
To get a rid of some methods, I would like to replace nsIDOMNode usages with nsINode.

MozReview-Commit-ID: B0FVczayND0

--HG--
extra : rebase_source : ede058089332202ba0c05ddb61e0f119cbf52fcb
2018-02-28 11:32:28 +09:00
Emilio Cobos Álvarez 7dffe29d8f Bug 1432490: Make nsComputedDOMStyle::GetStyleContext / GetStyleContextNoFlush not take a presShell. r=bz
Everyone calls them with the shell of the current composed document, and this
allows the multi-presShell stuff to just be in UpdateCurrentStyleSources /
DoGetStyleContextNoFlush.

The only reason we need to use OwnerDoc()->GetShell() instead of the composed
doc in GetStyleContext / GetStyleContextNoFlush is Element::GetBindingURL, which
does expect to get the binding URL for stuff outside of the composed doc (and
changing that gave me a useless browser).

That's technically a behavior change on the cases that used to pass nullptr, but
I think all callers are fine with that. I could also just add a special function
for that particular case, it may be worth it.

MozReview-Commit-ID: 2XlnkgdgDCK
2018-02-25 02:23:59 +01:00
Emilio Cobos Álvarez 0f3f398be9 Bug 1439036: Fix some other miscellaneous issues with the caller. r=bz
While we're here...

MozReview-Commit-ID: 7B79vec0bYS

--HG--
extra : rebase_source : 1c7f78c913986e8d2856d62c3037da64b109d20e
2018-02-17 01:46:35 +01:00
Florian Quèze 682b1ec3b2 Bug 1440284 - change this.EXPORTED_SYMBOLS back to var EXPORTED_SYMBOLS in JS modules, r=mccr8. 2018-02-23 20:50:01 +01:00
Dorel Luca 6ad641c5c4 Merge mozilla-inboud to mozilla-central. a=merge 2018-02-22 11:59:54 +02:00
Makoto Kato 4bc57cc3ec Bug 1437087 - Call Disconnect on Unlink of cycle collector. r=masayuki 2018-02-21 21:08:17 -05:00
Makoto Kato feb9be572d Bug 1439812 - Move noscript methods of nsIPlainTextEditor to TextEditor. r=masayuki
maxTextLength is unused from script, so I would like to move to TextEditor.
Also, there is no reason to keep setText on nsIPlainText.

MozReview-Commit-ID: CZ8pa9Pm8qt

--HG--
extra : rebase_source : ea58a20510b2211dcf440955ec8dc49d57337437
2018-02-21 13:21:57 +09:00
Adrian Wielgosik 2d4df58ad8 Bug 1439751 - Remove all members from nsIDOMHTMLInputElement. r=qdot
MozReview-Commit-ID: JVagEzvSONN

--HG--
extra : rebase_source : a7e1cf2e5ccc1925f3a11c7d935438ef6307c70c
2018-02-20 23:10:44 +01:00
Masayuki Nakano cf83ee7bb4 Bug 1438157 - part 2: Remove unnecessary second argument of EventUtils.synthesizeKey() r=smaug
Note that this patch also replaces legacy VK_* with KEY_*, and replaces
synthesizeKey() for inputting some characters with sendString() because
it's better and clearer what it does and it sets shiftKey state properly.

MozReview-Commit-ID: De4enbjux3T

--HG--
extra : rebase_source : 2296b84bff8e22f01eeb48cd8614fac5db11136a
2018-02-15 04:15:39 +09:00
Chris Peterson fe5cd3d5d9 Bug 1436263 - Part 3: Remove `virtual` from final virtual function declarations. r=froydnj
MozReview-Commit-ID: 8pjYjEvQF42

--HG--
extra : rebase_source : 5eb0bea2ef5f06a811b4f3daf57ce8720f12dd07
2018-02-08 21:22:43 -08:00
Chris Peterson 0129d900f3 Bug 1436263 - Part 2: Replace `override final` virtual function specifiers with just `final`. r=froydnj
MozReview-Commit-ID: 70gt5SUu4Dv

--HG--
extra : rebase_source : 71912c6bde22aaed01e70615a4ee794a36e70d0e
extra : source : 1c22d4c65d70b797ee3e963ec426c90e1f89b5e3
2018-02-05 22:50:00 -08:00
Hiroyuki Ikezoe 14075ea4f4 Bug 1438397 - Don't process RepaintSelection() if the presshell is being destroyed. r=masayuki
MozReview-Commit-ID: 4vihEDBw7BH

--HG--
extra : rebase_source : 1f9a89b543d4f41ab6cf22e840d4ea279f05aead
2018-02-15 11:21:32 +09:00
Masayuki Nakano 18912959bd Bug 1406726 - HTMLEditRules::WillInsertBreak() should reset mNewNode with caret position r=m_kato
HTMLEditRules::WillInsertBreak() started to use HTMLEditRules::MakeBasicBlock()
to wrap existing inline elements with default paragraph separator if inline
elements are children of editing host.  However,
HTMLEditRules::ApplyBlockStyle() called by HTMLEditRules::MakeBasicBlock() sets
mNewNode to last new block node.  So, if it wraps inline elements after caret
position, mNewNode becomes after expected caret position and
HTMLEditRules::AfterEditInner() will move caret into it.

This patch make HTMLEditRules::WillInsertBreak() reset mNewNode with
caret position after calling HTMLEditRules::MakeBasicBlock().

Additionally, this patch fixes a bug of HTMLEditor::IsVisibleBRElement().
That is, it uses only editable nodes to check if given <br> element is
visible.  However, editable state is not related to this check.  If <br>
element is followed by non-editable inline node (except invisible data
nodes), it always visible.  This bug caused getting wrong nodes with
HTMLEditRules::GetNodesFromSelection() which is used by
HTMLEditRules::MakeBasicBlock().  Therefore, this patch also adds lots of
EditorBase::Get(Next|Previous)ElementOrText*() and
HTMLEditor::Get(Next|Previous)HTMLElementOrText*() to ignore only invisible
data nodes.

Note that even with this fix, the range of nodes computed by
HTMLEditRules::GetNodesFromSelection() is still odd if only non-editable
elements follow a <br> node which is first <br> element after the caret
position.  However, what is expected by the execCommand spec is unclear.
So, automated test added by this patch checks current inconsistent behavior
for now.

MozReview-Commit-ID: 2m52StwoEEH

--HG--
extra : rebase_source : 6b9b2338e35c4d2e89a405fd8e1ffc7b0873ca1e
2018-02-13 19:01:42 +09:00
Masayuki Nakano 8917ac460f Bug 1436926 - part 2: Remove unnecessary KeyboardEvent.code specification of callers of EventUtils.synthesizeKey() r=smaug
Now, callers of EventUtils.synthesizeKey() don't need to specify
KeyboardEvent.code value anymore if they assume that active keyboard layout
is US keyboard layout.

Note that this patch changes the meaning of only test_bug551434.html.
Some callers in it don't match the key value and code value but that looks
like that they don't checking such odd keyboard events.  So, they must be
bug of the test.

MozReview-Commit-ID: Itxo7yZ9rkK

--HG--
extra : rebase_source : 856ef3715c924ca16e993ea57d92d1243b5cc6be
2018-02-09 19:17:26 +09:00
Boris Zbarsky 9bdcffc985 Bug 1436902 part 3. Replace usage of NS_IMPL_ISUPPORTS_INHERITED0 with NS_INLINE_DECL_REFCOUNTING_INHERITED when possible. r=mccr8
The change to RootAccessible.cpp fixes an obvious bug introduced in bug 741707.

The visibility changes in gfx/thebes are because NS_DECL_ISUPPORTS has a
trailing "public:" that those classes were relying on to have public
constructors.

MozReview-Commit-ID: IeB8KIJCGhU
2018-02-12 15:44:40 -05:00
Masayuki Nakano c548fd9ae1 Bug 1436663 - EditorBase::JoinNodeDeep() should set result after actually joining the nodes r=m_kato
EditorBase::JoinNodeDeep() returns a DOM point which was start of right node.
Currently, this is set before actually joining the nodes.  Therefore, we see
warnings since right node which becomes joined node may have less children
than left node.

This patch also makes the NS_WARNING_ASSERTION to NS_ASSERTION since no tests
hit this.  So, we can use it to detect regressions.

MozReview-Commit-ID: 3RmRP588AkF

--HG--
extra : rebase_source : 2cab458ffac566c81eb8d3f47e755ffacb1553d2
2018-02-08 16:17:24 +09:00
Sebastian Hengst d1700a0b7a merge mozilla-central to autoland. CLOSED TREE 2018-02-10 00:34:30 +02:00
Tim Nguyen 79e5dc6167 Bug 1429573 - Use input[type=number] in textbox[type=number] implementation. r=Paolo,surkov
* The number is no longer selected on number input focus

MozReview-Commit-ID: AmR5c6YKTCP

--HG--
extra : rebase_source : fdaab23fca57f361c9185191d9c30e047375cbe8
2018-02-09 21:54:36 +00:00
Boris Zbarsky 034e47c66b Bug 1436508 part 12. Remove nsIDOMKeyEvent. r=masayuki
MozReview-Commit-ID: 8giqG5iHiIf
2018-02-09 11:17:10 -05:00
Boris Zbarsky fce30e834b Bug 1436508 part 10. Remove use of nsIDOMKeyEvent in JS. r=masayuki
MozReview-Commit-ID: GGciORX62Yh
2018-02-09 11:17:09 -05:00
arthur.iakab f58e902071 Backed out 2 changesets (bug 1429573) for failing reftest on reftest/tests/editor/reftests/xul/number-3.xul on a CLOSED TREE
Backed out changeset 75364898f5f6 (bug 1429573)
Backed out changeset fe69b415f45b (bug 1429573)
2018-02-09 23:27:59 +02:00
Tim Nguyen d2bb22650d Bug 1429573 - Use input[type=number] in textbox[type=number] implementation. r=Paolo,surkov
* The number is no longer selected on number input focus

MozReview-Commit-ID: EoXNqhXwK95

--HG--
extra : rebase_source : b5a522e11796ec42c87019f6c3955e6c40eb21d0
2018-02-09 19:23:56 +00:00
Masayuki Nakano 1165b53e10 Bug 1436295 - HTMLEditRules::WillInsertBreak() should cancel resetting EditorDOMPoint when HTMLEditRules::ReturnInParagraph() splits DOM node around the point r=m_kato
This patch only fixes warning, not changing actual behavior of editor.

HTMLEditRules::ReturnInParagraph() splits paragraph *around* given point.
Therefore, from point of view of caller, offset of setting point may be
invalid after HTMLEditRules::ReturnInParagraph() handled the edit action.
In this case, invalidating stored child of the point may cause warning
since offset may be larger than length of its container.

So, if HTMLEditRules::ReturnInParagraph() handles the edit action,
the caller, HTMLEditRules::WillInsertBreak(), should cancel invalidating
the stored child for avoiding unnecessary warning.

MozReview-Commit-ID: DKJlr0Awwlo

--HG--
extra : rebase_source : 8fbefff3b46e55daf8db6342f00de904315d7fcc
2018-02-07 19:04:52 +09:00
shindli 0fcb667b73 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-02-08 12:13:08 +02:00
Makoto Kato 6e437ccf06 Bug 1436272 - Move noscript methods in nsIEditor to EditorBase. r=masayuki
Since We can use EditorBase/TextEditor/HTMLEditor directly,  we can
movei noscript methods in nsIEditor to each class.

Also, Init is unnecessary to use nsIDOMDocument and nsIContent since method
isn't in IDL.  And some methods are unused now.

MozReview-Commit-ID: D3B6oSlcT0L

--HG--
extra : rebase_source : 6cab2e6e7b4ba8cfb56d8320be24ca4afcbe55fb
extra : amend_source : 1d8c59086a9158a49dd270b64ecf8341ed4002ce
2018-02-07 15:28:04 +09:00
Masayuki Nakano aa44284d56 Bug 1436216 - EditorBase::CreateElement() should call RangeUpdater::SelAdjCreateNode() with point of new element r=m_kato
Before bug 1425091, we called RangeUpdater::SelAdjCreateNode() with point of
new node in EditorBase::CreateElement().  However, it was accidentally changed
to point *in* new element.  Therefore, setting such DOM point causes warnings
in debug build and call of RangeUpdater::SelAdjCreateNode() must be failed
since the point stores wrong container node.

Additionally, this patch stops using another EditorRawDOMPoint instance which
is just redundant and renames |ret| to |newElement| for making its meaning
clearer.

MozReview-Commit-ID: Gc0YgaNLYcx

--HG--
extra : rebase_source : c2fbe2669ca8a5993e26b357f53dc38341fd6bf6
2018-02-07 16:27:55 +09:00
Ciure Andrei 0b674adee4 Backed out changeset 86581d5ccbbb (bug 1436272) for failing /builds/worker/workspace/build/src/editor/libeditor/EditorBase.cpp a=backout on a CLOSED TREE 2018-02-08 04:54:47 +02:00
Makoto Kato b845e3128e Bug 1436272 - Move noscript methods in nsIEditor to EditorBase. r=masayuki
Since We can use EditorBase/TextEditor/HTMLEditor directly,  we can
movei noscript methods in nsIEditor to each class.

Also, Init is unnecessary to use nsIDOMDocument and nsIContent since method
isn't in IDL.  And some methods are unused now.

MozReview-Commit-ID: D3B6oSlcT0L

--HG--
extra : rebase_source : b89698f4ab56fdd97a4cd8c515a8b33f6a74a7af
2018-02-07 15:28:04 +09:00
Andrew McCreight 5dec0e0beb Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
This patch was autogenerated by my decomponents.py

It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.

It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.

It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)

MozReview-Commit-ID: DeSHcClQ7cG

--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
2018-02-06 09:36:57 -08:00
Narcis Beleuzu 84cea84b12 Merge inbound to mozilla-central. a=merge 2018-02-06 11:54:42 +02:00
Makoto Kato 2768bda89d Bug 1435149 - Part 2. Use scope resolution operator for CSSEditUtils's caller. r=masayuki
Part 1. changes to static method, so caller should use scope operator instead
of mCSSEditUtils member.

MozReview-Commit-ID: GlCfyjlQgr0

--HG--
extra : rebase_source : f558fc833d5f3cb193a543fc1b05cdeb58f60ec1
extra : histedit_source : 741529204d2dddef0f2dab9e18055186155eca8f
2018-02-02 18:42:25 +09:00
Makoto Kato 55fce07048 Bug 1435149 - Part 1. Change some methods to static or const method in CSSEditUtils. r=masayuki
Some methods in CSSEditUtils can change to static methods or const method.
So we should change to it to avoid unnecessary HTMLEditor check.

MozReview-Commit-ID: IwAbeNsgqSr

--HG--
extra : rebase_source : 649f198a59e06504a9e54cb64ab942ce04854ad2
extra : histedit_source : f4506dbdf8f9ccb614aca8f84aff1d572f0ce37e
2018-02-06 12:57:37 +09:00
Masayuki Nakano 283dfdf558 Bug 1434969 - EditorDOMPointBase::RewindOffset() shouldn't treat it as error if offset is same as length of the container r=m_kato
EditorDOMPointBase::RewindOffset() treats it as error when offset is
same as length of container.  However, this is wrong because offset can
be same as length of its container since it means after the last child
or last character.  So, if an instance points end of a container node,
Rewind() always fails unexpectedly.

MozReview-Commit-ID: A9bvsxETDoo

--HG--
extra : rebase_source : f05994f2924adaa29711da3916f431688eaa79b7
2018-02-04 01:00:44 +09:00
Eric Rahm d563f447dc Bug 1434789 - Part 1: Remove unnecessary nsSubstringTuple.h includes. r=froydnj
--HG--
extra : rebase_source : 66b1950fe3cad1c04c901c8c39d135802ae3ccf7
2018-01-31 16:47:43 -08:00
Makoto Kato 6194942f78 Bug 1433849 - Remove unused methods in nsIHTMLAbsPosEditor. r=masayuki
The following methods are unused in m-c, c-c and bluegriffon from JavaScript.

- selectionContainerAbsolutelyPositioned
- absolutelyPositionedSelectionContainer
- absolutePositionSelection
- relativeChangeZIndex
- absolutelyPositionElement
- setElementPosition
- getElementZIndex
- setElementZIndex
- relativeChangeElementZIndex
- showGrabberOnElement
- hideGrabber

So let't remove these method from IDL.

MozReview-Commit-ID: JASJmB65wR2

--HG--
extra : rebase_source : a7c3cdf0ea96ec7b81bed7573c57d6040033d01b
2018-02-01 10:55:25 +09:00
Florian Quèze 2b1c8dccb6 Bug 1339461 - script-generated patch to convert foo.indexOf(...) == -1 to foo.includes(), r=Mossop. 2018-02-01 20:45:22 +01:00
Boris Zbarsky 7a9f022f1a Bug 1434819 part 7. Remove the SHOW_* constants from nsIDOMNodeFilter. r=qdot
MozReview-Commit-ID: 7E2KZkLfbSI
2018-02-01 14:26:12 -05:00
Boris Zbarsky 59795295d1 Bug 1434819 part 6. Get rid of NodeFilterHolder. r=qdot
Now that TreeWalker and NodeIterator only use webidl APIs, they always have a
NodeFilter, not nsIDOMNodeFilter.

MozReview-Commit-ID: 5pzn9V3Kxzy
2018-02-01 14:26:12 -05:00
Boris Zbarsky 72cdddcc61 Bug 1434686 part 3. Use IgnoreErrors() outside of dom/. r=mystor
I left some IgnoredErrorResults for now where people warn on failure.  We could
consider adding a WarnOnError() thing or something.

MozReview-Commit-ID: L5ttZ9CGKg0
2018-02-01 14:21:14 -05:00
Cameron McCormack d02e54b79b Bug 1430014 - Part 5: Stop building old style system classes when MOZ_OLD_STYLE is not defined. r=xidorn
MozReview-Commit-ID: CIHyPdF7Exl

--HG--
extra : source : 78a2fc781eead47af3923efcde58569c5d882ab1
2018-02-01 15:04:04 +11:00
Cameron McCormack cc7db5c40c Bug 1430014 - Part 4: #ifdef out unnecessary code when the old style system is not built. r=xidorn
MozReview-Commit-ID: 1FZ9VzjcPzN

--HG--
extra : source : de22d220635f8c059834b76f769d5215ab1a8b5b
2018-02-01 15:04:04 +11:00
Boris Zbarsky 0935ca9973 Bug 1434318 part 12. Remove nsIDOMDocument's contentType attribute. r=mystor
MozReview-Commit-ID: DAXrxIxiac4
2018-01-31 15:18:11 -05:00
Boris Zbarsky a514705917 Bug 1434318 part 7. Remove nsIDOMDocument::GetElementsBy* methods. r=mystor
MozReview-Commit-ID: CnfelWtz0mT
2018-01-31 15:18:10 -05:00
Boris Zbarsky c62e23596a Bug 1434318 part 2. Stop using nsIContentViewer::GetDOMDocument in C++. r=mystor
MozReview-Commit-ID: FoMoVgCngGR
2018-01-31 15:18:09 -05:00
Boris Zbarsky 4c01bdc27f Bug 1428610 part 7. Make the nsICSSDeclaration length API nicer. r=emilio
MozReview-Commit-ID: 2gs8npBJFJY
2018-01-30 14:48:27 -05:00
Kris Maglione 918ed6c474 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
2018-01-29 15:20:18 -08:00
Makoto Kato 76358fc558 Bug 1434171 - Clean up CheckSelectionStateForAnonymousButtons. r=masayuki
Since CheckSelectionStateForAnonymousButtons is called from selection listener,
We should reduce some QI for this.

MozReview-Commit-ID: 17hhupmnnV5

--HG--
extra : rebase_source : 81ed7f844033f75e5fcf1d8983a45804f0b9544f
2018-01-30 13:42:52 +09:00
Boris Zbarsky afe966f041 Bug 1418085 part 1. Stop using nsIDOMHTMLElement in editor code. r=mystor
MozReview-Commit-ID: 6J0wWzMCfWP
2018-01-30 00:25:36 -05:00
Boris Zbarsky 311e6cf3f4 Bug 1418076 part 5. Get rid of nsIDOMHTMLDocument's designMode attribute. r=mystor
MozReview-Commit-ID: 8CB3OZBHa9q
2018-01-26 01:00:49 -05:00
Cosmin Sabou 9a65a40178 Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00
Boris Zbarsky 8c61d57bca Bug 1276438 part 6. Stop using nsIDOMHTMLDocument::GetBody. r=mystor
MozReview-Commit-ID: EcDTnByuZsm
2018-01-26 00:53:35 -05:00
Boris Zbarsky fba82e4ebc Bug 1432977 part 3. Remove nsIDOMHTMLElement's offsetWidth/Height attributes. r=mccr8
MozReview-Commit-ID: EoSwBkeGj60
2018-01-29 23:40:11 -05:00
Boris Zbarsky 548d16d0b1 Bug 1432977 part 2. Remove nsIDOMHTMLElement's spellcheck attribute. r=mccr8
MozReview-Commit-ID: B07hMx3LAed
2018-01-29 23:37:57 -05:00
Boris Zbarsky e565b1fe1b Bug 1432944 part 11. Remove nsIDOMElement::GetAttribute. r=mccr8
MozReview-Commit-ID: 2f1vFvRdCPG
2018-01-29 23:28:00 -05:00
Boris Zbarsky 151487a675 Bug 1432944 part 10. Remove nsIDOMElement::SetAttribute. r=mccr8
MozReview-Commit-ID: 6eIdX8iA5Rg
2018-01-29 23:28:00 -05:00
Boris Zbarsky b61aa11d01 Bug 1432944 part 8. Remove usage of nsIDOMElement::HasAttribute in editor code. r=m_kato
MozReview-Commit-ID: 926Dzqv7Oj4
2018-01-29 23:27:59 -05:00
Boris Zbarsky a6f9dbf34e Bug 1432944 part 6. Remove the nsIDOMNode overloads of HTMLEditUtils::IsNamedAnchor and HTMLEditUtils::IsTable. r=m_kato
MozReview-Commit-ID: 4KlppKdzJGy
2018-01-29 23:27:59 -05:00
Boris Zbarsky 423c0886df Bug 1432944 part 5. Remove the now-unused nsIDOMNode overload of HTMLEditUtils::IsLink. r=m_kato
MozReview-Commit-ID: CDnYK194JB9
2018-01-29 23:27:59 -05:00
Boris Zbarsky 7bfc306103 Bug 1432944 part 4. Work with Element, not nsIDOMElement, inside HTMLEditor::GetSelectedElement. r=m_kato
MozReview-Commit-ID: 3F1rbPMgkAR
2018-01-29 23:27:59 -05:00
Boris Zbarsky fbb40001ca Bug 1432944 part 3. Take an early return from HTMLEditor::GetSelectedElement when we can. r=m_kato
MozReview-Commit-ID: EAEzpom7oXo
2018-01-29 23:27:59 -05:00
Boris Zbarsky 1fa8ecc716 Bug 1432944 part 2. Make nsIHTMLEditor.getSelectedElement return nsISupports. r=m_kato
The only C++ caller immediately QIs the result anyway, and the exact type
returned doesn't matter for JS callers because the return values are DOM
objects.  This makes it simpler to rejigger the internals to work with nsINode
and Element and whatnot.

MozReview-Commit-ID: 863IDGECqYY
2018-01-29 23:27:59 -05:00
Boris Zbarsky 7bb421fe3b Bug 1432944 part 1. Stop returning NS_EDITOR_ELEMENT_NOT_FOUND from nsIHTMLEditor::GetSelectedElement. r=m_kato
The only C++ caller doesn't care, and JS callers can't tell that a non-NS_OK success code was returned anyway.

MozReview-Commit-ID: FNhQYR0a9ur
2018-01-29 23:27:58 -05:00
Boris Zbarsky f60fd673d6 Bug 1432186 part 19. Remove the nsIDOMNode::*_NODE constants. r=mccr8
MozReview-Commit-ID: KvKjeKIOB9K
2018-01-29 23:10:53 -05:00
Boris Zbarsky 4d88c28e4d Bug 1432186 part 17. Remove nsIDOMNode's parentNode attribute. r=mccr8
MozReview-Commit-ID: 4xzDwwEqnvE
2018-01-29 23:10:52 -05:00
Boris Zbarsky 37aaea3c1f Bug 1432186 part 16. Remove nsIDOMNode's ownerDocument attribute. r=mccr8
MozReview-Commit-ID: JqfAFxPBz41
2018-01-29 23:10:52 -05:00
Boris Zbarsky 9525cabcc3 Bug 1432186 part 15. Remove nsIDOMNode::HasChildNodes. r=mccr8
MozReview-Commit-ID: GFc2sv4E7b2
2018-01-29 23:10:51 -05:00
Boris Zbarsky 323cec654b Bug 1432186 part 13. Remove nsIDOMNode's nextSibling attribute. r=mccr8
MozReview-Commit-ID: DTaivhMORXr
2018-01-29 23:10:51 -05:00
Boris Zbarsky 97302665b4 Bug 1432186 part 12. Remove nsIDOMNode's previousSibling attribute. r=mccr8
MozReview-Commit-ID: 7UJFaxEnT9Q
2018-01-29 23:10:51 -05:00
Boris Zbarsky e2ce75877d Bug 1432186 part 11. Remove nsIDOMNode's firstChild attribute. r=mccr8
MozReview-Commit-ID: 5jCdAmSuPx8
2018-01-29 23:10:51 -05:00
Boris Zbarsky 96697d35fe Bug 1432186 part 10. Remove nsIDOMNode's lastChild attribute. r=mccr8
MozReview-Commit-ID: FhJs1MXAyeO
2018-01-29 23:10:51 -05:00
Boris Zbarsky eb9faa9b79 Bug 1432186 part 6. Remove nsIDOMNode::RemoveChild. r=mccr8
MozReview-Commit-ID: 9ZbIEIRtYPL
2018-01-29 23:10:50 -05:00
Boris Zbarsky abfab07da3 Bug 1432186 part 5. Remove nsIDOMNode's nodeType attribute. r=mccr8
MozReview-Commit-ID: LKsBgKcqtBS
2018-01-29 23:10:50 -05:00
Boris Zbarsky 3b6d43f65c Bug 1432186 part 4. Remove nsIDOMNode's nodeValue attribute. r=mccr8
MozReview-Commit-ID: Aqt4NDjcdKW
2018-01-29 23:10:50 -05:00
Boris Zbarsky c646473558 Bug 1432186 part 3. Remove nsIDOMNode's nodeName attribute. r=mccr8
MozReview-Commit-ID: Jg0Tuvdi6uX
2018-01-29 23:10:50 -05:00
Boris Zbarsky e9880ecc58 Bug 1432186 part 2. Clean up the string handling in HTMLURIRefObject::GetNextURI. r=mccr8
MozReview-Commit-ID: DB3pSrA9ffy
2018-01-29 23:10:50 -05:00
Kris Maglione 6476f95b13 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
2018-01-29 15:20:18 -08:00
Brindusan Cristian af8879d1eb Backed out 2 changesets (bug 1431533) for ESlint failures on a CLOSED TREE
Backed out changeset 6e56f4c8843e (bug 1431533)
Backed out changeset 12fc4dee861c (bug 1431533)
2018-01-30 02:32:43 +02:00
Kris Maglione c276bb9375 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
2018-01-29 15:20:18 -08:00
Masayuki Nakano 4b7e512db0 Bug 1433345 - part 4: Make EditorBase derived from nsISelectionListener and notify its owning classes of selection change r=m_kato
This patch makes EditorBase derived from nsISelectionListener.  Then, we can
make IMEContentObserver, TextInputListener, ComposerCommandsUpdater,
TypeInState not derived from nsISelectionListener since EditorBase or
HTMLEditor can notify them of selection change directly.  Additionally,
ResizerSelectionListener is not necessary anymore since it just implements
nsISelectionListener and calls only a method of HTMLEditor.  So, HTMLEditor
can call it directly.

Note that the order of selection listeners may be different.  However,
according to what each selection listener does, changing the order isn't
problem.

MozReview-Commit-ID: 1JXZxQcS0tP

--HG--
extra : rebase_source : c2ebe622a74001ad4e421da492dcdab8e6fe1649
2018-01-26 17:25:45 +09:00
Masayuki Nakano 1ef303c32e Bug 1433345 - part 3: Make HTMLEditor store ResizerSelectionListener directly r=m_kato
This patch makes HTMLEditor store ResizerSelectionListener directly and
make it cycle collectable.  However, in the following patch, this class will
be removed completely because it doesn't necessary if HTMLEditor becomes a
selection listener.

MozReview-Commit-ID: 2iXlTcZdzvj

--HG--
extra : rebase_source : 893a3bbf290eb1752a701d6d8ac284a1630a6fbe
2018-01-26 15:14:04 +09:00
Masayuki Nakano 905d027c8f Bug 1433345 - part 2: Make HTMLEditor store ComposerCommandsUpdater directly r=m_kato
For making ComposerCommandsUpdater not derived from nsISelectionListener,
HTMLEditor needs to store it directly.

This patch also makes ComposerCommandsUpdater cycle collectable because it
stores a strong pointer and HTMLEditor also needs to store it with RefPtr.
Therefore, ComposerCommandsUpdater becomes unnecessary to use nsWeakPtr.

MozReview-Commit-ID: 2WZnLdq15FK

--HG--
extra : rebase_source : 8ee4968e1a63fe88a8276b1f8ce8d145fb9b31ae
2018-01-26 14:38:05 +09:00
Masayuki Nakano 5436129851 Bug 1433345 - part 1: Expose nsComposerCommandsUpdater with renaming it to mozilla::ComposerCOmmandsUpdater r=m_kato
For making HTMLEditor stores it directly, we should expose
nsComposerCommandsUpdater first.  Then, it should be in mozilla namespace.

MozReview-Commit-ID: 8Vhum4Q3WY

--HG--
rename : editor/composer/nsComposerCommandsUpdater.cpp => editor/composer/ComposerCommandsUpdater.cpp
rename : editor/composer/nsComposerCommandsUpdater.h => editor/composer/ComposerCommandsUpdater.h
extra : rebase_source : 3056eeb4aa3dd3426246b74be1e1e18a93a7c33d
2018-01-26 14:06:29 +09:00
Masayuki Nakano e43e597a9e Bug 1433101 - part 2: Treat Enter and Shift+Enter as printable key r=smaug
Chromium dispatches a keypress event when pressing Enter or Shift+Enter.
Actually, when user press them in <pre> element of HTML editor, ツ・n is inserted.
It makes sense to treat the key combinations as inputting text.

MozReview-Commit-ID: Hvx87MZtZkn

--HG--
extra : rebase_source : 196b63843ebcb6e4b398f6b21a4f5f1d020b8db3
2018-01-25 23:59:20 +09:00
Masayuki Nakano 082c64aa0c Bug 1433101 - part 1: Add new pref which disables keypress event for non-printable keys only for the default event group in web content r=smaug
UI Events declares that keypress event should be fired when the keypress event
causes some text input.  However, we're keeping our traditional behavior for
historical reasons because our internal event handlers (including event
handlers of Thunderbird) handles keypress events for any keys.  Therefore,
for minimizing the side effect, we should stop kicking keypress event handlers
in the default event group in web content.

This patch adds new pref for enabling the standard behavior in web content.

Additionally, creates WidgetKeyboardEvent::IsInputtingText() for sharing the
check logic between TextEventDispatcher and TextEditor/HTMLEditor.

MozReview-Commit-ID: 3rtXdLBPeVC

--HG--
extra : rebase_source : 2fc3c9a09840d0d03800c9a42bb83ca76a8db2d5
2018-01-25 23:27:07 +09:00
Masatoshi Kimura f576a03e65 Bug 1433100 - Constify the parameter of HTMLEditor::DoInlineTableEditingAction. r=m_kato
--HG--
extra : source : 9042789502045102cf46b19d0382b0d4c0364377
2018-01-25 22:16:32 +09:00
Makoto Kato ded973c413 Bug 1432715 - Don't use NS_IMETHOD when method doesn't override. r=masayuki
Some methods in HTMLEditor uses NS_IMETHOD that doesn't override.  So we should
replace with nsresult to avoid virtual method.

MozReview-Commit-ID: 7LillLQNhlg

--HG--
extra : rebase_source : 02655cdcf9350caae1fd12dfeb038f82f74aa0f0
2018-01-25 13:31:01 +09:00
Masayuki Nakano 298150d827 Bug 1432528 - part 4: Remove nsIEditorObserver::BeforeEditAction() and nsIEditorObserver::CancelEditAction() because nobody implements them r=m_kato
Now, nobody implements nsIEditorObserver::BeforeEditAction() and
nsIEditorObserver::CancelEditAction().  So, we can remove them.

MozReview-Commit-ID: DYppLayC5oT

--HG--
extra : rebase_source : 196e042234c65a43947a1aa90898901389a3a53b
2018-01-24 14:31:29 +09:00
Masayuki Nakano 7dab388aae Bug 1432528 - part 3: Make EditorBase store IMEContentObserver directly and make it not derived from nsIEditorObserver r=m_kato
Similar to TextInputListener, EditorBase should store IMEContentObserver
directly instead of via nsIEditorObserver.  Then,
EditorBase::NotifyEditorObservers() can call each method directly.
Additionally, we can make IMEContentObserver not derived from nsIEditorObserver.

MozReview-Commit-ID: cNKWJe5eUC

--HG--
extra : rebase_source : 4ed3b3b3180b8ee4a7c514ce1f89eba4dad64fbe
2018-01-24 14:10:18 +09:00
Masayuki Nakano 74aaf9525b Bug 1432528 - part 2: Make EditorBase treat TextInputListener directly and make TextInputListener not derived from nsIEditorObserver r=m_kato
Now, EditorBase can store TextInputListener directly instead of as
nsIEditorObserver.  And then, EditorBase can call its EditAction() method
directly.  Therefore, we can make TextInputListener not derived from
nsIEditorObserver.

MozReview-Commit-ID: 4qPnnvReLKy

--HG--
extra : rebase_source : cde47e245c9856abf696dbaf8e26d8e4d6d98d42
2018-01-24 12:50:01 +09:00
Masayuki Nakano dc245c4fee Bug 1422234 - part 1: HTMLEditRules::ReturnInParagraph() should adjust split point if caret position is positioned at edge of anchor element r=m_kato
When Enter key is pressed at start or end of <a href="foo"> element, we
shouldn't split it (in other words, we shouldn't create empty <a href="foo">
element in new paragraph) because users must not want to keep editing *same*
link in new paragraph in most cases.

This patch adjusts HTMLEditRules::ReturnInParagraph() selection start point
locally when it gets selection.  If caret is at start of an <a href="foo">
element, moves caret to before the element.  If caret is at end of an
<a href="foo"> element, moves to after the element.

MozReview-Commit-ID: 3L3eDzc6Dk

--HG--
extra : rebase_source : dfb22486d2709e84ef7ec1eee3a9bfdef11cbe99
2018-01-23 11:14:37 +09:00
Makoto Kato 70a0912794 Bug 1425547 - Remove unused methods from nsIHTMLInlineTableEditor. r=masayuki
inlineTableEditingEnabled and refreshInlineTableEditingUI are used by
bluegriffon, but other methods aren't used by m-c, c-c and bluegriffon.
So I would like to remove these methods.  Then we can clean up
DoInlineTableEditingAction.

MozReview-Commit-ID: 3R0bJDU5vqv

--HG--
extra : rebase_source : 74c7615613bba65326069929cb53c3ea48f2e9a4
extra : amend_source : a1ac9af3de50daa0cbfd98e2790afa402d9932ef
2018-01-19 16:41:41 +09:00
Dorel Luca 30b5be6d16 Merge mozilla-inbound to mozilla-central r=merge a=merge 2018-01-23 19:46:03 +02:00
Andrea Marchesini b8bb98af8c Bug 1430997 - Rename nsINode::IndexOf to nsINode::ComputeIndexOf, r=catalinb 2018-01-23 14:30:18 +01:00
Masayuki Nakano 92d5c4cdd8 Bug 1430785 - Make mozInlineSpellChecker not derived from nsIEditActionListener r=m_kato
mozInlineSpellChecker listens to only DidSplitNode() and DidJoinNodes().
So, EditorBase should call them directly rather than treating it as an
nsIEditActionListener since its runtime cost becomes really cheaper.

Different from EditorSpellCheck, nobody creates instance of
nsIInlineSpellChecker.  So, we can now stop supporting createInstance() for it
in chrome JS and should do this since EditorBase cannot support multiple
mozInlineSpellChecker instances without nsIEditActionListener interface.
Therefore, this patch removes the entry from factory.

MozReview-Commit-ID: W1CLdsJaaB

--HG--
extra : rebase_source : 2319999e4b1fc8978386c49236d5d24d78d86047
2018-01-17 14:05:06 +09:00
Masayuki Nakano 2020349542 Bug 1430982 - part 10: Make EditorBase store TextServicesDocument for its mInlineSpellChecker for avoiding to run for loops to call nsIEditActionListener methods r=m_kato
Currently, first edit action listener is always TextServicesDocument for
EditorBase::mInlineSpellChecker if spell check is enabled and it requires
only DidDeleteNode() and DidJoinNodes().  So, in most cases, EditorBase
should call only them to avoid running redundant for loops for
nsIEditActionListener methods.

This patch makes that EditorBase::AddEditActionListener() and
RemoveEditActionListener() check whether coming nsIEditActionListener is
TextServicesDocument for mInlineSpellChecker.  If so, EditorBase should
store it as reference to TextServicesDocument.  And when edit action occurs,
its DidDeleteNode() and DidJoinNodes() should be called directly.

Unfortunately, this patch makes TextServiceDocument's maintaining rules
complicated.  However, it must be really rare case to add new edit action
listener because it's really old component.

Note that EditorSpellCheck may be created multiple instances for an editor
from chrome JS.  Therefore, we need to keep TextServicesDocument being
derived from nsIEditActionListener because in such case, TextServicesDocument
for other EditorSpellCheck instances should be supported via
nsIEditActionListener even though such case makes EditorBase slower.

MozReview-Commit-ID: KtlXsBCOzKL

--HG--
extra : rebase_source : 6827ed09a028f2049fd7afba2f5116d092bd14e5
2018-01-18 23:46:03 +09:00
Masayuki Nakano 0c82cf40da Bug 1430982 - part 9: Create accessors for each member of mozSpellChecker, EditorSpellCheck, mozInlineSpellChecker r=m_kato
mozSpellChecker stores TextServicesDocument, EditorSpellCheck stores
mozSpellChecker and mozInlineSpellChecker stores EditorSpellCheck.
So, they should have accessors for their member.  Then, EditorBase can
access all of them.

MozReview-Commit-ID: Igphm8nRqve

--HG--
extra : rebase_source : 0c70bf3e23f16ea6a97b49901f4b1c87e7da6d37
2018-01-18 21:38:50 +09:00
Masayuki Nakano 04e3a3adfc Bug 1430982 - part 8: Make EditorBase store inline spell checker as mozInlineSpellChecker rather than nsIInlineSpellChecker r=m_kato
EditorBase::mInlineSpellChecker is always an instance of mozInlineSpellChecker.
Fortunately, it's easy to expose mozInlineSpellChecker.h.  So, making EditorBase
store it as mozInlineSpellChecker directly, EditorBase can access any of
mozInlineSpellChecker, EditorSpellCheck, mozSpellChecker and
TextServicesDocument with new accessors created by following patch.

MozReview-Commit-ID: 2oyS5tPeQcg

--HG--
extra : rebase_source : a9ce2e4dbceff7ca800d34d60d56eba184298677
2018-01-17 00:52:37 +09:00
Masayuki Nakano 5fe683df20 Bug 1430982 - part 6: Rename nsEditorSpellCheck to mozilla::EditorSpellCheck and expose its header r=m_kato
For making mozInlineSpellChecker stores nsEditorSpellCheck directly, we need
to expose its header file.  For doing that this patch renames the class to
mozilla::EditorSpellCheck and expose it as "mozilla/EditorSpellCheck.h".

MozReview-Commit-ID: 5H66Y2vVshu

--HG--
rename : editor/composer/nsEditorSpellCheck.cpp => editor/composer/EditorSpellCheck.cpp
rename : editor/composer/nsEditorSpellCheck.h => editor/composer/EditorSpellCheck.h
extra : rebase_source : 7940aa136df312cd43bf592df1e71d2ac6c5dec8
2018-01-18 21:01:13 +09:00
Masayuki Nakano e0d185984f Bug 1430982 - part 5: Make nsEditorSpellCheck store mozSpellChecker directly rather than nsISpellChecker r=m_kato
nsEditorSpellCheck::mSpellChecker is always mozSpellChecker because it's
created only by nsEditorSpellCheck.  Additionally, mozSpellChecker.h is
already exposed.  So, nsEditorSpellCheck can store it as mozSpellChecker
directly.

MozReview-Commit-ID: 2vyDe4plncM

--HG--
extra : rebase_source : 847b2f384163450ab44b94bc12ee489633a849b6
2018-01-18 20:06:49 +09:00
Masayuki Nakano 60d2ed05ca Bug 1430982 - part 4: Get rid of nsITextServicesDocument because it used by nobody r=m_kato
nsITextServicesDocument isn't used by anybody now.  So, we can get rid of it.
Additionally, nsITextService and nsTextServicesFactory are not also used by
anybody.  Therefore, this patch removes all of them.

MozReview-Commit-ID: KSbMdm7QPKF

--HG--
extra : rebase_source : 724a5f48ad49b4231bacf7fba32c6a35d90121d0
2018-01-18 18:43:57 +09:00
Masayuki Nakano 21c3b9e2db Bug 1430982 - part 3: Make mozSpellChecker and nsEditorSpellChecker treat TextServicesDocument directly rather than nsITextServicesDocument r=m_kato
Now, TextServicesDocument can be treated by anybody.  So, let's make
mozSpellChecker and nsEditorSpellChecker treat it directly instead of
nsITextServicesDocument.

MozReview-Commit-ID: 2tMy6y3i17b

--HG--
extra : rebase_source : 2e6c79355a5e0a7044fbea989ba414a7bf1a7d8d
2018-01-18 17:32:23 +09:00
Masayuki Nakano fa1d8d7c3f Bug 1430982 - part 2: Rename nsTextServicesDocument to mozilla::TextServicesDocument and expose its header r=m_kato
For making nsTextServicesDocument accessible from anywhere directly, we need to
expose its header.  Then, it should be in mozilla namespace.

This patch renames nsTextServicesDocument to mozilla::TextServicesDocument
and expose the header file as "mozilla/TextServicesDocument.h".

MozReview-Commit-ID: 9PmP73PXSJu

--HG--
rename : editor/txtsvc/nsTextServicesDocument.cpp => editor/txtsvc/TextServicesDocument.cpp
rename : editor/txtsvc/nsTextServicesDocument.h => editor/txtsvc/TextServicesDocument.h
extra : rebase_source : a12081434d0bc002e3675178486cc7f8eaaa3256
2018-01-18 16:57:01 +09:00
Masayuki Nakano 88c945974e Bug 1430982 - part 1: Make nsTextServicesDocument store editor with RefPtr<TextEditor> rather than nsWeakPtr r=m_kato
nsTextServicesDocument stores editor with nsWeakPtr for avoiding circular
reference.  However, both TextEditor and nsTextServicesDocument are cycle
collectable. So, we don't need to worry about the issue and we can simply
make it store with RefPtr<TextEditor>.  Then, we can make EditorBase and
nsTextServicesDocument access each other directly.

MozReview-Commit-ID: 9I4U8ivFlov

--HG--
extra : rebase_source : 4880c6f7d706acc70324f58aee70d4311db44059
2018-01-18 14:33:31 +09:00
Masayuki Nakano 397a47c1b9 Bug 1430319 - Get rid of nsIEditActionListener::Will*() which are not used by anybody r=m_kato
Most nsIEditActionListener::Will*() are not implemented, except
WillDeleteText() and WillDeleteSelection() which are implemented by
FinderHighlighter.  So, we can get rid of the other Will*() from it.

This patch removes a lot of unnecessary virtual calls and copy of strong
pointers to edit action listeners of EditorBase.

MozReview-Commit-ID: EsqI2tZoBG1

--HG--
extra : rebase_source : cf78eb8d33b12ca65177b0676f6e45d02e7c0688
2018-01-13 10:10:05 +09:00
Masayuki Nakano 31d493d9fa Bug 1430021 - part 2: Make HTMLEditRules not derived from nsIEditActionListener r=m_kato
HTMLEditRules implements only some of nsIEditActionListener and this is always
first edit action listener.  So, if we make EditorBase treat HTMLEditRules
directly before notifying edit action listeners, we can save a lot of runtime
cost (virtual calls especially unnecessary, copying array of edit action
listeners with strong pointer, redundant QIs), although the code becomes not
beautiful.

Perhaps, we should do same thing to nsTextServicesDocument and
mozInlineSpellChecker in other bugs.

MozReview-Commit-ID: Eveaxj398f2

--HG--
extra : rebase_source : 0b7b66ba1002e08591e8d95ef68b216e7ce1f93b
2018-01-13 00:21:17 +09:00
Masayuki Nakano b2a3e52b16 Bug 1430021 - part 1: Move |RefPtr<TextEditRules> mRules| from TextEditor to EditorBase r=m_kato
For calling some methods of mRules from EditorBase, let's move mRules member
from TextEditor to EditorBase.

Unfortunately, TextEditRules.h depends on EditAction which is declared in
EditorBase.h and that caused unnecessary include hell of EditorBase.h.  So,
let's move it to an independent header file.

MozReview-Commit-ID: 5HiSZLP9WHH

--HG--
extra : rebase_source : 3e2c40385a6f3d6d1e03ef4e213434383bb37d5f
2018-01-12 19:01:04 +09:00
Boris Zbarsky f1d64479e7 Bug 1431964 part 10. Remove nsIDOMAttr. r=mccr8
MozReview-Commit-ID: xj4QeXBF9V
2018-01-21 12:07:31 -05:00
Boris Zbarsky e38dec29f4 Bug 1431964 part 8. Remove nsIDOMMozNamedAttrMap. r=mccr8
MozReview-Commit-ID: C7z0hcjC0Tg
2018-01-20 20:57:26 -05:00
Boris Zbarsky ac46271e7c Bug 1431964 part 5. Remove nsIDOMMozNamedAttrMap::Item. r=mccr8
MozReview-Commit-ID: GnrOUhx9nTQ
2018-01-20 18:48:36 -05:00
Makoto Kato 5c5237a5a1 Bug 1402526 - Add crashtest. r=me a=test-only 2018-01-15 14:27:45 +09:00
Adrian Wielgosik 3c2cc07d2d Bug 1379891 - remove nsPIEditorTransaction interface, GetTxnDescription methods. r=m_kato,masayuki
MozReview-Commit-ID: 4NLeMrrqIv5
2018-01-14 16:01:41 +01:00
Chris Peterson 37efe4d0e6 Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe

--HG--
extra : rebase_source : cfec2d96faeb11656d86d760a34e0a04cacddb13
extra : intermediate-source : 6176724d63788b0fe8caa3f91607c2d93dbaa7ec
extra : source : eebbb0600447f9b64aae3bcd47b4be66c02a51ea
2017-11-05 19:37:28 -08:00
Cameron McCormack 8731df3c34 Bug 1427512 - Part 29: Remove nsIDOMCSSDeclaration. r=xidorn,jryans,bz
This removes the .style attribute from nsIDOMSVGElement, but there
shouldn't be any users of that.

MozReview-Commit-ID: LOBSFo85Utn
2018-01-11 16:17:57 +08:00
Cameron McCormack 66141a0c03 Bug 1427512 - Part 27: Remove nsIDOMCSSPrimitiveValue. r=xidorn,bz
MozReview-Commit-ID: IcGKAjPWacZ
2018-01-11 16:17:57 +08:00
Cameron McCormack e3549b2d1c Bug 1427512 - Part 22: Remove nsIDOMStyleSheet. r=xidorn,bz
MozReview-Commit-ID: KO2mWX4P8lI
2018-01-11 16:17:57 +08:00
Makoto Kato 3f840ba7f5 Bug 1425652 - mosueDown, mouseUp and mouseMove should be removed from nsIHTMLObjectResizer. r=masayuki
comm-central and bluegriffon don't use mosueDown, mouseUp and mouseMove in
nsIHTMLObjectResizer, so we should remove these methods from this interface.

MozReview-Commit-ID: BnSkkH7f0xc

--HG--
extra : rebase_source : 40811e1a0b714e3ef30fd9ac5e4f840241de3780
2018-01-10 12:47:16 +09:00
Olli Pettay 3a7a79b6b8 Bug 1428747 - Make EditorBase::GetDOMEventTarget() to return EventTarget* and GetFocusedContent() return nsIContent* in order to optimize out some AddRef/Release calls, r=masayuki
--HG--
extra : rebase_source : 86be9af360438fcb1fa63f07994e41cf12d9c2e2
2018-01-09 15:41:42 +02:00
Margareta Eliza Balazs fe2caaa266 Merge inbound to mozilla-central r=merge a=merge 2018-01-09 11:52:55 +02:00
Dão Gottwald d6173b3fbb Bug 449045 - Drop support for type=timed textboxes. r=enn
MozReview-Commit-ID: Ld6foAxCAhW

--HG--
extra : rebase_source : 94065ccfb55e8a93322cd5fbbeabcc78b222bf1a
2018-01-05 21:03:39 +01:00
Makoto Kato 1f169bb35d Bug 1425091 - Part 4. EditorBase::MoveNode should check valid node that has parent node. r=masayuki
AutoMoveNodeSelNotify doesn't allow container is null.  So we should reject
that parent of moving node is null.

MozReview-Commit-ID: DGNCicLJxuK

--HG--
extra : rebase_source : eea203f16d0296c74d0727f34b6ddc5c165f9092
2017-12-15 10:56:45 -06:00