Commit Graph

7841 Commits

Author SHA1 Message Date
Wes Kocher
baf6cddc4c Merge inbound to central, a=merge
MozReview-Commit-ID: 9NFjSEt96iT
2017-08-02 17:11:51 -07:00
Olli Pettay
1c8b827d25 Bug 1371657 - Ensure editing UI is hidden when disabling editing. r=masayuki
--HG--
extra : rebase_source : cf83e8ac6662d15d15ca986f709d89edc87af28e
2017-08-02 14:04:05 -04:00
Makoto Kato
d7503476f0 Bug 699703 - Part 2. SetSelectionAfterTableEdit should check whether editor is destroyed. r=masayuki
After reframe, SetSelectionAfterTableEdit might be called from RAII class, so we should check whether editor is destroyed.

MozReview-Commit-ID: I4r6kvxgRDZ

--HG--
extra : rebase_source : 4bd71775f02f57573af0f0efd5c1946285e4e4f4
2017-08-01 16:34:17 +09:00
Makoto Kato
9b683468d5 Bug 699703 - Need reframe before calling SetSelectionAfterTableEdit. r=masayuki
HTMLEditor::TabInTable inserts row element, then it selects a cell.  But when enabling lazy frame construction for editable node, it selects invalid cell and table.

Because HTMLEditor::SetSelectionAfterTableEdit doesn't select cell correctly on InsertTableRow().

HTMLEditor::SetSelectionAfterTableEdit uses HTMLEditor::GetCellAt, so it depends on frame.  So we need flush frame before calling it.

Also, a comment of HTMLEditor::InsertTableRow is invalid now because we don't use nsresult version of CreateElementWithDefualts.

MozReview-Commit-ID: 698TvmMZgwB

--HG--
extra : rebase_source : 95df12f1f870a2c68d02b24b8758dfe6d381a416
2017-07-14 15:48:40 +09:00
Ehsan Akhgari
22aa56b6cd Bug 1386222 - Ensure that we always respect the undo/redo transaction history when modifying the <xul:textbox>.value dynamically through script; r=bzbarsky 2017-08-01 13:59:45 -04:00
Ehsan Akhgari
30d4df5778 Bug 1385538 - Avoid dynamic memory allocation for EditorBase::mSelState; r=masayuki 2017-07-31 14:13:47 -04:00
Ehsan Akhgari
f3a8bf3251 Bug 1385525 - Part 2: Make SetTextTransaction lighter weight by making it a normal C++ class allocated on the stack; r=masayuki
This avoids the cost of allocation on the heap and cycle collection,
and removes some dead code.
2017-07-31 14:12:12 -04:00
Ehsan Akhgari
18170165f0 Bug 1385525 - Part 1: Speed up EditorBase::SetTextImpl() by actually bypassing all of the editor transaction management machinery; r=masayuki 2017-07-31 14:10:50 -04:00
Ehsan Akhgari
e64f31b735 Bug 1385514 - Part 2: Replace 'spaz' with 'change' in the editor code 2017-07-31 11:20:38 -04:00
Ehsan Akhgari
5c7a6f8e12 Bug 1385514 - Part 1: Make SetTextTransaction a selection preserving transaction; r=masayuki
This makes the SetTextTransaction transaction behave more similarly to the rest of
the editor transactions, by making sure the inner transactions don't manipulate
the selections themselves and leave it up to the AfterEdit() method to take care of
adjusting the selection when the entire editing operation is finished.
2017-07-31 11:20:38 -04:00
Ehsan Akhgari
1eb17afc4f Bug 1385392 - Avoid needlessly looking up the selection twice when DoTransaction() is called from TextEditRules::WillSetText(); r=masayuki 2017-07-31 10:57:10 -04:00
Ehsan Akhgari
423b388329 Bug 1385384 - Don't store mPlaceholderTransactionWeak as a weak pointer; r=masayuki 2017-07-31 10:55:22 -04:00
Sebastian Hengst
915c63c332 merge mozilla-central to mozilla-inbound. r=merge a=merge 2017-07-31 11:28:37 +02:00
Nicholas Nethercote
72c884bf74 Bug 1384835 (part 3, attempt 2) - Remove the Preferences::Get*CString() variants that return nsAdoptingCString. r=froydnj.
--HG--
extra : rebase_source : d317b25be2ec21d1a60d25da3689e46cdce0b649
2017-07-31 14:28:48 +10:00
Nicholas Nethercote
d4f9aa5530 Bug 1384835 (part 2, attempt 2) - Remove the Preferences::Get*String() variants that return nsAdoptingString. r=froydnj.
--HG--
extra : rebase_source : 6c24fbacb03d4adebe5f22b5e7fc60b069913f20
2017-07-31 14:23:50 +10:00
Nicholas Nethercote
581214bd8b Bug 1384835 (part 1, attempt 2) - Use nsA[C]String references instead of pointers for outparams of Get*String() pref functions. r=froydnj.
--HG--
extra : rebase_source : fe566945a55c281d8290634a5b55bed19415c839
2017-07-31 10:52:51 +10:00
Makoto Kato
2652b1c5d2 Bug 1385749 - Move test_bug795418-*.html to subsuite=clipboard. r=masayuki
test_bug795418-*.html depends on clipboard.  But these tests aren't subsuite=clipboard and are sometimes failure (bug 1334700, bug 1335221, bug 1339430, bug 1343883 and bug 1348093).  So we should move these to subsuite=clipboard to try fixing this.

MozReview-Commit-ID: 1m5dFGZ18a

--HG--
extra : rebase_source : 847b1b7842c32e93c61b8ee572cff16c70adc323
2017-07-31 11:58:41 +09:00
Makoto Kato
3d4f2d6fdc Bug 1383755 - Part 2. Add crash test for object resizer. r=masayuki
MozReview-Commit-ID: WLyLl5vIj0

--HG--
extra : rebase_source : c1166eefe7787761346e6bad069b34dcb42c94e7
2017-07-27 18:21:27 +09:00
Makoto Kato
44c1ed6949 Bug 1383755 - Part 1. NAC property might be removed by nsIDocument::AdoptNode. r=masayuki
nsIDocument::AdoptNode might to remove all properties.  So before destroying editor, NAC property might be already removed.  So we have to consider that NAC is removed.

MozReview-Commit-ID: DakRRqrzEtF

--HG--
extra : rebase_source : ce972f1b42b6ff7efdf09b9a70cc1a9d27f128fb
2017-07-31 12:56:34 +09:00
Kyle Machulis
d812ac4e87 Bug 1279218 - Additional applet tag logic removal; r=bz
I've been having problems with interdiffs on mozreview lately, so for
ease of review, this patch is being submitted as a seperate patch for
review. Once it is r+'d, it will be folded into the first patch in
this set before landing.

MozReview-Commit-ID: CS9MngaXlBd

--HG--
extra : rebase_source : 6a86fd4f7a66e73497a756976a2562d183002a2a
2017-07-28 16:44:39 -07:00
Christoph Kerschbaumer
db40f0ec94 Bug 1385240 - Update editor/libeditor/tests/test_bug635636.html to comply with new data: URI inheritance model. r=masayuki 2017-07-28 13:34:24 +02:00
Carsten "Tomcat" Book
892bedca2e merge mozilla-inbound to mozilla-central a=merge 2017-07-28 15:24:39 +02:00
Sebastian Hengst
d7527a414d Backed out changeset 07b534f44740 (bug 1384835) for failing xpcshell's security/manager/ssl/tests/unit/test_cert_sha1.js checkCertErrorGenericAtTime on Linux x64 debug. r=backout 2017-07-28 10:30:29 +02:00
Sebastian Hengst
1d708511f0 Backed out changeset 5df4d8778602 (bug 1384835) 2017-07-28 10:29:29 +02:00
Sebastian Hengst
744a0a216b Backed out changeset ef5feef07bed (bug 1384835) 2017-07-28 10:29:24 +02:00
Carsten "Tomcat" Book
28bdd40776 Merge mozilla-central to mozilla-inbound 2017-07-28 09:48:24 +02:00
Carsten "Tomcat" Book
2ff6df9177 Backed out changeset 5198322f7a62 (bug 1351148) 2017-07-28 09:20:20 +02:00
Carsten "Tomcat" Book
6aa98d7df0 Merge mozilla-central to autoland 2017-07-28 09:50:36 +02:00
Nicholas Nethercote
200d8ec18b Bug 1384835 (part 3) - Remove the Preferences::Get*CString() variants that return nsAdoptingCString. r=froydnj.
This is similar like the previous patch, but for the 8-bit string variants.
Also, it changes assignment to Adopt() in GetCString() and GetDefaultCString()
to avoid an extra copy.

--HG--
extra : rebase_source : eba805c3a7b809d5ccd6e853b1c9010db9477667
2017-07-27 16:45:10 +10:00
Nicholas Nethercote
0574a6b496 Bug 1384835 (part 2) - Remove the Preferences::Get*String() variants that return nsAdoptingString. r=froydnj.
Because we want to remove nsAdoptingString. We have other variants that don't
use nsAdoptingString, which can be used instead. There are three basic
patterns.

1. The easiest case is when we don't check for success.

> nsAdoptingString s = Preferences::GetString("foo");
> foo(s);

becomes:

> nsAutoString s;
> Preferences::GetString("foo", s);
> foo(s);

2. The next case is when we check if the result is empty.

> nsAdoptingString s = Preferences::GetString("foo");
> if (s.IsEmpty()) { ... }

becomes:

> nsAutoString s;
> Preferences::GetString("foo", s);
> if (s.IsEmpty()) { ... }

3. The final case is when we null check the result.

> nsAdoptingString s = Preferences::GetString("foo");
> if (s) { ... }

becomes:

> nsAutoString s;
> nsresult rv = Preferences::GetString("foo", s);
> if (NS_SUCCEEDED(rv)) { ... }

The patch also avoids some UTF8/UTF16 conversions in a few places.

--HG--
extra : rebase_source : f339b1a3dda4dc93979d38c30c001fbe77485b55
2017-07-25 20:36:14 +10:00
Nicholas Nethercote
f314cbcbe5 Bug 1384835 (part 1) - Use nsA[C]String references instead of pointers for outparams of Get*String() pref functions. r=froydnj.
This is basically a cosmetic change; references are the normal way to do string
outparams.

--HG--
extra : rebase_source : ffc5945f269bdcd3d4116755b56713e87a44b6cd
2017-07-25 19:12:56 +10:00
Julian Seward
408d24da56 Bug 1382563 - Remove ns*String::AssignWithConversion. r=erahm.
This patch replaces four functions of the name AssignWithConversion which
are essentially wrappers around CopyASCIItoUTF16 and LossyCopyUTF16toASCII
with direct calls to the latter two functions.  The replaced functions are:

  void nsCString::AssignWithConversion( const nsAString& aData )
  void nsString::AssignWithConversion( const nsACString& aData )

  void nsTString_CharT::AssignWithConversion(
                            const incompatible_char_type* aData,
                            int32_t aLength = -1);

The last of the three exists inside the double-included nsTString* world and
so describes two functions, giving four in total.

This has two advantages:

* it removes code

* at the call points, it makes clear (from the replacement name) which
  conversion is being carried out.  The generic name "AssignWithConversion"
  doesn't make that obvious -- one had to infer it from the types.

The patch also removes two commented out lines from
editor/composer/nsComposerCommands.cpp, that appear to be related.  They are
at top level, where they would never have compiled.  They look like
leftovers from some previous change.

--HG--
extra : rebase_source : fb47bf450771c3c9ee3341dd14520f5da69ec4f5
2017-07-24 19:23:52 +02:00
J. Ryan Stinnett
c79cb3fbb1 Bug 1380053 - Stylo reftest annotations for all OSes. r=manishearth
MozReview-Commit-ID: JNsNUOZfd2e

--HG--
extra : rebase_source : 05a71f9a0fe484c93931fb230cf0752a3b1b8b00
2017-07-20 22:02:00 -05:00
Bevis Tseng
95b18d794e Bug 1382172 - Name nsITimerCallback instances in native implementation. r=billm
--HG--
extra : rebase_source : 84de1abfcc30a6964144c2e6718a508c71027b65
2017-07-27 02:18:20 +08:00
Bevis Tseng
a7505864a8 Bug 1378930 - Part 2: Remove the aName parameter from SchedulerGroup/DocGroup/DispatcherTrait. r=billm
--HG--
extra : rebase_source : 11319e568a51d16754a6a9990f76c35c86c2bda7
2017-07-26 16:13:35 +08:00
Carsten "Tomcat" Book
679210723b merge mozilla-inbound to mozilla-central a=merge 2017-07-25 14:27:17 +02:00
Cameron McCormack
7b2f841ea9 Bug 1383988 - stylo: Ensure editor handle elements are styled before attempting to construct frames for them. r=hiro
MozReview-Commit-ID: 2T0ZjP00U7A

--HG--
extra : rebase_source : 02e527baac50c2267afb3ed199aee91e72a08b02
2017-07-25 14:08:19 +08:00
Yoshi Huang
7036b3761f Bug 1382531 - Part 1: rewrite crashtest for data: URI is unique opaque origin. r=smaug 2017-07-25 09:56:02 +08:00
Wes Kocher
d45eb771f0 Merge m-c to inbound, a=merge
MozReview-Commit-ID: Ah48RzFU8Mt
2017-07-21 18:20:46 -07:00
Wes Kocher
051dc17e6c Merge inbound to central, a=merge CLOSED TREE
MozReview-Commit-ID: GYc8r8gnS0j
2017-07-21 18:12:55 -07:00
Ryan VanderMeulen
f4e3a91992 Merge m-c to inbound. a=merge 2017-07-21 09:40:28 -04:00
Sylvestre Ledru
7c0ae251cd Bug 1381253 - Remove redundant control flow declarations rs=ehsan
MozReview-Commit-ID: FFxP4aMCbOL

--HG--
extra : amend_source : 3aec108430b11048f47ffe19d5da7ac5034770a9
2017-07-15 19:03:04 +02:00
Ehsan Akhgari
2ee7157f0e Bug 1383079 - Don't AddRef() the editor root node in TextEditRules::WillOutputText(); r=masayuki 2017-07-21 13:37:47 -04:00
Makoto Kato
256e9a6424 Bug 1359345 - HTMLEditor::IsVisBreak() should be renamed to HTMLEditor::IsVisibleBRElement(). r=masayuki
MozReview-Commit-ID: 2KqRauu10QE

--HG--
extra : rebase_source : 36a42d6c7d13d1eb9ba570fc0e99fcd2570e6f9b
2017-07-21 16:10:10 +09:00
Stone Shih
a5bccae405 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
Masayuki Nakano
2f92264fb7 Bug 1377978 - Make nsRange use uint32_t to offset r=smaug
DOM Standard defines that offset of Range is unsigned long.  However, nsRange uses int32_t to them.

This patch makes nsRange use uint32_t instead.  However, this patch does NOT allow to set over INT32_MAX as offset values since a lot of users of nsRange cannot treat the values as over INT32_MAX because a lot of internal APIs take int32_t as offsets.

For easier to search such points, this patch adds static_cast<int32_t> to uint32_t variables when they are used for int32_t arguments.

And note that nsContentUtils::ComparePoints() behaves odd.  It accepts negative offset and compares such value with valid offset simply.  This patch still uses int32_t offset variables in nsRange::CompareNodeToRange() even though it may be negative value if nsINode::IndexOf() returns -1 because the caller of it depends on this behavior.

MozReview-Commit-ID: 8RbOgA86JuT

--HG--
extra : rebase_source : 46d526c6d50dfa2f104439b19b8691477b17a4af
2017-07-19 22:49:52 +09:00
Christoph Kerschbaumer
0d84b0bb91 Bug 1380717 - Updates more tests within editor/ to comply with new data: URI inheritance model. r=masayuki 2017-07-14 12:14:23 +02:00
Carsten "Tomcat" Book
0edfa97e38 merge mozilla-inbound to mozilla-central a=merge 2017-07-12 11:07:09 +02:00
Yoshi Huang
71b8c7686e Bug 1377492 - fix mochitest-1 failure in docshell when data: URI is a unique origin. r=smaug
When we turn on the pref security.data_uri.unique_opaque_origin to make
data URI is unique origin, the following tests will fail because now
data document is treated as cross origin, so we replace data URIs with
seperate files, hence it will still in the same origin.
2017-07-12 10:35:54 +08:00
Makoto Kato
86506e2303 Bug 1345015 - Part 3. Add crash test. r=masayuki
Add minimal crash test for this.  When removing a line, this doesn't occur.

MozReview-Commit-ID: JqS2E8q47ML

--HG--
extra : rebase_source : 322a77cbc49e29bbd6b705650485634dd4801b8b
2017-06-19 16:52:05 +09:00