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

9215 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 9405d61cb8 Bug 1546577 - Make overloads of CanCut(), CanCopy(), CanDelete() and CanPaste() which return bool instead of nsresult r=m_kato
`CanCut()`, `CanCopy()` and `CanPaste()` return error only when the editor has
already been destroyed or not been initialized yet, or when failed to access
clipboard when the document is not HTML/XHTML.

`CanDelete()` returns error only when the editor has already been destroyed or
not been initialized yet.

So, these error result won't be exposed to the web in most cases and such
exception shouldn't stop any content script because Chrome basically does not
throw exception in such situation as far as I know.

Therefore, there should be overloads of them to return `bool` result directly
for making their callers simpler.

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

--HG--
extra : moz-landing-system : lando
2019-04-25 07:14:39 +00:00
Ryan Hunt 0eeced87be Bug 1534395 - Rename TabParent to BrowserParent. r=nika
This commit renames TabParent to BrowserParent.

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

--HG--
rename : dom/ipc/TabParent.cpp => dom/ipc/BrowserParent.cpp
rename : dom/ipc/TabParent.h => dom/ipc/BrowserParent.h
extra : rebase_source : d2706b9f42177d8de16068b7b1d088a44b8720a4
extra : histedit_source : a617ddac45c58050ef799116a67d2d983f2a8f6d%2C1d1dabd8761a32d548a6fbf1027be960698f6a5e
2019-04-09 16:38:15 -05:00
Andreea Pavel 6d71ad8258 Bug 1535792 - disabled test_richtext2.html on linux32 debug r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D27441

--HG--
extra : moz-landing-system : lando
2019-04-21 13:03:24 +00:00
Daniel Varga 2b1837cc6d Backed out changeset 2ef93e029730 (bug 1535792) for ParseError: could not parse: (os == 'android') || ((debug && (os == 'linux') && (bits == 32)). On a CLOSED TREE 2019-04-23 10:59:21 +03:00
Razvan Maries c973f005fe Bug 1535792 - Disabled test test_richtext2.html on Linux32 debug r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D28291

--HG--
extra : moz-landing-system : lando
2019-04-21 14:28:48 +00:00
Srujana Peddinti b44e48bff4 Bug 1259660 - Moved mozilla::WidgetMosueEventBase::buttonType in MouseEvents.h to mozilla::MouseButton in EventForwards.h, and mozilla::WidgetMouseEventBase::buttonsFlag to mozilla::MouseButtonsFlag r=masayuki
Moved mozilla::WidgetMosueEventBase::buttonType in MouseEvents.h to mozilla::MouseButton in EventForwards.h, and mozilla::WidgetMouseEventBase::buttonsFlag to mozilla::MouseButtonsFlag so that any referer in header files do not need to include MouseEvents.h only for referring them. Instead, they just need to include EventForwards.h. Now when MouseEvents.h is changed, the rebuild speed becomes faster.

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

--HG--
extra : moz-landing-system : lando
2019-04-21 20:13:34 +00:00
Srujana Peddinti 5f185eb5aa Bug 1259660 - Cleaned up WidgetMouseEventBase by renaming WidgetMouseEventBase::button to WidgetMouseEventBase::mButton. r=masayuki
Renamed all class member instances from WidgetMouseEventBase::button to WidgetMouseEventBase::mButton.

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

--HG--
extra : moz-landing-system : lando
2019-04-21 18:17:10 +00:00
Andrew McCreight f242e71c8a Bug 1545822 - Clean up some whitespace in XPIDL files. r=froydnj
The attributes for an interface should be on the line right before the
interface.

Interface attributes should be separated by spaces.

Clean up some trailing whitespace in widget/.

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

--HG--
extra : moz-landing-system : lando
2019-04-21 01:47:00 +00:00
Andrew McCreight 9c94962bf5 Bug 1545831 - Use ChromeUtils.generateQI in a few more places. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D28241

--HG--
extra : moz-landing-system : lando
2019-04-19 19:58:13 +00:00
Ian Moody be1cc378ed Bug 1379466 - Make editor listen for auxclick mouse events. r=smaug,masayuki
Editable elements will no longer get click events for non-primary mouse buttons
since they are being unshipped from the web in favour of auxclick events.
Listen for auxclick as well so middle-click paste still works.
Don't stop propagation after middle-click paste, instead ignore clicks on
contenteditable elements in ClickHandlerChild.
Update test_middle_click_paste.html for the new behaviour.

Also remove the mNoContentDispatch overrides in HTMLInputElement and
HTMLTextAreaElement that were needed for middle-pasting.

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

--HG--
extra : moz-landing-system : lando
2019-04-18 12:57:36 +00:00
Brian Grinstead 381332c51e Bug 1544051 - Part 3 - Scripted change to remove references to AddTask.js r=ahal
This was generated with the script at https://bug1544051.bmoattachments.org/attachment.cgi?id=9058672

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

--HG--
extra : moz-landing-system : lando
2019-04-18 16:51:01 +00:00
Brian Grinstead c4fa4cfc0c Bug 1544322 - Part 4 - Remove the [type] attribute for multiline <script> tags loading files in /tests/SimpleTest/ r=bzbarsky
This is an autogenerated commit to handle scripts loading mochitest harness files, in
the case where the script src is on the line below the script tag.

This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170
using the `--part 4` argument.

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

--HG--
extra : moz-landing-system : lando
2019-04-16 04:01:46 +00:00
Brian Grinstead 911776d674 Bug 1544322 - Part 3 - Remove the [type] attribute for multiline <script> tags loading files in chrome://mochikit/content/ r=bzbarsky
This is an autogenerated commit to handle scripts loading mochitest harness files, in
the case where the script src is on the line below the script tag.

This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170
using the `--part 3` argument.

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

--HG--
extra : moz-landing-system : lando
2019-04-16 03:59:25 +00:00
Brian Grinstead ede8c44ef2 Bug 1544322 - Part 2.1 - Remove the [type] attribute for one-liner <script> tags loading files in /tests/SimpleTest/ in everything except for dom/ r=bzbarsky
This excludes dom/, otherwise the file size is too large for phabricator to handle.

This is an autogenerated commit to handle scripts loading mochitest harness files, in
the simple case where the script src is on the same line as the tag.

This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170
using the `--part 2` argument.

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

--HG--
extra : moz-landing-system : lando
2019-04-16 03:50:44 +00:00
Brian Grinstead 6515f97bcb Bug 1544322 - Part 1 - Remove the [type] attribute for one-liner <script> tags loading files in chrome://mochikit/content/ r=bzbarsky
This is an autogenerated commit to handle scripts loading mochitest harness files, in
the simple case where the script src is on the same line as the tag.

This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170
using the `--part 1` argument.

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

--HG--
extra : moz-landing-system : lando
2019-04-15 20:56:58 +00:00
Masayuki Nakano b19088bb41 Bug 1543966 - part 2: Make "HTML editor commands" and "document state commands" singleton classes r=m_kato
Some "HTML editor commands" are stateful due to storing tag name to handle it
with specific command.  However, we can make it stateless with retrieving
tag name from command name once per command only when it's necessary.  The
runtime cost must be really cheap since we can map it with hash table.

This patch makes them stateless and singleton classes.  So, we can save
footprint and allocation runtime cost with this change.

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

--HG--
extra : moz-landing-system : lando
2019-04-15 07:29:17 +00:00
Masayuki Nakano 6d9c401af5 Bug 1543966 - part 1: Make "editing commands" and "editor commands" singleton classes r=m_kato
Different from the comment in `EditorCommands.h`, editing commands and
editor commands are instantiated for each editable document or each
`HTMLInputElement` or `HTMLTextareaElement`.  Therefore, even though they
are stateless, we allocate too many instances of them.  We should make
them singleton classes to reduce the footprint and save runtime allocation
cost.

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

--HG--
extra : moz-landing-system : lando
2019-04-15 07:49:46 +00:00
Masayuki Nakano 414509fe00 Bug 1543315 - part 9: Mark nsIPresShell::FlushPendingNotifications() as MOZ_CAN_RUN_SCRIPT r=smaug
So, this patch makes all caller of it safe including its arguments unless
they come from other methods.

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

--HG--
extra : moz-landing-system : lando
2019-04-13 12:43:57 +00:00
Masayuki Nakano 0986fb819b Bug 1542506 - Make nsDocShell use mozilla::PresShell* directly rather than nsIPresShell* r=bzbarsky
This patch makes `nsDocShell::GetPresShell()` and
`nsDocShell::GetEldestPresShell()` return `mozilla::PresShell*` and
some non-public methods use `mozilla::PresShell*` directly.

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

--HG--
extra : moz-landing-system : lando
2019-04-13 01:03:13 +00:00
Sylvestre Ledru 7f60810d86 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-12 13:14:25 +00:00
Makoto Kato e6c2e7bc87 Bug 1543585 - Clean up finding words for spellchecker. r=masayuki
`mozSpellChecker::Replace` and `mozSpellChecker::NextMisspelledWord` have a loop
to find word from text content. But `mozEnglishWordUtils::FindNextWord` always
returns `NS_OK` and some code doesn't check error even if `nsresult` local
variable is used.

So I would like to clean up this loop.

- `mozEnglishWordUtils::FindNextWord` should return true if word is found
- We should use reference type for some `TextServicesDocument`'s methods.
- Add more check for error

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

--HG--
extra : moz-landing-system : lando
2019-04-12 03:54:18 +00:00
Masayuki Nakano 349901dac4 Bug 1539110 - Make HTMLEditor::RemoveStyleInside() and HTMLEditor::SplitStyleAbovePoint() check tag names with whitelist r=m_kato
`document.execCommand("removeformat")` removes any elements in the range which
are editable, not `<a>`, not block and a container.
https://searchfox.org/mozilla-central/rev/dd7e27f4a805e4115d0dbee70e1220b23b23c567/editor/libeditor/HTMLStyleEditor.cpp#760-763

This means that it removes hidden elements like `<script>` and `<style>`,
or non-HTML elements like SVG elements.  However, the unofficial document
of `execCommand()` lists up elements which should be handled by the command.
https://w3c.github.io/editing/execCommand.html#removeformat-candidate

Additionally, Chrome respects this list since not including `<del>` element
into the list does not make sense but Chrome ignores it.  So, we should
respect the list.

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

--HG--
extra : moz-landing-system : lando
2019-04-12 01:17:50 +00:00
Cosmin Sabou 9599610f96 Bug 1424790 - Disable 694880-1.html on Android 4.3 and linux !debug for frequent failures. r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D26659

--HG--
extra : moz-landing-system : lando
2019-04-09 10:40:42 +00:00
Masayuki Nakano a50a0700d4 Bug 1530649 - Improve composition string handling which ends with whitespaces r=m_kato
If insertion string ends with ASCII whitespace and there is no following
content in the block, `HTMLEditRules::AdjustWhitespaces()` needs to insert
`<br>` element.  It's called only by `HTMLEditRules::AfterEditInner()` and
that does only simple things with `WSRunObject`.  Therefore, this moves the
code into `AfterEditInner()`.

For making it adjust the whitespaces, `HTMLEditRules::WillInsertText()` needs
to notify `AfterEditInner()` of dirty range with `mDocChangeRange`.  Therefore,
this patch makes it set `mDocChangeRange` manually after inserting composition
string.

On the other hand, there is another bug.  `WSRunObject` was designed to treat
only inserting text for `WSRunObject::InsertText()`.  I.e., not designed to
treat replacing existing composition string with new string.  Therefore,
`WSRunObject::InsertText()` adjusts whitespaces only around start of
composition string.  Therefore, if composition string ends with an ASCII
whitespace, it's not replaced with NBSP and that causes:
- failing `WSRunObject::AdjustWhitespaces()` inserts `<br>` element at
  `AfterEditInner()` of committing composition.
- then, next composition's first `WSRunObject::InsertText()` removes the
  last whitespace due to not followed by `<br>` nor any other content.
Therefore, this patch makes `WSRunObject` takes 2 DOM points to be able to
treat replaced range.

In strictly speaking, the latter change require more changes and tests for
supporting replacement with any other methods.  However, it's risky and out
of scope of this bug.

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

--HG--
extra : moz-landing-system : lando
2019-04-09 05:28:38 +00:00
Emilio Cobos Álvarez d15876acb4 Bug 1541952 - Move ApplicableStylesChanged() to Document. r=heycam
It's the right place for it to be now that it owns the StyleSet.

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

--HG--
extra : moz-landing-system : lando
2019-04-06 19:25:25 +00:00
Emilio Cobos Álvarez 7980a72d0a Bug 760345 - Remove the last usage of lossy currentcolor. r=heycam
We don't have lossy currentcolor in the style system anymore, except for a
single property -moz-font-smoothing-background-color.

I could've converted it into a proper StyleColor and thread down all the
necessary information to the font metrics code.

But it doesn't really seem worth it given it's not exposed to the web, so I just
did the simplest thing, which is making currentcolor compute to transparent to
that specific property.

This patch also removes the stores_complex_colors_lossily code and related,
since now we always can cache computed colors.

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

--HG--
extra : moz-landing-system : lando
2019-04-06 17:47:58 +00:00
Sylvestre Ledru 03fc65347c Bug 1542146 - Apply the change with the option StatementMacros from clang-format-8 r=andi
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-05 21:42:17 +00:00
Sylvestre Ledru 03c8e8c2dd Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-05 21:41:42 +00:00
Csoregi Natalia ba58e936bd Backed out changeset 4ad80127f89f (bug 1519636) for bustage on MarkupMap.h and nsAccessibilityService.cpp. CLOSED TREE 2019-04-05 09:48:19 +03:00
Sylvestre Ledru d1c1878603 Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-04 21:36:16 +00:00
Brindusan Cristian c298fe167e Backed out changeset 1ea4b3582033 (bug 760345) for build bustages at ia2AccessibleComponent.cpp. 2019-04-05 07:49:09 +03:00
Emilio Cobos Álvarez 993731e44b Bug 760345 - Remove the last usage of lossy currentcolor. r=heycam
We don't have lossy currentcolor in the style system anymore, except for a
single property -moz-font-smoothing-background-color.

I could've converted it into a proper StyleColor and thread down all the
necessary information to the font metrics code.

But it doesn't really seem worth it given it's not exposed to the web, so I just
did the simplest thing, which is making currentcolor compute to transparent to
that specific property.

This patch also removes the stores_complex_colors_lossily code and related,
since now we always can cache computed colors.

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

--HG--
extra : moz-landing-system : lando
2019-04-04 22:06:03 +00:00
Narcis Beleuzu 24dbe577a5 Backed out changeset 389b6bbd76db (bug 1519636) for bustages on MarkupMap.h . CLOSED TREE 2019-04-05 00:27:56 +03:00
Sylvestre Ledru 399dbd28fe Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-04 20:12:23 +00:00
Masayuki Nakano 98518a7159 Bug 1540969 - Get rid of nsPICommandUpdater r=bzbarsky
`nsPICommandUpdater` is a scriptable interface, but nobody refers it from JS,
and it's implemented only by `nsCommandManager`.  Therefore, we can get rid
of this interface.

Additionally, `nsCommandManager::Init()` is called only by `nsDocShell`, which
is the only instantiater of the class, and returns error only when given window
is nullptr.  Therefore, we can make the constructor take the window instead.

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

--HG--
extra : moz-landing-system : lando
2019-04-03 12:53:54 +00:00
Masayuki Nakano 4204b59128 Bug 1540963 - Make nsIControllerCommandTable builtinclass and make its users use nsControllerCommandTable directly r=bzbarsky
`nsIControllerCommandTable` isn't implemented with JS even in comm-central nor
BlueGriffon.  Therefore, we can make it a builtinclass.

Additionally, it's inherited only by nsControllerCommandTable.  So, all users
in C++ can treat the concrete class directly.

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

--HG--
extra : moz-landing-system : lando
2019-04-03 12:52:14 +00:00
Masayuki Nakano 8329e8382e Bug 1540962 - Make nsICommandManager builtinclass and make users use nsCommandManager directly r=bzbarsky
`nsICommandManager` isn't implemented by JS even in comm-central nor
BlueGriffon.  Therefore, we can make it a builtinclass.

Additionally, this patch makes all users in C++ use `nsCommandManager` which is
the only implementation of `nsICommandManager`.  This avoids QI from
`nsICommandManager` to `nsPICommandUpdater`.

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

--HG--
extra : moz-landing-system : lando
2019-04-03 12:51:38 +00:00
Emilio Cobos Álvarez d8e2990d8a Bug 1535788 - Make the Document own the StyleSet. r=heycam
This is the last step to be able to call matchMedia on display: none iframes.

This is green, except for some startup preference query tests that I'm going to
address in a blocking bug (making LangGroupFontPrefs global, basically).

The setup is similar to the ShadowRoot one, except we don't eagerly keep the
StyleSet around up-to-date, we only fill it if it ever had a pres context.

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

--HG--
extra : moz-landing-system : lando
2019-04-03 07:02:00 +00:00
Masayuki Nakano e28c807e5a Bug 1533989 - Make InputEvent.data and InputEvent.dataTransfer not expose clipboard data if user disables clipboard events r=smaug
If user disables clipboard events, it means that they don't want to expose
clipboard data to web apps even if web apps cannot handle "paste" operation.
Therefore, they must not want to leak clipboard data with `InputEvent.data`
and `InputEvent.dataTransfer`.

This patch makes `InputEvent::GetData()` and `InputEvent::GetDataTransfer()`
returns empty string or new `DataTransfer` object which has only empty string
if:
- They are called by content JS.
- The event is a trusted event.
- `inputType` value is `insertFromPaste` or `insertFromPasteAsQuotation`.

The reason why we don't return null for both is, Input Events spec declares
`data` or `dataTransfer` shouldn't be null in the `inputType` values.  And
the reason why we don't return empty `DataTransfer` is, web apps may expect
at least one data is stored in non-null `dataTransfer` value.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 16:08:11 +00:00
Masayuki Nakano 3e64f2c30d Bug 1539356 - Mark EditorBase::InsertNodeTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato
This patch marks `EditorBase::InsertNodeTransaction()` **and** its callers as `MOZ_CAN_RUN_SCRIPT`.

Unfortunately, this patch tells us that some `GetSomething()` methods may destroy the editor since `HTMLEditRules::GetNodesForOperation()`, `HTMLEditRules::GetNodesFromPoint()` and `HTMLEditRules::GetNodesFromSelection()` may change the DOM tree.  Additionally, initialization methods may destroy the editor since it may insert a bogus `<br>` node.

Note that this patch also removes some unused methods. I.e., they are not result of some cleaning up the code. This patch just avoids marking unused methods as `MOZ_CAN_RUN_SCRIPT`.

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

--HG--
extra : moz-landing-system : lando
2019-03-30 11:55:29 +00:00
Oana Pop Rus 43fadb6745 Backed out changeset 447c87c2d139 (bug 1539356) on request of Jorg K. a=backout 2019-03-30 00:42:32 +02:00
Masayuki Nakano de2d589e58 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 15:12:47 +00:00
Dorel Luca 5a0fa68b78 Backed out 3 changesets (bug 1540015) for build bustage. CLOSED TREE
Backed out changeset 7b71c9da0214 (bug 1540015)
Backed out changeset 5723ddbc5c44 (bug 1540015)
Backed out changeset 9561d2c36fa5 (bug 1540015)
2019-03-29 16:14:26 +02:00
Masayuki Nakano 9273f25ce2 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 13:09:26 +00:00
Masayuki Nakano 81b30d7143 Bug 1539356 - Mark EditorBase::InsertNodeTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato
This patch marks `EditorBase::InsertNodeTransaction()` **and** its callers as `MOZ_CAN_RUN_SCRIPT`.

Unfortunately, this patch tells us that some `GetSomething()` methods may destroy the editor since `HTMLEditRules::GetNodesForOperation()`, `HTMLEditRules::GetNodesFromPoint()` and `HTMLEditRules::GetNodesFromSelection()` may change the DOM tree.  Additionally, initialization methods may destroy the editor since it may insert a bogus `<br>` node.

Note that this patch also removes some unused methods. I.e., they are not result of some cleaning up the code. This patch just avoids marking unused methods as `MOZ_CAN_RUN_SCRIPT`.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 10:55:31 +00:00
Makoto Kato 66d295beb2 Bug 1540062 - Get rid of nsIPlaintextEditor.setWrapColumn. r=masayuki
No one (m-c, c-c and bluegriffon) uses nsIPlaintextEditor.setWrapColumn from
script. It is used from C++ only.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 09:44:36 +00:00
Masayuki Nakano 0a753c3aac Bug 1533293 - part 3: Make editor and ContentEventHandler not use Selection::Extend() due to too slow r=m_kato
`Selection::Extend()` is too slow but editor and ContentEventHandler use it in
some places.  We should make them use `Selection::SetStartAndEndInLimiter()` or
`Selection::SetBaseAndExtentInLimiter()`.  The former is usable only when caller
guarantees the start point is prior to the end point in the DOM tree.
Otherwise, we need to use the latter even though it's slower than the former.

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

--HG--
extra : moz-landing-system : lando
2019-03-26 10:09:47 +00:00
Masayuki Nakano 534fd23ca4 Bug 1533293 - part 2: Rewrite EditorBase::SelectEntireDocument() and its overrides r=m_kato
`EditorBase::SelectEntierDocument()` uses `Selection::Extend()` but it's too
slow.  It should use `Selection::SetStartAndEndInLimiter()` instead.

Additionally, `TextEditor::SelectEntierDocument()` shrink the result of
`EditorBase::SelectEntierDocument()` with `Selection::Extend()` if there is
a `moz-<br>` element.  So, `TextEditor::SelectEntinerDocument()` should set
its expected selection with a call for saving the runtime cost.

Then, we don't need to make `EditorBase::SelectEntierDocument()` as non-pure
virtual method.  So, this patch makes each its callers call
`Selection->SelectAllChildren()` directly.

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

--HG--
extra : moz-landing-system : lando
2019-03-26 10:06:43 +00:00
Masayuki Nakano e4ea50f3f8 Bug 1533293 - part 1: Create Selection::SetStartAndEnd() to set new range as far as faster r=smaug
`Selection::Extend()` is too slow because:
- it may create some `nsRange` instances.
- it users `nsContentUtils::ComparePoints()` multiple times.

Therefore, we can improve the performance if we can stop using it in some
places.  First, this patch creates `Selection::SetStartAndEnd()` and
`Selection::SetStartAndEndInLimiter()` for internal use.  They remove
current ranges, reuse `nsRange` instance as far as possible and add new
range which is set by their arguments.  Then, this patch makes
`Selection::SelectAllChildren()` stop using `Selection::Extend()`.  At this
time, this fixes a web-compat issue.  `Selection::Expand()` cannot cross the
selection limiter boundary when there is a limiter (e.g., when an editing host
has focus).  But we can now fix this with using the new internal API.

Note that methods in editor shouldn't move selection to outside of active
editing host.  Therefore, this patch adds `Selection::SetStartAndEndInLimiter()`
and `Selection::SetBaseAndExtentInLimiter()` for them.

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

--HG--
extra : moz-landing-system : lando
2019-03-26 10:06:00 +00:00
shindli 12c0629a98 Merge mozilla-central to inbound. a=merge CLOSED TREE
--HG--
rename : js/src/tests/non262/fields/basic.js => js/src/jit-test/tests/fields/basic.js
rename : js/src/tests/non262/fields/literal.js => js/src/jit-test/tests/fields/literal.js
rename : js/src/tests/non262/fields/mixed_methods.js => js/src/jit-test/tests/fields/mixed_methods.js
rename : js/src/tests/non262/fields/quirks.js => js/src/jit-test/tests/fields/quirks.js
2019-03-21 06:36:37 +02:00