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

8344 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 7c53b094a1 Bug 1415414 - Make DeleteRangeTransaction::CreateTxnsToDeleteBetween() and DeleteRangeTransaction::CreateTxnsToDeleteContent() use RawRangeBoundary as their arguments r=m_kato
By the fix of bug 1407352, DeleteRangeTransaction::CreateTxnsToDeleteBetween()
starts to use child node instead of a set of container node and offset in it.
However, this is ugly and using RawRangeBoundary may reduce computing offset
more.  So, they should use RawRangeBoundary to refer delete points.

MozReview-Commit-ID: pwDHOxpz0E

--HG--
extra : rebase_source : 3871ba4fa3cfb174d5dac57822ae69c40a305323
2017-11-08 15:01:23 +09:00
Masayuki Nakano 806668b21a Bug 1415062 - part 2: Editor should use Selection::Collapse(const RawRangeBoundary&) as far as possible r=m_kato
In some places, editor computes index from child node for collapsing selection
at the child node.  However, it's expensive.  Therefore, editor should use
Selection::Collapse(const RawRangeBoundary&) as far as possible.

MozReview-Commit-ID: LF2MwASuXzZ

--HG--
extra : rebase_source : b7afc35c0d9d88845391b6f18de57cbff1935ae4
2017-11-07 19:50:25 +09:00
Narcis Beleuzu 218e1676cb Merge inbound to mozilla-central r=merge a=merge 2017-11-08 12:51:09 +02:00
Makoto Kato 5edeee8f72 Bug 1414581 - Part 2. Add crashtest. r=masayuki
MozReview-Commit-ID: 3H4DSubkt0q

--HG--
extra : rebase_source : e34e609f0056398f799dc6dbdf769cca89a412df
2017-11-06 17:06:09 +09:00
Makoto Kato 44e777349b Bug 1414581 - Part 1. Require more nullptr check of parent node. r=masayuki
Bug 1402904 added nullptr check for parent node, but I forgot to add this
nullptr check of selected node for outdent command.
So I need to add more nullptr check.

MozReview-Commit-ID: Au9wrG6htk8

--HG--
extra : rebase_source : bd73b1b667b6dc869ebcea3fdfbe1eb3b04a8cde
2017-11-06 17:05:37 +09:00
Margareta Eliza Balazs 130574a8e2 Merge mozilla-central to mozilla-inbound. r=merge a=merge CLOSED TREE 2017-11-08 00:09:29 +02:00
Boris Zbarsky 1d9f0307ac Bug 1413253. Make sure to make it clear that we'd report a JS exception on the ErrorResult in InsertNodeTransaction::DoTransaction. r=peterv
MozReview-Commit-ID: 2DEPzwwXbX9
2017-11-07 15:36:41 -05:00
Masayuki Nakano 365f79c262 Bug 1414713 - EditorUtils::IsDescendantOf() should take EditorDOMPoint and EditorRawDOMPoint as out param r=catalinb,m_kato
EditorUtils::IsDescendantOf() current takes a pointer to offset or a pointer to
child content if the caller needs to know the child of the most ancestor node.

However, some callers should get a child as EditorDOMPoint or EditorRawDOMPoint.
Then, they can be used for some editor methods which need to take child node
for performance optimization.

This patch makes EditorUtils::IsDescendantOf() as only two overloads.  One takes
pointer to EditorRawDOMPoint as optional out argument.  The other takes pointer
to EditorDOMPoint as an out param.

Additionally, this creates new constructor of AutoTrackDOMPoint for making it
can treat EditorDOMPoint directly.

MozReview-Commit-ID: IsAGTUvKI19

--HG--
extra : rebase_source : 97469a21b974c6a1dd515ab472bbc4a88c1899c8
2017-11-06 17:01:33 +09:00
Dão Gottwald e57bb9cb2e Bug 464450 - Get rid of the padded class and clean up related styling. r=mak
MozReview-Commit-ID: KYKqH9vLQ3x

--HG--
extra : rebase_source : 6242214b0c8efd8fde15714d53dd7fd63c082835
2017-11-07 14:15:19 +01:00
Masayuki Nakano 45ce515072 Bug 1408544 - part 2: RangeBoundaryBase shouldn't compute mRef when mOffset is specified r=catalinb
RangeBoundaryBase shouldn't compute mRef when it's initialized with offset.
E.g., some users of the template class may initialize it with a container and
offset in it but it may not refer mRef or may refer after modifying offset.

On the other hand, RangeBoundaryBase::InvalidateOffset() is a special method.
It assumes that mRef is always initialized when it's called but can be
invalidate mOffset until retrieved actually.  This is necessary for
nsRange::mStart and nsRange::mEnd since the offset may be changed when
some nodes are inserted before the referring node.

So, now, InvalidateOffset() should be a protected method and make nsRange a
friend class of RangeBoundaryBase.  Then, when nsRange sets mStart and/or mEnd,
nsRange itself should guarantee that their mRefs are initialized.

MozReview-Commit-ID: Alr4YkDXIND

--HG--
extra : rebase_source : 7e6828374db7989ae91b9e485571ec553f7435af
2017-11-02 21:25:14 +09:00
Masayuki Nakano 8b6c211c36 Bug 1408544 - part 1: Reimplement EditorDOMPoint as a subclass of RangeBoundary r=catalinb,m_kato
A lot of methods in editor returns a child offset with an out param when it
returns its container and offset in the container.  This is ugly hack for
performance of nsINode::IndexOf().  However, there are a lot of regression
since the relation between offset and child node can be broken really easily.

So, we should make EditorDOMPoint as a subclass of RangeBoundary and manage
a set of container, reference child and its offset in it (e.g.,
SetNextSibling() added by this patch).

Note that RangeBoundary's performance is not good for temporary use if we set
a point with offset, it immediately retrieves mRef.  The following patch will
improve this performance.

MozReview-Commit-ID: 7mcJ1P1OjVr

--HG--
rename : editor/libeditor/EditorUtils.h => editor/libeditor/EditorDOMPoint.h
extra : rebase_source : 785094fcfc592d9e5b48cbc36ed225dbb8bb4111
2017-11-01 14:41:03 +09:00
Phil Ringnalda 202bbba5f7 Backed out changeset aa14c955261c (bug 464450) for Win10 debug non-e10s failures in editor reftests
MozReview-Commit-ID: J83gCo2oGUh
2017-11-06 19:55:01 -08:00
Dão Gottwald 7ca44028ae Bug 464450 - Get rid of the padded class and clean up related styling. r=mak
MozReview-Commit-ID: 5uPRgLiSu0Q

--HG--
extra : rebase_source : 4a271f0eb515546586918412c062c3ea853c3844
2017-10-18 14:49:00 +02:00
Xidorn Quan 488a55e50a Bug 1411460 - Sync input.css with style in textbox.css. r=dao
MozReview-Commit-ID: 63Fl0jtMPXc

--HG--
extra : rebase_source : 554537da9f696073f8d38ad064d365c36840e2a5
2017-11-02 11:32:45 +11:00
Sebastian Hengst 4ff29d14f8 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: GSDYk9wLOAM

--HG--
rename : browser/base/content/test/general/browser_bug561636.js => browser/modules/test/browser/formValidation/browser_form_validation.js
rename : browser/base/content/test/general/browser_bug595507.js => browser/modules/test/browser/formValidation/browser_validation_iframe.js
rename : browser/modules/test/browser/browser_bug1319078.js => browser/modules/test/browser/formValidation/browser_validation_invisible.js
2017-11-01 22:55:12 +01:00
Nika Layzell b5701b1266 Bug 1401379 - Part 2: Add more cycle collector edges for nsDocShell, r=smaug
MozReview-Commit-ID: 3j9jfLv7MO2
2017-11-01 11:06:26 -04:00
Masayuki Nakano b327dea259 Bug 1411345 - HTMLEditRules::GetHighestInlineParent() shouldn't return editing host even when it's the highest inline parent of aNode r=m_kato
HTMLEditRules::BustUpInlinesAtRangeEndpoints() tries to split all inline nodes
at range start and range end.  It uses EditorBase::SplitNodeDeep() to split
the nodes and HTMLEditRules::GetHighestInlineParent() to retrieve the highest
inline parent of them.

Currently, HTMLEditRules::GetHighestInlineParent() may return editing host or
ancestor of it if active editing host is not block.  Then, it may cause
splitting editing host or its parents and following methods of HTMLEditRules
will fail to modify the nodes created outside the editing host.

So, HTMLEditRules::GetHighestInlineParent() should return only one of the
descendants of active editing host.

Unfortunately, even if just adding the test case as a crash test, I cannot
reproduce the crash with automated tests.  Therefore, this patch doesn't
include any automated tests.

And this patch changes a crash test, 1402196.html, which expects that an inline
editing host is split by execCommand("insertOrderedList").  However, this patch
fixes this wrong behavior.  Therefore, this patch changes the event target of
event listener from <p> inside the editing host to the editing host itself.

MozReview-Commit-ID: 8i5ci1fcrDd

--HG--
extra : rebase_source : 572a7b22550a38ca71c954f62eefa695addd53c2
2017-10-31 01:14:58 +09:00
Marco Castelluccio f19a57edb0 Bug 1413013 - Remove unused nsITransactionList. r=masayuki
--HG--
extra : rebase_source : de3c858298d63d5658f38fc135ab1f2955dc834a
2017-10-30 20:35:00 +00:00
Chris Peterson 1df202b177 Bug 1412048 - Replace NS_RUNTIMEABORT("...") with MOZ_CRASH("..."). r=froydnj
And remove unreachable code after MOZ_CRASH().

MozReview-Commit-ID: 6ShBtPRKYlF

--HG--
extra : rebase_source : 0fe45a59411bda663828336e2686707b550144ae
extra : source : 8473fd7333d2abe1ea1cc176510c292a5b34df45
2017-10-24 23:30:31 -07:00
Masayuki Nakano f802692190 Bug 1411687 - part 2: Rewrite the check to insert a <br> element in HTMLEditRules::WillInsertBreak() r=m_kato
Currently, HTMLEditRules::WillInsertBreak() checks if the editing host can
contain a <p> element as a child or a descendant.  However, this is not enough.
If an inline element has a block element which can contain a <p> element,
current implementation considers to insert a <br>.  This is possible when
* The editing host is an unknown element including user defined element.
* The editing host is an inline element and its children and/or descendants
  were added by JS.  E.g., <span contenteditable> element can have <div>
  element.

I think that we should consider to insert a <br> element when:
- There is no block ancestors in the editing host.
- The editing host is the only block element and it cannot contain <p> element
  or the default paragraph separator is <br> element.
- The nearest block ancestor isn't a single-line container declared in the
  execCommand spec and there are no block elements which can contain <p>
  element.

Note that Chromium checks if CSS box of ancestors is block too.  However,
it must be out of scope of this bug.

MozReview-Commit-ID: HdjU9t83Nd1

--HG--
extra : rebase_source : 7030671268a610613359b5d8ae5d126e120f59bd
2017-10-27 01:27:44 +09:00
Masayuki Nakano 2b96b7532a Bug 1411687 - part 1: HTMLEditor::GetBlockNodeParent() and HTMLEditor::GetBlock() should take an ancestor limiter node optionally r=m_kato
Perhaps, most callers don't need parent block outside active editing host.
Therefore, callers of these methods should be able to specify the editing
host for making those methods stop looking for a block ancestor.

Then, callers can avoid using EditorUtils::IsDescendantOf() and
nsContentUtils::IsContentDescendantOf().

MozReview-Commit-ID: 7IK4gAVHY5d

--HG--
extra : rebase_source : 31cd55026f0ce005d906499de4ebe5d1c39555e9
2017-10-26 22:54:30 +09:00
Masayuki Nakano bb82521595 Bug 1411687 - part 0: Get rid of HTMLEditor::GetBlockNodeParent(nsIDOMNode*) r=m_kato
Currently, HTMLEditor::GetBlockNodeParent(nsIDOMNode*) is used only by
HTMLEditor::DoInsertHTMLWithContext() and there is a variable of nsINode*.

So, we don't need to keep it anymore.

MozReview-Commit-ID: LEWaiR5BEB9

--HG--
extra : rebase_source : 64ef772f3b7883bd4aae48dec737663e6036553b
2017-10-26 22:37:45 +09:00
Makoto Kato 146232dd0d Bug 748315 - Part 5. Update browserscope test result. r=masayuki
MozReview-Commit-ID: KIC7OcDe2i6

--HG--
extra : rebase_source : 8a7dbd1467b975f4adb5b35ea854d7035900c96a
2017-10-25 16:13:10 +09:00
Makoto Kato 0bb92c4869 Bug 748315 - Part 3. Use SetAttributeOrEquivalent even if HTMLEditor::IsCSSEnabled() is false. r=masayuki
SetAttributeOrEquivalent can remove CSS property that is same behaviour by
part 2.  So we should use it instead of SetAttribute.

MozReview-Commit-ID: InCZQVdbDRm

--HG--
extra : rebase_source : d746b07bcfffc752ad90b9e1504e2f0afc23d457
2017-10-29 23:05:16 +09:00
Makoto Kato 390c0cb048 Bug 748315 - Part 2. SetAttributeOrEquivalent should remove CSS property when HTMLEditor::IsCSSEnabled() is false. r=masayuki
SetAttributeOrEquivalent sets element's attribute when
HTMLEditor::IsCSSEnabled() is false.  It should remove the CSS property that is
same behaviour too.

MozReview-Commit-ID: ChKjlB7wI0Z

--HG--
extra : rebase_source : c31b940394750757b2393a6876534590410d9398
2017-10-25 16:13:09 +09:00
Makoto Kato ec0a31ac6a Bug 748315 - Part 1. Consider text-align property even if HTMLEditor::IsCSSEnabled() is false. r=masayuki
Actually, we don't consider CSS property to get alignment when IsCSSEnabled()
is false. For WebKit and Blink compatibility, we should consider this situation.

MozReview-Commit-ID: 9ORntUmbIbf

--HG--
extra : rebase_source : 21d27f34cf1331bd2fee097c5c445dc16c453d4e
2017-10-25 16:13:02 +09:00
Emilio Cobos Álvarez d454491418 Bug 1410074: Load input.css from a chrome uri, so windows reftests can use system metric media queries. r=bz,xidorn
This requires exposing the reftest chrome package to content, but that should be
OK, and this seems to work...

MozReview-Commit-ID: EWkwqTHW3dg

--HG--
extra : rebase_source : 12cabe4389375ac4c3abd0a9327baf268aab7c1a
2017-10-06 20:16:43 +02:00
Emilio Cobos Álvarez dd634e3981 Bug 1411612: Kill nsINode::eCONTENT. r=bz
MozReview-Commit-ID: ESlOqlwhcHI

--HG--
extra : rebase_source : fe6a02469dca1e50c24ba166e15e39160ab4551b
2017-10-25 17:19:11 +02:00
Xidorn Quan b5008d1736 Bug 1408811 followup 2 - Swap the annotation of empty-1.xul.
MozReview-Commit-ID: 70FJ2D8HrAY
2017-10-25 14:47:11 +11:00
Xidorn Quan 44b3247164 Bug 1408811 followup - Disable empty-1.xul for stylo windows.
MozReview-Commit-ID: Cx6rhArQm2j
2017-10-25 11:01:50 +11:00
Sebastian Hengst 24b7b2eb7c merge mozilla-central to autoland. r=merge a=merge 2017-10-24 23:59:14 +02:00
Xidorn Quan 2797a4fa56 Bug 1408811 - Update test expectation for this bug. r=emilio
on a CLOSED TREE

MozReview-Commit-ID: H4glCWmL2vc
2017-10-24 21:16:52 +02:00
Masayuki Nakano d7d7a3bbb9 Bug 1409520 - part 1: WSRunObject::InsertText() should update aInOutChildAtOffset after it might be modified r=m_kato
WSRunObject::InsertText() may delete given child node at offset with calling
DeleteChars() or CheckLeadingNBSP() before calling HTMLEditor::InsertTextImpl().

Therefore, even though using nsINode::GetChildAt() is slow, it needs to update
aInOutChildAtOffset after calling them.

MozReview-Commit-ID: AbTTfNAjMIK

--HG--
extra : rebase_source : b4282e8dc6e395acc89d7c155bfeae46e7c41e4a
2017-10-23 21:47:56 +09:00
Masayuki Nakano 558978b80b Bug 1409520 - part 0: Add automated test r=m_kato
The bug is a report for hitting MOZ_ASSERT, but we should also check the result
of the call of execCommand.

MozReview-Commit-ID: FydZKAjI2Rl

--HG--
extra : rebase_source : 327988cea366474cbe659a3b80c09ce7ceef0005
2017-10-23 22:01:58 +09:00
Sebastian Hengst 57cc14513b Backed out changeset 3aff5bcb5816 (bug 1402196) for misconfig in editor/libeditor/crashtests/crashtests.list line 91: unknown test type 1402196.html. r=backout
--HG--
extra : amend_source : 436179c20baf507bbcad66a6983c8b1cbba64859
2017-10-24 09:42:17 +02:00
Sebastian Hengst deaafcf713 Backed out changeset 10e5f407149d (bug 1402196) 2017-10-24 09:42:12 +02:00
Makoto Kato 49057375bb Bug 1402196 - Part 2. Add crashtest. r=masayuki
MozReview-Commit-ID: IF6UsY3QR1A

--HG--
extra : rebase_source : b1642b53a11c4b696b52c36264c9f4550131811a
2017-10-23 12:24:04 +09:00
Makoto Kato 719f303c40 Bug 1402196 - Part 1. Don't add null range to aArrayOfRanges. r=masayuki
RangeItem::GetRange can return null, so we shouldn't add null range to
aArrayOfRanges.

MozReview-Commit-ID: Ci5VHeqE8km

--HG--
extra : rebase_source : 83abb5f4ea405c360e63b7ed73530a7321a2a1e5
2017-10-23 12:22:45 +09:00
Makoto Kato 6190312b6f Bug 1402196 - Part 2. Add crashtest. r=masayuki
MozReview-Commit-ID: IF6UsY3QR1A

--HG--
extra : rebase_source : 9369e9888d436881e5d718666d2c560707f92f57
2017-10-23 12:24:04 +09:00
Makoto Kato 9a392d11a1 Bug 1402196 - Part 1. Don't add null range to aArrayOfRanges. r=masayuki
RangeItem::GetRange can return null, so we shouldn't add null range to
aArrayOfRanges.

MozReview-Commit-ID: Ci5VHeqE8km

--HG--
extra : rebase_source : 34f5e98de680ffe588d64244592f775450ce98cf
2017-10-23 12:22:45 +09:00
Masayuki Nakano c94238ae4f Bug 1415231 - Add crash tests for a regression of bug 1406482 which has been fixed by bug 1415509 r=m_kato
This crash test can cause crash before landing the patches for bug 1415509.
So, let's take this for regression test.

MozReview-Commit-ID: 652wi49e720

--HG--
extra : rebase_source : a7a897670220e4f14df91c4093e65aa7da7f6015
2017-11-10 10:58:33 +09:00
Masayuki Nakano 5253a1dd31 Bug 1415800 - part 5: Redesign HTMLEditRules::FindNearSelectableNode() r=m_kato
First, the method name is not correct.  It tries to find an editable node near
the given DOM point.  Therefore, it should be FindNearEditableNode().

Next, the implementation did something odd.  E.g., in the first |if| block,
when |nearNode| is nullptr, it returns nullptr.  However, following |if| block
does something only when |nearNode| is nullptr.  So, we can get rid of the
second |if| block.  Then, nobody will change aDirection.  So, we can make it
not a reference now.

Similarly, in |while| block, if |nearNode| becomes nullptr, it returns error.
However, following block checks if |nearNode| is NOT nullptr.  So, we can get
rid of this |if| statement and outdent its block.

Additionally, |curNode| isn't necessary.  It only increments the refcount
redundantly.  So, we can get rid of it.

Finally, FindNearEditableNode() can return found node directly instead of
error code because error code doesn't make sense.  Not found an editable
node is not illegal.  And also it can take EditorRawDOMPoint instead of
a set of container, child and offset of the child in the container.

MozReview-Commit-ID: CTI581PhJMd

--HG--
extra : rebase_source : 7e05998721ce96727d40dda1be5e7e36b090bcd3
2017-11-10 01:35:10 +09:00
Masayuki Nakano f2b15687ad Bug 1415800 - part 4: Redesign HTMLEditor::GetNextHTMLNode() same as similar to EditorBase::GetNext*() r=m_kato
HTMLEditor::GetNextHTMLNode() should be redesigned as
HTMLEditor::GetNextEditableHTMLNode(nsINode&),
HTMLEditor::GetNextEditableHTMLNodeInBlock(nsINode&),
HTMLEditor::GetNextEditableHTMLNode(const EditorRawDOMPoint&) and
HTMLEditor::GetNextEditableHTMLNodeInBlock(const EditorRawDOMPoint&).

Same as GetPreviousEditableHTMLNode*(), we don't need the methods to find
non-editable nodes too.

MozReview-Commit-ID: JjZauCMblp4

--HG--
extra : rebase_source : 1e650d79bc21d7f920b3f46f4a2f208ac23cc0a6
2017-11-10 00:12:22 +09:00
Masayuki Nakano 44f51bc127 Bug 1415800 - part 3: Redesign HTMLEditor::GetPriorHTMLNode() as similar to EditorBase::GetPrevious*() r=m_kato
HTMLEditor::GetPriorHTMLNode() methods are similar to EditorBase::GetPriorNode()
which was redesigned with the previous patch.

So, it should be redesigned as
HTMLEditor::GetPreviousEditableHTMLNode(nsINode&),
HTMLEditor::GetPreviousEditableHTMLNode(const EditorRawDOMPoint&),
HTMLEditor::GetPreviousEditableHTMLNodeInBlock(nsINode&) and
HTMLEditor::GetPreviousEditableHTMLNodeInBlock(const EditorRawDOMPoint&).

Note that HTMLEditor::GetPriorHTMLNode() are always return editable node.
So, we don't need to create non-editable node methods for them.

Although, I don't like the word "HTMLNode" because this can return SVG element
or something too.  The additional feature of those methods is just checking
given node is in active editing host.  So, they are for HTML editor, but not
returning only HTML nodes.  However, I have no better idea with shorter name.

MozReview-Commit-ID: 3J4IaBOFjzj

--HG--
extra : rebase_source : 712bc8676fcdc37f38fd46083df177c0fe6bd408
2017-11-09 23:31:59 +09:00
Masayuki Nakano 88120b8907 Bug 1415800 - part 2: Redesign EditorBase::GetNextNode() with EditorRawDOMPoint r=m_kato
An overload of EditorBase::GetNextNode() takes a set of container, child node
and offset of the child in the container.  Replacing it with EditorRawDOMPoint
makes the caller simpler.

Additionally, it has two bool arguments, one is for searching if editable node,
the other is for searching if in same block.  So, they can be hidden with
some human readable inline methods.

When I was creating this patch, I realized that
GetNextNodeInternal(const EditorRawDOMPoint& aPoint) may return
aPoint.GetChildAtOffset().  I.e., it starts to search from the specified point
rather than next node.  On the other hand, GetNextNodeInternal(nsINode& aNode)
never returns aNode itself.  So, it there is better name instead of "Next",
we should take it.  But I have no better idea.  So, this patch just explains
the difference with comments in EditorBase.h.

MozReview-Commit-ID: 4Lb6o9SJuhy

--HG--
extra : rebase_source : d20d728eae69659ef448b6679ae8f73d64c2d7e9
2017-11-09 17:57:00 +09:00
Masayuki Nakano e28ddd6ec3 Bug 1415800 - part 1: Redesign EditorBase::GetPriorNode() with EditorRawDOMPoint r=m_kato
An overload of EditorBase::GetPriorNode() takes a set of container, child node
and offset of the child in the container.  Replacing it with EditorRawDOMPoint
makes the caller simpler.

Additionally, it has two bool arguments, one is for searching if editable node,
the other is for searching if in same block.  So, they can be hidden with
some human readable inline methods.

Finally, "Prior" isn't a term of DOM.  So, let's use "Previous" instead.

MozReview-Commit-ID: A9uKzHaikY9

--HG--
extra : rebase_source : 15bfdfde0ad89a5331d6c8a24351741eeef476d5
2017-11-09 17:08:10 +09:00
Masayuki Nakano 456157300a Bug 1415509 - part 3: WSRunObject::InsertText() should take |const EditorRawDOMPoint&| as input argument and |EditorRawDOMPoint*| as out argument instead of a set of container, child and offset of the child in the container as in/out argument r=m_kato
Like EditorBase::InsertTextImpl(), WSRunObject::InsertText() is really messy.
So, it should take same arguments as EditorBase::InsertTextImpl().

MozReview-Commit-ID: 5uKGaxKheRv

--HG--
extra : rebase_source : 49ce0eb7ea25b397b6b1a19f1bc21d711740c043
2017-11-09 13:24:06 +09:00
Masayuki Nakano a3fa902a2d Bug 1415509 - part 2: EditorBase::InsertTextImpl() should take |const EditorRawDOMPoint&| argument as input and |EditorRawDOMPoint*| as out argument instead of a set of container, child and offset of the child in the container as in/out argument r=m_kato
EditorBase::InsertTextImpl() takes |nsCOMPtr<nsINode>*|, |nsCOMPtr<nsIContent>*|
and |int32_t| as in/out arguments for container, child and offset of the child
in the container.  But this makes the callers really hard to read and ugly.

So, we should make the method take |const EditorRawDOMPoint&| argument as input
and |EditorRawDOMPoint*| as out argument.

MozReview-Commit-ID: 2ijIfGl4Zo7

--HG--
extra : rebase_source : b309d9bdc04aac620f138769ba18ad7e4597fe6c
2017-11-09 01:00:36 +09:00
Masayuki Nakano 7adce402c2 Bug 1415509 - part 1: EditorBase::FindBetterInsertionPoint() should take an EditorRawDOMPoint argument for input and return EditorRawDOMPoint for the result r=m_kato
EditorBase::FindBetterInsertionPoint() now use 3 in/out arguments.  This is
really ugly and making the callers hard to read.  So, let's make it take an
argument whose type is |const EditorRawDOMPoint&| and return other
EditorRawDOMPoint instance.

Additionally, this fixes bugs of text node length checks in the method.
Basically, this shouldn't affect to any actual behavior, though.  That is
because text node shouldn't be able to have string longer than INT32_MAX.

MozReview-Commit-ID: FClUQSJzd8c

--HG--
extra : rebase_source : 3e2fbd345015f7068c7e35a94c31731e7936009f
2017-11-08 21:55:10 +09:00
Masatoshi Kimura dbd92543c6 Bug 1313150 - Remove |weak| parameter from nsIMutableArray methods. r=froydnj
MozReview-Commit-ID: 7JoD4VYzZp3

--HG--
extra : rebase_source : 5db437f1c34608aa223916874d62b48c59baeae8
2017-10-21 23:53:02 +09:00
Makoto Kato 4324707ac3 Bug 1394649 - Use nsGkAtoms on nsTextServiceDocument. r=masayuki
It is no reason to use custom atom instead of nsGkAtoms now, so we should
use nsGkAtoms instead.

MozReview-Commit-ID: 9slsZtLDNKH

--HG--
extra : histedit_source : 8ad70ff1adfa145bc0e8da3c6f43f3dba9b558f1
2017-10-23 13:09:49 +09:00
Nicholas Nethercote 21e7dce1a2 Bug 1410294 (part 3) - Overhaul static atom macros. r=froydnj.
There are four things that must be provided for every static atom, two of which
have a macro:
- the atom pointer declaration (no macro);
- the atom pointer definition (no macro);
- the atom char buffer (NS_STATIC_ATOM_BUFFER);
- the StaticAtomSetup struct (NS_STATIC_ATOM_SETUP).

This patch introduces new macros for the first two things: NS_STATIC_ATOM_DECL
and NS_STATIC_ATOM_DEFN, and changes the arguments of the existing two macros
to make them easier to use (e.g. all the '##' concatenation now happens within
the macros).

One consequence of the change is that all static atoms must be within a class,
so the patch adds a couple of classes where necessary (DefaultAtoms, TSAtoms).

The patch also adds a big comment explaining how the macros are used, and what
their expansion looks like. This makes it a lot easier to understand how static
atoms work. Correspondingly, the patch removes some small comments scattered
around the macro use points.

MozReview-Commit-ID: wpRyrEOTHE

--HG--
extra : rebase_source : 9f85d477b4d06c9a9e710c757de1f1476edb6efe
2017-10-22 08:50:25 +11:00
Nicholas Nethercote ed06034e3c Bug 1410294 (part 2) - Use a macro to declare the atoms in nsTextServicesDocument. r=froydnj.
MozReview-Commit-ID: LZjDrROmPC7

--HG--
extra : rebase_source : 8da8ecc8a0a24c212d1528bf8d23fbbf0942f757
2017-10-20 14:04:52 +11:00
Nicholas Nethercote 074a872086 Bug 1410294 (part 1) - Rename nsStaticAtom as nsStaticAtomSetup. r=froydnj.
Because it's the type we use to set up static atoms at startup, not the static
atom itself.

The patch accordingly renames some parameters, variables, and NS_STATIC_ATOM,
for consistency.

MozReview-Commit-ID: 1a0KvhYNNw2

--HG--
extra : rebase_source : 5c66e5b2dfe053a368bf3584d957198aec4cce91
2017-10-20 14:04:47 +11:00
Jason Kratzer 735da145f2 Bug 1344097 - Add crashtest. r=me
--HG--
extra : rebase_source : 9789bb530c86279907b5abbd8fd1c8e1929e5af1
2017-10-20 08:36:12 -04:00
Masayuki Nakano eb5a65e869 Bug 1407966 - part 2: EditorBase::InsertTextImpl() shouldn't assume that aInOutChildAtOffset is never nullptr r=m_kato
Since if the container is not a container node like a text node or the offset
is same as the length, child at the offset can be nullptr.

MozReview-Commit-ID: DCnFwUjNgk7

--HG--
extra : rebase_source : 48823390645d79db391dcaf64dab59e754b680a5
2017-10-17 01:59:28 +09:00
Masayuki Nakano 33a8e2ee5e Bug 1407966 - part 1: Update |selChild| when HTMLEditRules::WillInsertText() updates |curNode| and |curOffset| r=m_kato
|selChild| should be a node which is at |curOffset| in |curNode|, however,
it's not updated when |curOffset| is updated by a call of CreateBRImpl().  So,
it should be next sibling of the created br node.

MozReview-Commit-ID: IVfTjVMp3lB

--HG--
extra : rebase_source : fbc355e3c0425a495c78c3c028308dac26617283
2017-10-17 01:17:07 +09:00
Boris Zbarsky 661d20b507 Bug 1409162. Make nsTableCellFrame::GetColIndex/GetRowIndex faster. r=mats 2017-10-17 15:39:36 -04:00
Sebastian Hengst 32f7c8fec3 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 1h3kZyrtqSt
2017-10-17 11:45:16 +02:00
Kris Maglione 4a767c7e6e Bug 1404198: Part 2j - Switch to NS_NewTimer* everywhere else. r=njn
MozReview-Commit-ID: LmGIgfmNSmk

--HG--
extra : rebase_source : bf34e852beb0c8f6eafd09184c2e0cda95f95f83
2017-09-24 19:57:48 -07:00
Makoto Kato 52ae993a2a Bug 1407924 - Avoid conversion from nsAtom to string if possible. r=masayuki
Editor sometimes extracts atom to string to compare element name.
It is unnecessary to use atom directly.

MozReview-Commit-ID: FEvyiIeaozs

--HG--
extra : rebase_source : 4418d0c82fa4fedd814b914f2cf3a86d74ad9835
2017-10-12 16:28:28 +09:00
Sebastian Hengst caf5b99a30 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 8Qk2qoQvP0g
2017-10-14 11:49:31 +02:00
Kyle Machulis 1cc8b01353 Bug 1406224 - Remove nsIDOMHTMLImageElement; r=bz
MozReview-Commit-ID: GCATWRt6qMo

--HG--
extra : rebase_source : 29854f1374c6ad318da0b5b68be23507667c3be4
2017-10-06 13:27:23 -07:00
Sebastian Hengst 8975678533 Backed out changeset febed94fa592 (bug 1408227) for asserting at editor/libeditor/EditorBase.cpp:2513 during execution of web-platform-test /editing/run/inserttext.html. r=backout on a CLOSED TREE 2017-10-13 19:48:22 +02:00
Ryan VanderMeulen a74ce78a81 Bug 1407866 - Update test_bug1385905.html to work whether editor.use_div_for_default_newlines is set or not. r=masayuki 2017-10-13 12:48:06 -04:00
Ehsan Akhgari 5e34d765c7 Bug 1408227 - Correctly update the child at offset pointer across calls to WSRunObject::InsertBreak(); r=masayuki 2017-10-13 10:42:27 -04:00
Ehsan Akhgari b62ea76a52 Bug 1408290 - Avoid calling nsINode::IndexOf() in HTMLEditRules::CheckForInvisibleBR(); r=masayuki 2017-10-13 10:28:50 -04:00
Ehsan Akhgari 62a148cc7c Bug 1408286 - Avoid calling nsINode::IndexOf() for block parents whose grant parents are lists in HTMLEditRules::CheckForEmptyBlock(); r=masayuki 2017-10-13 10:25:21 -04:00
Ehsan Akhgari 8dc357ab3c Bug 1408285 - Avoid calling nsINode::IndexOf() for list items in HTMLEditRules::CheckForEmptyBlock(); r=masayuki 2017-10-13 10:23:20 -04:00
Ehsan Akhgari 1349bede70 Bug 1408170 - Set child correctly in HTMLEditRules::GetPromotedPoint(); r=masayuki 2017-10-13 02:23:12 -04:00
Jesse Schwartzentruber beb397098f Bug 1274050 - Add crashtest. r=me 2017-10-12 22:41:14 -04:00
Sebastian Hengst c2f23c4622 merge mozilla-central to mozilla-inbound. r=merge a=merge
--HG--
rename : browser/base/content/test/general/browser_bug585558.js => browser/base/content/test/tabs/browser_positional_attributes.js
rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_jsterm_dollar.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_dollar.js
rename : devtools/client/webconsole/new-console-output/test/mochitest/test-bug-621644-jsterm-dollar.html => devtools/client/webconsole/new-console-output/test/mochitest/test-jsterm-dollar.html
rename : dom/media/doctor/DDLogClass.cpp => dom/media/doctor/DDLogCategory.cpp
rename : dom/media/doctor/DDLogClass.h => dom/media/doctor/DDLogCategory.h
rename : mobile/android/app/src/main/res/drawable-hdpi/find_prev.png => mobile/android/app/src/photon/res/drawable-hdpi/find_prev.png
rename : mobile/android/app/src/main/res/drawable-hdpi/url_bar_entry_default.9.png => mobile/android/app/src/photon/res/drawable-hdpi/url_bar_entry_default.9.png
rename : mobile/android/app/src/main/res/drawable-hdpi/url_bar_entry_default_pb.9.png => mobile/android/app/src/photon/res/drawable-hdpi/url_bar_entry_default_pb.9.png
rename : mobile/android/app/src/main/res/drawable-hdpi/url_bar_entry_pressed.9.png => mobile/android/app/src/photon/res/drawable-hdpi/url_bar_entry_pressed.9.png
rename : mobile/android/app/src/main/res/drawable-hdpi/url_bar_entry_pressed_pb.9.png => mobile/android/app/src/photon/res/drawable-hdpi/url_bar_entry_pressed_pb.9.png
rename : mobile/android/app/src/main/res/drawable-large-hdpi-v11/url_bar_entry_default.9.png => mobile/android/app/src/photon/res/drawable-large-hdpi-v11/url_bar_entry_default.9.png
rename : mobile/android/app/src/main/res/drawable-large-hdpi-v11/url_bar_entry_default_pb.9.png => mobile/android/app/src/photon/res/drawable-large-hdpi-v11/url_bar_entry_default_pb.9.png
rename : mobile/android/app/src/main/res/drawable-large-hdpi-v11/url_bar_entry_pressed.9.png => mobile/android/app/src/photon/res/drawable-large-hdpi-v11/url_bar_entry_pressed.9.png
rename : mobile/android/app/src/main/res/drawable-large-hdpi-v11/url_bar_entry_pressed_pb.9.png => mobile/android/app/src/photon/res/drawable-large-hdpi-v11/url_bar_entry_pressed_pb.9.png
rename : mobile/android/app/src/main/res/drawable-large-xhdpi-v11/url_bar_entry_default.9.png => mobile/android/app/src/photon/res/drawable-large-xhdpi-v11/url_bar_entry_default.9.png
rename : mobile/android/app/src/main/res/drawable-large-xhdpi-v11/url_bar_entry_default_pb.9.png => mobile/android/app/src/photon/res/drawable-large-xhdpi-v11/url_bar_entry_default_pb.9.png
rename : mobile/android/app/src/main/res/drawable-large-xhdpi-v11/url_bar_entry_pressed.9.png => mobile/android/app/src/photon/res/drawable-large-xhdpi-v11/url_bar_entry_pressed.9.png
rename : mobile/android/app/src/main/res/drawable-large-xhdpi-v11/url_bar_entry_pressed_pb.9.png => mobile/android/app/src/photon/res/drawable-large-xhdpi-v11/url_bar_entry_pressed_pb.9.png
rename : mobile/android/app/src/main/res/drawable-large-xxhdpi-v11/url_bar_entry_default.9.png => mobile/android/app/src/photon/res/drawable-large-xxhdpi-v11/url_bar_entry_default.9.png
rename : mobile/android/app/src/main/res/drawable-large-xxhdpi-v11/url_bar_entry_default_pb.9.png => mobile/android/app/src/photon/res/drawable-large-xxhdpi-v11/url_bar_entry_default_pb.9.png
rename : mobile/android/app/src/main/res/drawable-large-xxhdpi-v11/url_bar_entry_pressed.9.png => mobile/android/app/src/photon/res/drawable-large-xxhdpi-v11/url_bar_entry_pressed.9.png
rename : mobile/android/app/src/main/res/drawable-large-xxhdpi-v11/url_bar_entry_pressed_pb.9.png => mobile/android/app/src/photon/res/drawable-large-xxhdpi-v11/url_bar_entry_pressed_pb.9.png
rename : mobile/android/app/src/main/res/drawable-xhdpi/find_prev.png => mobile/android/app/src/photon/res/drawable-xhdpi/find_prev.png
rename : mobile/android/app/src/main/res/drawable-xhdpi/url_bar_entry_default.9.png => mobile/android/app/src/photon/res/drawable-xhdpi/url_bar_entry_default.9.png
rename : mobile/android/app/src/main/res/drawable-xhdpi/url_bar_entry_default_pb.9.png => mobile/android/app/src/photon/res/drawable-xhdpi/url_bar_entry_default_pb.9.png
rename : mobile/android/app/src/main/res/drawable-xhdpi/url_bar_entry_pressed.9.png => mobile/android/app/src/photon/res/drawable-xhdpi/url_bar_entry_pressed.9.png
rename : mobile/android/app/src/main/res/drawable-xhdpi/url_bar_entry_pressed_pb.9.png => mobile/android/app/src/photon/res/drawable-xhdpi/url_bar_entry_pressed_pb.9.png
rename : mobile/android/app/src/main/res/drawable-xxhdpi/url_bar_entry_default.9.png => mobile/android/app/src/photon/res/drawable-xxhdpi/url_bar_entry_default.9.png
rename : mobile/android/app/src/main/res/drawable-xxhdpi/url_bar_entry_default_pb.9.png => mobile/android/app/src/photon/res/drawable-xxhdpi/url_bar_entry_default_pb.9.png
rename : mobile/android/app/src/main/res/drawable-xxhdpi/url_bar_entry_pressed.9.png => mobile/android/app/src/photon/res/drawable-xxhdpi/url_bar_entry_pressed.9.png
rename : mobile/android/app/src/main/res/drawable-xxhdpi/url_bar_entry_pressed_pb.9.png => mobile/android/app/src/photon/res/drawable-xxhdpi/url_bar_entry_pressed_pb.9.png
extra : rebase_source : 0cff6fa99d9ea3c6ce0bfb1604d4e9533f63ce63
2017-10-13 00:55:27 +02:00
Sebastian Hengst 5c00b8540d merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: AlcL6XYDkf
2017-10-12 23:58:31 +02:00
Sebastian Hengst f7efb5fc2c Merge mozilla-central to mozilla-inbound. r=merge a=merge on a CLOSED TREE 2017-10-12 12:03:15 +02:00
Ehsan Akhgari 0e0b35e1aa Bug 1407854 - Part 3: Pass the child node at the offset as an extra argument where possible to CreateNode(); r=masayuki
This patch converts almost all of the call sites over to passing
the extra argument explicitly.
2017-10-12 17:13:56 -04:00
Ehsan Akhgari bf1f474a3d Bug 1407854 - Part 2: Add an optional argument to CreateNode() to allow callers to pass the child node when they know it; r=masayuki 2017-10-12 17:13:55 -04:00
Ehsan Akhgari e9a78d5b18 Bug 1407854 - Part 1: Remove nsIEditor.createNode(); r=masayuki 2017-10-12 17:13:55 -04:00
Makoto Kato 4afdbeeecb Bug 1364133 - Part 2. Add test. r=masayuki
MozReview-Commit-ID: 5v1LXlWIRPB

--HG--
extra : rebase_source : b201da76921c032cdf18093d385e7fa48c6bdb4c
2017-10-11 17:59:02 +09:00
Makoto Kato 1e88ad2842 Bug 1364133 - Part 1. Check whether SplitNode returns error. r=masayuki
When SplitNode returns nullptr, GetAsText causes crash.  So we should check
error before casting by GetAsText.

MozReview-Commit-ID: 8E1OPSRZ2x5

--HG--
extra : rebase_source : 48a067bd080e7a68e9d469c07d3b744508dae91f
2017-10-11 17:58:24 +09:00
Ryan VanderMeulen 6090989771 Bug 1393171 - Add crashtest. r=me
--HG--
extra : rebase_source : 76957b4f171ebf0de582eeffc73330b71425f363
2017-10-11 19:54:10 -04:00
Ryan VanderMeulen fee107246e Bug 1383763 - Add crashtest. r=me
--HG--
extra : rebase_source : 64f0ebc53170c3b8871f77365829bbdbc5c094eb
2017-10-11 19:54:09 -04:00
Ryan VanderMeulen 2517ed2733 Bug 1384161 - Add crashtest. r=me
--HG--
extra : rebase_source : 2916754a521a451766b1b154c8f80e91dca8ab88
2017-10-11 19:54:09 -04:00
Ryan VanderMeulen fa5fde2e25 Bug 1383747 - Add crashtest. r=me
--HG--
extra : rebase_source : 82d9e01850c972d5228accacd90cf38e407136c8
2017-10-11 19:54:08 -04:00
Emilio Cobos Álvarez 29b6fbc81f Bug 1405311: Remove uses of :-moz-system-metric. r=xidorn,dao
MozReview-Commit-ID: 1Yqy6KgMUB1
2017-10-12 14:47:06 +02:00
Sebastian Hengst 89ddab8643 Backed out changeset d59889304b3f (bug 1408125) for asserting in clipboard test editor/libeditor/tests/test_bug1306532.html. r=backout on a CLOSED TREE
--HG--
extra : amend_source : 2ec45a81dd0ad22bbaf9df23de6b323b235714b3
2017-10-14 00:05:15 +02:00
Sebastian Hengst 5e217241d6 Backed out changeset 19fee71d7e27 (bug 1408125) 2017-10-14 00:05:10 +02:00
Ehsan Akhgari 1d4fb2453d Bug 1408125 - Part 2: Pass the child node at the offset as an extra argument where possible to InsertNode(); r=masayuki
This patch converts almost all of the call sites over to passing
the extra argument explicitly.
2017-10-13 16:23:24 -04:00
Ehsan Akhgari ffd4e9aa37 Bug 1408125 - Part 1: Add an optional argument to InsertNode() to allow callers to pass the child node when they know it; r=masayuki 2017-10-13 16:23:19 -04:00
Ehsan Akhgari 6aadc3345b Bug 1407309 - Part 2: Remove some dead code; r=masayuki 2017-10-13 16:06:08 -04:00
Ehsan Akhgari efeb8d0cb6 Bug 1407309 - Part 1: Rewrite HTMLEditor::CopyLastEditableChildStyles() to use internal DOM APIs; r=masayuki 2017-10-13 16:06:08 -04:00
Ehsan Akhgari 1bba75e15f Bug 1406482 - Avoid using nsINode::GetChildAt() in EditorBase::InsertTextImpl(); r=masayuki 2017-10-11 13:12:00 -04:00
Ryan VanderMeulen 9344c09f7c Bug 1388075 - Add crashtest. r=me
--HG--
extra : rebase_source : 70738bf0b3995786e9a472b268d2a0e9745c4160
2017-10-11 11:52:40 -04:00
Ehsan Akhgari 6a2135a0bb Bug 1407305 - Part 4: Avoid using GetChildAt() in EditorBase::GetNextNode(); r=masayuki 2017-10-11 11:27:57 -04:00
Ehsan Akhgari 40afcd0316 Bug 1407305 - Part 3: Avoid using GetChildAt() in EditorBase::GetPriorNode(); r=masayuki 2017-10-11 11:27:55 -04:00
Ehsan Akhgari 85ece51460 Bug 1407305 - Part 2: Add a aChildAtOffset argument to HTMLEditor::GetNextHTMLNode(); r=masayuki 2017-10-11 11:27:53 -04:00
Ehsan Akhgari 58fedc900c Bug 1407305 - Part 1: Add a aChildAtOffset argument to HTMLEditor::GetPriorHTMLNode(); r=masayuki 2017-10-11 11:27:51 -04:00
Ehsan Akhgari 08f095eab1 Bug 1407353 - Remove one of the nsINode::GetChildAt() calls in EditorBase::JoinNodeDeep(); r=masayuki 2017-10-11 02:00:36 -04:00
Ehsan Akhgari 959b55b795 Bug 1407352 - Avoid calling GetChildAt() in DeleteRangeTransaction::CreateTxnsToDeleteBetween(); r=masayuki 2017-10-11 01:49:55 -04:00
Ehsan Akhgari e72bd8ae0d Bug 1406577 - Part 2: Remove some dead code; r=masayuki 2017-10-10 11:21:59 -04:00
Ehsan Akhgari f0705cd727 Bug 1406577 - Part 1: Rewrite HTMLEditRules::FindNearSelectableNode() to use internal DOM APIs; r=masayuki 2017-10-10 11:21:57 -04:00
Ehsan Akhgari 16c54559ca Bug 1408049 - Remove an unneeded call to nsINode::IndexOf() from EditorBase::BeginningOfDocument(); r=masayuki 2017-10-12 14:27:22 -04:00
Ehsan Akhgari 92a2acc32a Bug 1407447 - Part 2: Remove some dead code; r=masayuki 2017-10-12 10:49:14 -04:00
Ehsan Akhgari 91afad1234 Bug 1407447 - Part 1: Remove the call to nsINode::GetChildAt() from HTMLEditor::DoInsertHTMLWithContext(); r=masayuki 2017-10-12 10:49:14 -04:00
Makoto Kato 59c8e03ca6 Bug 1402904 - Part 2. Add crash tests. r=masayuki
1405747.html is kind of same issue.  But when editing 1405747.html, the crash doesn't occur.  So I keep original HTML by jsfuzzy.

MozReview-Commit-ID: 9BcUkWeBlr5

--HG--
extra : rebase_source : 1bac60293d3b4997a380cf625c6492db22f60160
extra : histedit_source : eae38e2d69e0705545acf1ef1f2d04e7977b8899
2017-10-05 14:23:12 +09:00
Makoto Kato 129db593cd Bug 1402904 - Part 1. Some operations should check whether parent node of each selected node is null. r=masayuki
GetNodesForOperation returns node array from current selection.  So some nodes in this array might have no parent node.  We should ignore such as orphans.

MozReview-Commit-ID: 3OK0CUv5QOe

--HG--
extra : rebase_source : 59636177113ad5d3f9789ca22a6a96938e4cf486
extra : histedit_source : fd4fd140a24a8dc5a63fceeb25faba827c317683%2C6ed479239be0a9043d05170231c6613b04cb0d26
2017-10-10 13:41:28 +09:00
Phil Ringnalda 63a7c915ff Backed out changeset 8cce0046e302 (bug 1406482) for mozilla::EditorBase::InsertTextImpl crashes
MozReview-Commit-ID: G9jW217fO0v
2017-10-09 21:33:53 -07:00
Phil Ringnalda 5fee8a40bb Backed out changeset 9843839bf1df (bug 1406482) for mozilla::EditorBase::InsertTextImpl crashes
MozReview-Commit-ID: J7rX4lX2lxM
2017-10-09 21:32:12 -07:00
Kyle Machulis 669ff05b49 Bug 1406525 - Remove nsIDOMHTMLLinkElement; r=bz
MozReview-Commit-ID: 4xUSQ8SiIqX
2017-10-09 16:09:38 -07:00
Ehsan Akhgari 20668d566c Bug 1406482 - Address review comment 2017-10-09 18:24:06 -04:00
Ehsan Akhgari 8fff7a3eb8 Bug 1406482 - Avoid using nsINode::GetChildAt() in EditorBase::InsertTextImpl(); r=masayuki 2017-10-09 18:21:22 -04:00
Nicholas Nethercote d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Sebastian Hengst b834f0d177 merge autoland to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 7Ez95T2ivfR
2017-10-07 10:37:39 +02:00
Ehsan Akhgari e3ed6f0810 Bug 1406215 - Part 2: Remove the usage of nsINode::GetChildAt() from nsTextServicesDocument::GetCollapsedSelection(); r=masayuki 2017-10-06 11:45:40 -04:00
Ehsan Akhgari 6f1701de55 Bug 1406215 - Part 1: Remove a useless bounds check for a selection range offset; r=masayuki
This offset is obtained from a Range, so it doesn't need to be
validated.
2017-10-06 11:45:40 -04:00
Ehsan Akhgari 3674cbeaa1 Bug 1405794 - Avoid using nsINode::GetChildAt() in TextEditor::SelectEntireDocument(); r=masayuki 2017-10-06 11:12:04 -04:00
Phil Ringnalda 6ea2792d77 Backed out 9 changesets (bug 1396066) for Windows reftest failures
CLOSED TREE

Backed out changeset e41f9295ee00 (bug 1396066)
Backed out changeset 7a22efa8df6b (bug 1396066)
Backed out changeset ed95eea7105c (bug 1396066)
Backed out changeset 635746c88630 (bug 1396066)
Backed out changeset 5b1997aeaead (bug 1396066)
Backed out changeset 19c9ea492f5e (bug 1396066)
Backed out changeset b9d8e4588584 (bug 1396066)
Backed out changeset 87b44ea10407 (bug 1396066)
Backed out changeset e5b9aed44133 (bug 1396066)

MozReview-Commit-ID: K9q3MfPBc5E
2017-10-06 20:48:23 -07:00
Emilio Cobos Álvarez 28bfd5dbba Bug 1396066 another followup. Load input.css from a chrome uri, so it can use :-moz-system-metric. This requires exposing the reftest chrome package to content, but that should be OK. r=bzbarsky
The CLOSED TREE odyssey must end.

MozReview-Commit-ID: EWkwqTHW3dg
2017-10-06 20:16:43 +02:00
Kyle Machulis 2090426dc0 Bug 1405792 - Remove nsIDOMHTMLIFrameElement r=bz
MozReview-Commit-ID: 1u9C66X8j59

--HG--
extra : rebase_source : 5d87fe933170e32fbb44e24ec843623e143164d2
2017-10-04 20:41:24 -07:00
Kyle Machulis e54a4653ba Bug 1404079 - Remove nsIDOMHTMLFrameElement; r=bz
MozReview-Commit-ID: GSvMwRpl7g4

--HG--
extra : rebase_source : a5e8ee45bae90eaa9ecdcc6f0bac0c9dac0ce2c8
2017-09-28 19:06:14 -07:00
Wes Kocher d8985b6e57 Merge inbound to central, a=merge
MozReview-Commit-ID: IUFdbLdYFhX
2017-10-04 16:37:59 -07:00
Ehsan Akhgari f149573106 Bug 1405419 - Part 2: Remove a dead overload of HTMLEditor::GetPriorHTMLSibling(); r=masayuki 2017-10-04 13:39:48 -04:00
Ehsan Akhgari 73a4c4fd54 Bug 1405419 - Part 1: Remove the HTMLEditor::GetPriorHTMLSibling() overload accepting a parent and an offset; r=masayuki 2017-10-04 13:39:48 -04:00
Ehsan Akhgari d7d7a890e5 Bug 1405414 - Avoid using nsINode::GetChildAt() in HTMLEditor::SetCSSBackgroundColor(); r=masayuki 2017-10-04 13:34:06 -04:00
Masayuki Nakano b1236d3f9d Bug 1390562 - part 1: HTML editor shouldn't split <div> container at inserting a line break for backward compatibility if defaultParagraphSeparator is "br" r=m_kato
Starting from bug 1297414, HTMLEditor treats <div> container as same as <p>
container at inserting a line break.  This new behavior is check in WPT.
So, it's better to use the new behavior for compatibility with other browsers.

However, we're still using <br> as default paragraph separator for backward
compatibility even though this is non-standard behavior.

So, although, the old behavior is odd, we should keep treating them differently
in the backward compatibility mode.  Actually, this behavior change causes
an incompatibility problem in Gmail, and may be in other web apps.

MozReview-Commit-ID: INCihKYmcPd

--HG--
extra : rebase_source : 874e41ddf7bbedbea2c7af79285ea79fbc48f0f2
2017-10-03 19:36:39 +09:00
Masayuki Nakano 62ca7eb7cd Bug 1390562 - part 0: Add automated tests r=m_kato
MozReview-Commit-ID: 7cgxdWClOBQ

--HG--
extra : rebase_source : a7a1028635c1ee27242a1eab97043139eb3f80c1
2017-10-03 18:33:40 +09:00
Ehsan Akhgari 24927971c8 Bug 1404581 - Fallback to the slow path if we're in Thunderbird's plaintext editor; r=masayuki 2017-10-03 11:07:59 -04:00
Catalin Badea f8162c4bfd Bug 651120 - Remove index argument from content removed/appended/inserted notifications. r=peterv 2017-10-03 11:09:08 +01:00
Ehsan Akhgari 850a7084d5 Bug 1405751 - Part 2: Remove a dead overload of HTMLEditor::GetNextHTMLSibling(); r=masayuki 2017-10-05 15:17:28 -04:00
Ehsan Akhgari 879f3317d1 Bug 1405751 - Part 1: Remove the HTMLEditor::GetNextHTMLSibling() overload accepting a parent and an offset; r=masayuki 2017-10-05 15:17:27 -04:00
Ehsan Akhgari a3b87e2b92 Bug 1405039 - Avoid using nsINode::GetChildAt() in HTMLEditor::GetSelectedElement(); r=masayuki 2017-10-02 14:22:57 -04:00
Ehsan Akhgari 4f6e533800 Bug 1405027 - Avoid using nsINode::GetChildAt() in HTMLEditor::GetElementOrParentByTagName(); r=masayuki 2017-10-02 14:01:25 -04:00
Sebastian Hengst 4d183e475c Backed out changeset 9b5b03b2114d (bug 1401379) 2017-10-02 19:57:33 +02:00
Nika Layzell 484b697044 Bug 1401379 - Part 2: Add more cycle collector edges for nsDocShell, r=smaug
MozReview-Commit-ID: 3j9jfLv7MO2
2017-10-02 11:58:01 -04:00
Nika Layzell cbc8fa8a3b Bug 1399626 - Part 4: Allow initializing nsIContentIterator with RangeBoundaries, r=masayuki
This patch adds an overload to nsIContentIterator::Init which accepts
RangeBoundary objects, and modifies the codepath to avoid using the offset of
the start or end nodes to construct the nsIContentIterator.

MozReview-Commit-ID: 5ZqKeiUunoN
2017-10-02 11:58:00 -04:00
Olli Pettay 657d54de19 Bug 1402941 - Add HTMLSlotElement (disabled for now), r=hsivonen
--HG--
extra : rebase_source : ced3d844425bee6fddd22641646a7366ffd5d69e
2017-10-02 13:22:12 +03:00
Ehsan Akhgari 46338d5db2 Bug 1404106 - Avoid using nsINode::GetChildAt() in HTMLEditor::GetSelectedElement(); r=masayuki 2017-09-29 12:50:52 -04:00
Ehsan Akhgari 4b26a85879 Bug 1404084 - Avoid using nsINode::GetChildAt() in HTMLEditor::GetCSSBackgroundColorState(); r=masayuki 2017-09-29 12:40:03 -04:00
Ehsan Akhgari 17d3fe6833 Bug 1393140 - Rewrite EditorBase::FindBetterInsertionPoint() to not use nsINode::GetChildAt() in the fast path used in Firefox; r=masayuki 2017-09-29 12:16:53 -04:00
Makoto Kato 6d4428a710 Bug 1403841 - IsSelectionEditable should check whether focus node and anchor node aren't null. r=masayuki
This might be regression by bug 1319340, but there is crash signature from old version.  We should check whether focus node and anchor node aren't null.

MozReview-Commit-ID: J7npxN5kC9G

--HG--
extra : rebase_source : e2f19690d529abc1a8e2852a5ed826b0caa39244
2017-09-29 13:12:35 +09:00
Kartikaya Gupta 6039f99c16 Bug 1403559 - Remove unnecessary asserts-if clause because we only run webrender reftests with e10s. r=jrmuizel
MozReview-Commit-ID: ChEtYwbsFq5

--HG--
extra : rebase_source : 86dbb6fdb7d61d2dd612e7b27e1b1b696dc7772f
2017-09-27 10:12:09 -04:00
Sebastian Hengst 92393ec0c5 Backed out changeset db9c439a8298 (bug 1403559) for failing reftest layout/reftests/reftest-sanity/reftest-no-paint.html. r=backout 2017-09-27 20:20:00 +02:00
Kartikaya Gupta 1bb174e043 Bug 1403559 - Remove unnecessary asserts-if clause because we only run webrender reftests with e10s. r=jrmuizel
MozReview-Commit-ID: ChEtYwbsFq5

--HG--
extra : rebase_source : e587f16f68b760633dea9541958d5409cf9eb3b6
2017-09-27 10:12:09 -04:00
Sebastian Hengst 72d1ea4a4b merge mozilla-central to autoland. r=merge a=merge 2017-09-27 11:49:57 +02:00
Wes Kocher acf8913934 Merge m-c to inbound, a=merge
MozReview-Commit-ID: IsbKCdZU2Ui
2017-09-26 17:14:31 -07:00
Makoto Kato 24d3058066 Bug 1402469 - Part 2. Add crash test. r=masayuki
MozReview-Commit-ID: HogVH2OTyd6

--HG--
extra : rebase_source : 61e23c7fcc466eccef8bf496436841fe153c4767
2017-09-25 14:11:29 +09:00
Makoto Kato 2fc292406d Bug 1402469 - Part 1. Return value of ConvertListType should use Element instead of nsresult. r=masayuki
This is a typo bug of Bug 1053779 Part 2.  ConvertListType might return NS_OK
even if ReplaceContainer doesn't return valid value.

So, to clean up code, we should return Element instead of nsresult since out
parameter of this function is Element only.

MozReview-Commit-ID: 44UHETzcdGy

--HG--
extra : rebase_source : ab76486505cb4e7caea3fb99e11fccd606878f02
2017-09-25 14:15:50 +09:00
Kyle Machulis a3876f104a Bug 1389650 - Remove nsIDOMHTMLAnchorElement; r=bz
Removes the XPCOM interface for nsIDOMHTMLAnchorElement, replacing it
with binding class usage.

MozReview-Commit-ID: 7v0bKlY7Fax
2017-09-26 11:41:28 -07:00
Sebastian Hengst 5ed0b93c50 Backed out changeset 26805294a547 (bug 1389650) 2017-09-26 10:47:41 +02:00
Nicholas Nethercote dfd3b7e7aa Bug 1400459 (part 2) - Devirtualize nsIAtom. r=heycam.
This patch merges nsAtom into nsIAtom. For the moment, both names can be used
interchangeably due to a typedef. The patch also devirtualizes nsIAtom, by
making it not inherit from nsISupports, removing NS_DECL_NSIATOM, and dropping
the use of NS_IMETHOD_. It also removes nsIAtom's IIDs.

These changes trigger knock-on changes throughout the codebase, changing the
types of lots of things as follows.

- nsCOMPtr<nsIAtom> --> RefPtr<nsIAtom>

- nsCOMArray<nsIAtom> --> nsTArray<RefPtr<nsIAtom>>
  - Count() --> Length()
  - ObjectAt() --> ElementAt()
  - AppendObject() --> AppendElement()
  - RemoveObjectAt() --> RemoveElementAt()

- ns*Hashtable<nsISupportsHashKey, ...> -->
  ns*Hashtable<nsRefPtrHashKey<nsIAtom>, ...>

- nsInterfaceHashtable<T, nsIAtom> --> nsRefPtrHashtable<T, nsIAtom>
  - This requires adding a Get() method to nsRefPtrHashtable that it lacks but
    nsInterfaceHashtable has.

- nsCOMPtr<nsIMutableArray> --> nsTArray<RefPtr<nsIAtom>>
  - nsArrayBase::Create() --> nsTArray()
  - GetLength() --> Length()
  - do_QueryElementAt() --> operator[]

The patch also has some changes to Rust code that manipulates nsIAtom.

MozReview-Commit-ID: DykOl8aEnUJ

--HG--
extra : rebase_source : 254404e318e94b4c93ec8d4081ff0f0fda8aa7d1
2017-09-26 08:33:21 +10:00
Kyle Machulis e2ace7d91f Bug 1389650 - Remove nsIDOMHTMLAnchorElement; r=bz
Removes the XPCOM interface for nsIDOMHTMLAnchorElement, replacing it
with binding class usage.

MozReview-Commit-ID: 7v0bKlY7Fax
2017-09-25 23:12:44 -07:00
Olli Pettay c80e124562 Bug 1396584 - Remove support for multiple ShadowRoots, r=mrbkap
--HG--
extra : rebase_source : 2bb600ed1ffd35c195617a7eb70d0ba847a46898
2017-09-25 18:09:26 +03:00
Kyle Machulis 9b4ac7e03f Bug 1402102 - Remove nsIDOMHTMLObjectElement; r=bz
Removes the nsIDOMHTMLObjectElement XPCOM interface, replacing it with
HTMLObjectElement and FromContent conversion usage.

MozReview-Commit-ID: dmsjSO97uh

--HG--
extra : rebase_source : 9b2c25b8681f754bc34233afccdb6fc5d38f0804
2017-09-22 17:05:12 -07:00
Nicholas Nethercote cea0a3af5d Bug 1400777 (part 1) - Remove eHTMLTags. r=mrbkap.
It's just a too-cute-by-half typedef for nsHTMLTag.

--HG--
extra : rebase_source : 142128de90c3bed06648db445ca0159c23ea6ff3
2017-09-19 11:07:49 +10:00
Ehsan Akhgari 78f4e42447 Bug 1399722 - Don't prevent changing the selection in the editor when setting the value attribute; r=masayuki 2017-09-20 09:10:03 -04:00
Ehsan Akhgari 445bf0b3fc Bug 1401225 - Pass the correct length when collapsing the selection in EditorBase::SetTextImpl(); r=masayuki 2017-09-20 09:09:58 -04:00
Nicholas Nethercote 2ef37710e7 Bug 1395828 (part 4) - Remove nsIParserService/nsParserService. r=mrbkap.
It a stateless wrapper around static methods in nsHTMLTags and nsHTMLElement,
and hence an unnecessary layer of indirection that just adds complexity and
slowness. This patch removes it, cutting almost 300 lines of code.

This requires making nsElementTable.h an exported header, to expose the
nsHTMLElement methods.

--HG--
extra : rebase_source : abbcb8e5001389affbf717092213b898673db07f
2017-09-05 20:19:06 +10:00
Xidorn Quan fd467033f9 Bug 1407847 - Enable stylo for XUL document without system principal and annotate failures accordingly. r=heycam
MozReview-Commit-ID: KcJxloT2rR8

--HG--
extra : rebase_source : 8943efaa7afbf1bc74ac85ca103a52e2f4d1b1a4
2017-10-12 10:43:38 +11:00
Sylvestre Ledru e8734313d2 Bug 1408767 - HTMLEditor::MouseMove: Remove two unused variables r=m_kato
MozReview-Commit-ID: 8aP9nevSXPz

--HG--
extra : rebase_source : 6fce6c36c77518c1c75092c36e3e3454ae03a019
2017-10-15 19:32:43 +02:00
Gerald Squelart 7dbe315e25 Bug 1398999 - nsDequeFunctor::operator() doesn't need to return anything - r=froydnj
Its return value is never used, and most implementations return nullptr anyway.

MozReview-Commit-ID: 8rxC053mmE8

--HG--
extra : rebase_source : 61a0b8b1373396182efd27d3c01b96e5e5541364
2017-02-09 14:06:36 +11:00
Sebastian Hengst dbddac850d merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: IgyDMUVYYBm
2017-09-11 23:58:31 +02:00
Michael Layzell c67b1f18a3 Bug 1340578 - Allow execCommand('paste') to be called from webextensions without a target, r=ehsan 2017-09-11 14:13:26 -04:00
Makoto Kato 6b536f8760 Bug 1394758 - Part 2. WSRunObject::InsertBreak should convert space to NBSP when current position is first text run object. r=masayuki
After applying part 1 fix, it doesn't pass test_bug430392.html like the following..

1. content is <span contenteditable=false>A</span>[caret] ;
2. [VK_RETURN]
3. content is <span contenteditable=false>A</span><br>; <- whitespace is removed

Since we started to treat readonly text nodes as WSType::special with previous patch, WSRunObject::InsertBreak doesn't convert space (after caret) to NBSP because WSRunObject::InsertBreak does it only when inserted position isn't first text run object.

So even if this is first text run object, space after caret should be converted to NBSP.

MozReview-Commit-ID: Hj0i3wm45c3

--HG--
extra : rebase_source : 2d0ae7c47c6187e56d6c29e8eb48974f7ab7ff72
2017-09-04 15:01:16 +09:00
Makoto Kato bf93a68c34 Bug 1394758 - Part 1. non-editable text node should be treated as WSType::special, not WSType::text. r=masayuki
This bug occurs that WSRunObject::PrepareToDeleteRangePriv() calls WSRunObject::ConvertToNBSP for non-editable text node.

Actually, even if text node isn't editable, WSFragment::mType becomes WSType::text now.  So, whitespace only node at the end of contenteditable=false is treated as WSType::normalWS, i.e., treated as editable.

So text node in contenteditable=false should treated as WSType::special which means a non-editable inline object.   Then, WSRunObject won't create object chunk of WSType::normalWS for text node in contenteditable=false.

MozReview-Commit-ID: GOjxax8KvDD

--HG--
extra : rebase_source : e5fff30a2710c2021d59ce88bf2698ce4ebe2dfc
2017-09-11 15:52:05 +09:00
Makoto Kato 012ef9e1c1 Bug 1380292 - Don't turn on object resizer, inline table editor and etc when element isn't into editor. r=masayuki 2017-09-09 10:49:02 -04:00
Wes Kocher 5ee13ebe8a Merge m-c to inbound, a=merge
MozReview-Commit-ID: 4CJDJBAcVPL
2017-09-08 13:41:21 -07:00
Christoph Kerschbaumer 2f720638ac Bug 1397656 - Update tests within editor/ to comply with new toplevel data: URI navigation policy. r=masayuki 2017-09-08 15:40:34 +02:00
Masayuki Nakano 4ce89d8f61 Bug 1369072 - part3: nsXBLPrototypeHandler::DispatchXBLCommand() should use controller of visible window r=smaug
With previous change, KeyboardEvent is dispatched even when invisible window
has focus.  However, nsRootWindow::GetControllerForCommand() returns controller
for focused window even when the window is invisible because it uses
nsFocusManager::GetFocusedDescendant() to retrieve focused window.

Perhaps, we can assume that users won't expect to do something with invisible
window when they type some keys.  Then, nsRootWindow::GetControllerForCommand()
should return controller for visible ancestor window if focused window is
invisible.

This patch makes nsFocusManager::GetFocusedDescendant() can return only visible
descendants.  However, it already has a bool argument.  Therefore, it should
have a flag instead of adding new flag.  Most changes of this patch is replacing
its callers.

Then, nsRootWindow::GetControllerForCommand() and nsRootWindow::GetControllers()
should have a bool flag if it should return controller(s) for visible window.
This patch adds a bool flag for it.  Fortunately, the interface isn't scriptable.

Finally, this patch makes nsXBLPrototypeHandler::DispatchXBLCommand() and
EventStateManager::DoContentCommandEvent() retrieve controller for visible
window since they are always handles user input.

MozReview-Commit-ID: GygttTHuKRm

--HG--
extra : rebase_source : 1341273c4606298cb9b890b9312d9f5c8a75d144
2017-09-07 22:54:49 +09:00
Sebastian Hengst 9a6b5140c4 merge mozilla-central to autoland. r=merge a=merge 2017-09-08 11:03:59 +02:00
Chris Peterson ce7edc4de1 Bug 1394603 - Replace fails-if(!styloVsGecko) to fails. r=jryans
Skip tests that are expected to fail in both Stylo and Gecko modes. They would unexpectedly "pass" in styloVsGecko mode when comparing the two failures, which is not a useful result.

MozReview-Commit-ID: 3mOpjU225Q1

--HG--
extra : rebase_source : 22bb5d4e3c5138ef832995eaf5716824f4707ffe
extra : source : d40fb20c9a49d0797c0eeae613a04912b12a28f7
2017-09-01 20:39:44 -07:00
Ehsan Akhgari 2231e4a948 Bug 1397577 - Avoid using GetChildAt() in HTMLEditor::GetSelectedOrParentTableElement(); r=smaug 2017-09-07 10:29:02 -04:00
Ehsan Akhgari 233352f9ba Bug 1397576 - Avoid using GetChildAt() in HTMLEditor::GetCellFromRange(); r=smaug 2017-09-07 09:36:07 -04:00
Sebastian Hengst 8eb249afcc merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: JSRVc5yW6Kx
2017-09-07 12:39:12 +02:00
Nicholas Nethercote f92bd5e9ab Bug 1393642 (follow-up) - Fix potential leak in HTMLEditor methods. r=masayuki.
As written, these functions will leak if they are passed strings that don't
match static atoms. In practice, all strings passed *do* match static atoms,
but let's fix it anyway in case that changes in the future.

--HG--
extra : rebase_source : 01685428e7dfc577e63bb6423382817359623151
2017-09-07 12:20:51 +10:00
Phil Ringnalda 75f9cdbd7e Backed out 3 changesets (bug 1394603) for reftest syntax error
CLOSED TREE

Backed out changeset 44117208f321 (bug 1394603)
Backed out changeset 31088c59d895 (bug 1394603)
Backed out changeset 20551d68f602 (bug 1394603)

MozReview-Commit-ID: 4F4jSQ8GyfG
2017-09-06 22:48:55 -07:00
Chris Peterson 2d629378b2 Bug 1394603 - Replace fails-if(!styloVsGecko) to fails. r=jryans
Skip tests that are expected to fail in both Stylo and Gecko modes. They would unexpectedly "pass" in styloVsGecko mode when comparing the two failures, which is not a useful result.

MozReview-Commit-ID: 3mOpjU225Q1

--HG--
extra : rebase_source : 0c307639c3626af3b6b43e05d3ee73d08b3f47ce
2017-09-01 20:39:44 -07:00
Wes Kocher a14d71906d Merge m-c to inbound, a=merge
MozReview-Commit-ID: BJ4WkYrJ9g6
2017-09-06 17:24:48 -07:00
Masayuki Nakano 7fb91d43b5 Bug 1397178 - Make EditorBase::GetRoot() not call nsIEditor::GetRootElement() r=smaug
In the old design, EditorBase::mRootElement is initialized when
nsIEditor::GetRootElement() is called.  Therefore, EditorBase::GetRoot()
calls if mRootElement is nullptr.

However, mRootElement is now initialized when EditorBase::UpdateRootElement()
is called and it's always initialized when EditorBase::Init() is called.

So, EditorBase::GetRoot() doesn't need to call nsIEditor::GetRootElement()
anymore.

MozReview-Commit-ID: 6dNEJaGNMZe

--HG--
extra : rebase_source : ed29488cfd1434fb200387706ca5a96cb2185090
2017-09-05 23:32:17 +09:00
Makoto Kato daeca3277c Bug 1395443 - DictionaryFetcher::Fetch should initializate nsIContentPrefService2 by idle thread. r=masayuki
When using contenteditable with spellchecker (it is by default), spellchecker will be initialized by mozilla::EditorEventListener::Focus.  This method will call nsEditorSpellCheck::UpdateCurrentDictionary, but this method seems to be slow.

DictionaryFetcher::Fetch gets nsIContentPrefService2 that is implemented by JavaScript, so we should create nsIContentPrefService2 out of Fetch method.

MozReview-Commit-ID: 1fxug0sqD72

--HG--
extra : rebase_source : c46a54f9fc811aace20c54c4a3e468a83c2530d2
2017-09-04 19:57:45 +09:00
Andrew McCreight 7f7f149167 Bug 1395636 - Convert code to use NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED. r=peterv
MozReview-Commit-ID: DivJPerL5SF

--HG--
extra : rebase_source : 890df75914906a5d34e8af67f9fc3a4be239d2d6
2017-08-31 16:29:22 -07:00
Sebastian Hengst 2f7f455fa1 Backed out changeset 9306866e8df0 (bug 1395636) for build bustage. r=backout on a CLOSED TREE
--HG--
extra : amend_source : 20d028d6b971cf6a221dc2f1553687d6c074bdcb
2017-09-06 19:18:06 +02:00
Andrew McCreight 4d6e76dfcf Bug 1395636 - Convert code to use NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED. r=peterv
MozReview-Commit-ID: DivJPerL5SF

--HG--
extra : rebase_source : cb952cfc5600a163a5580438e5b0177595689dab
2017-08-31 16:29:22 -07:00
Catalin Badea d952c00aad Bug 1395936 - Avoid child index usage in HTMLEditor::DoContentInserted. r=masayuki 2017-09-06 21:38:43 +01:00
Sebastian Hengst c2f7bd1de9 Backed out changeset dbb4fb7aa5bb (bug 1395936) for assertions and crashes in a11y test, mochitests, reftests, crashtest, ...; r=backout on a CLOSED TREE 2017-09-06 13:25:37 +02:00
Catalin Badea c90d69fac0 Bug 1395936 - Avoid child index usage in HTMLEditor::DoContentInserted. r=masayuki 2017-09-06 11:26:03 +01:00
Nicholas Nethercote 9b8908c88e Bug 1395828 (part 3) - Remove AssertParserServiceIsCorrect(). r=mrbkap.
It's a bit strange for the editor to distrust the parser service in this way.
The double-checking seems unnecessary, especially given that it is *buggy*: it
incorrectly includes `col`, `colgroup`, and `legend` as block elements, but
excludes `pre`. (It must only be called in situations where these
incorrectly-classified elements are not passed in, otherwise it would have
triggered by now.) So this patch removes it.

The patch also removes `li` and `pre` from the IsAnyOfHTMLElements() test in
HTMLEditor::NodeIsBlockStatic. Contrary to what the comment in
NodeIsBlockStatic() says, they *are* identified as block elements by the parser
service.

--HG--
extra : rebase_source : c9bb3c9e07320fafed17942229c316f41ac2a0a6
2017-09-04 15:45:07 +10:00
Makoto Kato 6e004e975d Bug 1363896 - Adjust fuzzy-if for Android's reftest. r=masayuki
editor/reftests/input-text-onfocus-reframe-ref.html is sometimes failed due to "image comparison, max difference: 1, number of differing pixels: 1".

As long as I check both images, I don't know why focus ring is different.  But this is 1 pixel only diff, so we should use fuzz-if.

MozReview-Commit-ID: 5SrjorXEBW

--HG--
extra : rebase_source : d6fbb2f3a5ea2bff5ee6c2b39909831830f5d47c
2017-09-04 13:44:59 +09:00
Sebastian Hengst 3528754b01 Backed out changeset d2305bd57a97 (bug 1393140) for changed behavior on request from jorgk. r=backout a=backout
MozReview-Commit-ID: HGulTnPx6TF
2017-09-02 23:48:23 +02:00
Wes Kocher 8b84853ed6 Merge m-c to autoland, a=merge
MozReview-Commit-ID: GcHZLNPPNnI
2017-09-01 16:34:14 -07:00
Wes Kocher 5f157c17dc Merge inbound to central, a=merge
MozReview-Commit-ID: 3JxUEFuinHY
2017-09-01 16:29:10 -07:00
Ehsan Akhgari b62766b04e Bug 1393140 - Rewrite EditorBase::FindBetterInsertionPoint() without using nsINode::GetChildAt(); r=masayuki 2017-09-01 12:12:39 -04:00
Masayuki Nakano 199c190cbe Bug 1395157 - Make EditorBase::EndPlaceholderTransaction() not retrieve nor hold nsIPresShell and nsCaret r=Ehsan
EditorBase::EndPlaceholderTransaction() has hidden caret.  However, it doesn't
do it anymore.  However, bug 805697 didn't remove unnecessary code that
retrieves and hold nsIPresShell and nsCaret.  This patch removes them.

MozReview-Commit-ID: Eh9pbf8p2bZ

--HG--
extra : rebase_source : e766906089af1cd3c6efa95b82e3b126ae097ab2
2017-08-30 23:24:26 +09:00
Henri Sivonen 3c8567b60d Bug 1354989 - Avoid pivoting via UTF-16 when loading CSS in the Stylo mode. r=jdm,SimonSapin
MozReview-Commit-ID: Llt29dvB4Io

--HG--
extra : rebase_source : 3ae51dc8beff3fb19e9318a6c7c30c9ab08a5b57
2017-08-29 16:01:42 +03:00
Makoto Kato 2f39643ca1 Bug 1395080 - Part 4. Remove unused nsIDOMRange parameter. r=masayuki
GetFirstSelectedCell and GetNextSelectedCell allow that 1st parameter is nullptr when current range is unnecessary.  So we should use nullptr when it is unused.

MozReview-Commit-ID: BuI7ds47h0U

--HG--
extra : rebase_source : 4cb67aa15c5b5a7692c7e5eb43976c8e7a7884e4
2017-09-01 13:36:35 +09:00
Makoto Kato cc0f4f0109 Bug 1395080 - Part 3. Replace nsIDOMRange::GetStartContainer and nsIDOMRange::GetEndContainer with nsRange::GetStartContainer and nsRange::GetEndContainer. r=masayuki
Except to nsTextServicesDocument.cpp, we replace nsIDOMRange::GetStartContainer and nsIDOMRange::GetEndContainer with nsRange::GetStartContainer and nsRange::GetEndContainer.

Since nsTextServicesDocument.cpp still uses a lot of nsIDOMNode, I will change it by new bug.

MozReview-Commit-ID: 9x1oajmabca

--HG--
extra : rebase_source : c22072a39c907df631025a423c6302df2047e824
2017-09-01 13:35:57 +09:00
Makoto Kato 09107665a4 Bug 1395080 - Part 2. Replace nsIDOMRange::GetStartOffset and nsIDOMRange::GetEndOffset with nsRange::StartOffset and nsRange::EndOffset. r=masayuki
MozReview-Commit-ID: 4wja9Lu53IR

--HG--
extra : rebase_source : 2fa7f89435645dbc90d39089b2856612bd71dfdf
2017-09-01 12:20:28 +09:00
Makoto Kato c171902197 Bug 1395080 - Part 1. Replace nsIDOMRange::GetCollapsed with nsRange::Collapsed. r=masayuki
MozReview-Commit-ID: LefqnYBJGec

--HG--
extra : rebase_source : f85c786ee218cf6e8528be8d2d91aa9ac0e3ce97
2017-09-01 12:19:11 +09:00
Andrew McCreight 78807d8776 Bug 1391005 - Eliminate NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED. r=peterv
Replace it with NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION, because it
has been the same for a while.

MozReview-Commit-ID: 5agRGFyUry1

--HG--
extra : rebase_source : 5388c56b2f6905c6ef969150f0c5b77bf247624d
2017-08-29 16:02:48 -07:00
Nicholas Nethercote 0eadf50d37 Bug 1394583 - Remove default properties from nsIHTMLEditor. r=masayuki.
nsIHTMLEditor's addDefaultProperty(), removeDefaultProperty(),
removeAllDefaultProperties() methods are never used -- not from C++ code or
script, in either mozilla-central or comm-central.

So this patch removes them. This means that HMLTEditor::mDefaultStyles is never
used, so the patch removes it and all the code that manipulates it as well.

--HG--
extra : rebase_source : 76634ce2bb2d94534b8d7f299c4ebd6a83b66637
2017-08-25 16:59:17 +10:00
Makoto Kato fedf4a0136 Bug 1391978 - Part 9. Replace nsISelection::GetAnchorNode with Selection::GetAnchorNode. r=masayuki
MozReview-Commit-ID: CiIClvsiNxX

--HG--
extra : rebase_source : a739151e75d8920dd76b9729fd0d698f574218ed
extra : histedit_source : d9004420476b49aa5e063a00b01928e509214843
2017-08-25 16:12:39 +09:00
Makoto Kato 349e2e739f Bug 1391978 - Part 8. Replace nsISelection::GetAnchorOffset with Selection::AnchorOffset. r=masayuki
MozReview-Commit-ID: GgxyRsVXHwl

--HG--
extra : rebase_source : 7d3d869f21669486e9dd3bb925451e5bd20fa3b0
extra : histedit_source : 0e2f13e733d143a782391c420da9bfa34f0c228a
2017-08-25 16:12:39 +09:00
Makoto Kato 7732ebc1b4 Bug 1391978 - Part 7. HTMLEditRules::NormalizeSelection should use nsINode instead of nsIDOMNode. r=masayuki
HTMLEditRules::NormalizeSelection uses nsIDOMNode for node handling, so we replace with nsINode, then use Selection::Extend and Selection::Collapse.

MozReview-Commit-ID: 6Ijo19vTwRi

--HG--
extra : rebase_source : 3171ed5808d9045b268cc76989c7d06ea220d393
extra : histedit_source : f3a1af1f84cceb80200a3965385dfb1d036c9e60
2017-08-25 16:12:39 +09:00
Makoto Kato 83778753b6 Bug 1391978 - Part 6. Replace nsISelection::Extend with Selection::Extend. r=masayuki
Except to HTMLEditRules::NormalizeSelection, I replace nsISelection::Extend with Selection::Extend.

MozReview-Commit-ID: H83zpvAo5Xa

--HG--
extra : rebase_source : b217dd1d506229d848126b9c2494d1b4f9dc3a35
extra : histedit_source : 8999bc5b1b1edfe7e48a432d52640b8181490624
2017-08-28 17:54:34 +09:00
Makoto Kato 6f6e4ef550 Bug 1391978 - Part 5. Replace nsISelection::GetFocusOffset/GetAnchroOffset with Selection::FocusOffset/AnchorOffset. r=masayuki
MozReview-Commit-ID: 6OpO1GQyhFO

--HG--
extra : rebase_source : 3e57ddbebc7985ec0e5ada4b1e83631d6f1c83b5
extra : histedit_source : 655c5c3e4c4a3f30d028f9b4b316573a187bd0f0
2017-08-25 16:12:38 +09:00
Makoto Kato 72387d25cd Bug 1391978 - Part 4. Replace nsISelection::GetFocusNode with Selection::GetFocusNode. r=masayuki
MozReview-Commit-ID: GFtkRvsFaYI

--HG--
extra : rebase_source : c11007a58ee312a7845ba4b8c0886dec49cd8c39
extra : histedit_source : e0a2d06a061a9cad3ff83e6be5e697a1c2748756
2017-08-25 16:12:38 +09:00
Makoto Kato 1480dbb45c Bug 1391978 - Part 3. Replace nsISelection::GetIsCollapsed with Selection::IsCollapsed. r=masayuki
MozReview-Commit-ID: AYCX9V8smzm

--HG--
extra : rebase_source : 2c45cffa7d526a9e07126c90f17232b02b1612ea
extra : histedit_source : bd451bdd633df2eb155102f9c3b29b49a25b9c69
2017-08-25 17:48:04 +09:00
Makoto Kato a7d3c9c2a0 Bug 1391978 - Part 2. Replace nsISelection::SelectAllChildren with Selection::SelectAllChildren. r=masayuki
MozReview-Commit-ID: m9bLHIIfy9

--HG--
extra : rebase_source : 47aa2e674a8f6615989b25ddb2b11b6614587b7b
extra : histedit_source : 847922b8ff86389a4a264efda7c4f933743c8f63
2017-08-25 16:12:38 +09:00
Makoto Kato 26ce168fcc Bug 1391978 - Part 1. Replace nsISelection::GetRangeCount with Selection::RangeCount. r=masayuki
I would like to remove more dependency of old nsISelection interface from editor if possible.  So we can replace nsISelection::GetRangeCount with Selection::RangeCount.

MozReview-Commit-ID: 2Mh5ceQI2om

--HG--
extra : rebase_source : 03c8a5b49e2929b0ce6c6af8b78c9677a55a14c4
extra : histedit_source : ca7741379c7cc5b7b938aad22a57f419a2442fd3
2017-08-28 14:52:25 +09:00
Olli Pettay 4ef3c3fdf6 Bug 1371657 - Ensure we use the right root element in editor. r=masayuki 2017-08-28 14:57:46 -04:00
Sebastian Hengst 9769c22d10 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: AeoHOxZLi6m
2017-08-28 16:53:53 +02:00
Ehsan Akhgari 6f420e6a00 Bug 1394180 - Reduce the number of calls to nsINode::GetChildAt() in EditorBase::InsertTextImpl(); r=masayuki 2017-08-28 01:42:30 -04:00
Masayuki Nakano 3bd4299525 Bug 1393348 - part2: nsISelectionController::SELECTION_* should be sequential integer values r=smaug
nsISelectionController::SELECTION_* are declared as bit-mask.  However, no
methods of nsISelectionController treat them as bit-mask and these
values need a switch statement in nsFrameSelection to convert SelectionType to
array index of nsFrameSelection::mDOMSelections because it's too big to create
an array to do it.  Additionally, this conversion appears profile of
attachment 8848015.

So, now, we should declare these values as sequential integer values.

However, only nsTextFrame uses these values as bit-mask.  Therefore, this patch
adds new type, SelectionTypeMask and creates new inline method,
ToSelectionTypeMask(SelectionType), to retrieve mask value for a SelectionType.

MozReview-Commit-ID: 5Za8mA6iu4

--HG--
extra : rebase_source : 86617c1f5fa23166458f4353cb834f9e7c5b131b
2017-08-24 19:14:04 +09:00
Nicholas Nethercote c7df832636 Bug 1393642 - Remove nsIAtom/nsIAtomService usage from script in editor/. r=masayuki.
nsIHTMLEditor has several scriptable methods (addDefaultProperty(),
removeDefaultProperty(), etc.) that have nsIAtom parameters. We're in the
process of deCOMtaminating nsIAtom (bug 1392883) so these methods need to be
changed.

This patch does the following.

- It changes those methods to take an AString instead of an nsIAtom.

- For each existing method, it adds to HTMLEditor a new C++ method of the same
  name that takes an nsIAtom parameter.

- It updates TextEditorTest.cpp to use strings instead of atoms, in order to
  keep using the XPIDL methods.

- It updates test_bug1140105.html to pass strings instead of atoms to
  getInlineProperty(). This removes the use of nsIAtomService.

--HG--
extra : rebase_source : e005c3b5a08207b3d5d5fb55c47c8bc475b33453
2017-08-25 15:40:45 +10:00
Sebastian Hengst 6fd5b9e1ca merge mozilla-central to autoland. r=merge a=merge 2017-08-25 13:19:59 +02:00
Sebastian Hengst 31302b9cec merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 5armhVE9Jui
2017-08-25 13:12:04 +02:00
Ehsan Akhgari b174b2306a Bug 1392867 follow-up: Document that the aChild argument won't get AddRef'ed
DONTBUILD
2017-08-24 18:39:24 -04:00
Makoto Kato 5bd44e5cfd Bug 1393355 - Move SetTextRangeStyle from nsISelectionPrivate to Selection. r=masayuki
There is no reason that SetTextRangeStyle is defined at nsISelectionPrivate.  Also, SetTextRangeStyle isn't scriptable, and is called from CompositionTransaction::SetIMESelection only.  So we should move this to Selection.

MozReview-Commit-ID: FCOA6wVhvYZ

--HG--
extra : rebase_source : 64eb9e5fb973195b2c87ab4eb296685c8a4d0319
2017-08-24 16:56:12 +09:00
Masayuki Nakano e3529fd155 Bug 1375502 - part2: Add nsIContentIterator::Init(nsINode*, uint32_t, nsINode*, uint32_t) r=mats
nsIContentIterator::Init() takes nsRange but it's too expensive for some users.
So, there should be another Init() which can be specified a range in DOM tree
with 2 pairs of nsINode* and uint32_t.

MozReview-Commit-ID: 6JXic0KOM2d

--HG--
extra : rebase_source : 28ff355a2aa0dcb5d65495806ef8c67f1da642ea
2017-06-26 17:26:27 +09:00
Olli Pettay 045eeefaaa Bug 1390402, add a faster variant of TextEditor::GetDocumentIsEmpty(), r=masayuki
--HG--
extra : rebase_source : 3238aec96be5b0393c395ce8cce9a0489d2e671d
2017-08-24 13:53:34 +03:00
Eric Rahm a33f11e0f5 Bug 1391803 - Use nsStringFwd.h for forward declaring string classes. r=froydnj
We should not be declaring forward declarations for nsString classes directly,
instead we should use nsStringFwd.h. This will make changing the underlying
types easier.

--HG--
extra : rebase_source : b2c7554e8632f078167ff2f609392e63a136c299
2017-08-16 16:48:52 -07:00
Sebastian Hengst 99e5cb9c14 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: GSKVB94r7Kk
2017-08-23 16:29:51 +02:00
Makoto Kato a1548f0668 Bug 1348073 - Part 4. Unnecessary VK_RIGHT to move caret on non-visual frame that is whitespace only node. r=masayuki
Since we enable lazy frame construction for editable region, whitespace only node might not have frame even if editable.  This test has whitespace only node into contenteditable, we need adjust caret operation for this test.

MozReview-Commit-ID: GQfKiYdYOdi

--HG--
extra : rebase_source : 0685d724f6af050d79c1cf007c7ee48c05da14ac
2017-08-21 15:33:03 +09:00
Ehsan Akhgari 31e4d33b89 Bug 1392870 - Avoid using nsINode::GetChildAt() in HTMLEditRules::DeleteNonTableElements(); r=masayuki 2017-08-23 01:01:04 -04:00
Ehsan Akhgari e7f2972a7f Bug 1392867 - Part 2: Avoid calling GetChildAt() in HTMLEditRules::TryToJoinBlocks(); r=masayuki 2017-08-23 01:00:07 -04:00
Ehsan Akhgari 07f926500c Bug 1392867 - Part 1: Add an overload of EditorUtils::IsDescendantOf() which returns an nsIContent* out argument for the child node found instead of its index in the parent; r=masayuki 2017-08-23 01:00:07 -04:00
Nicholas Nethercote 092af8e0a1 Bug 1390428 (part 5) - Remove more nsXPIDLCString uses. r=erahm.
These are all simple cases, with similarities to previous patches in this
series.

--HG--
extra : rebase_source : 6ef36382df9fef217d5cb737e218d65ac062f90a
2017-08-16 14:07:18 +10:00
Olli Pettay aeabc0c261 Bug 1392564 - Use nursery purple buffer for nsRange and RangeItem, r=mccr8
--HG--
extra : rebase_source : 650d101bb0cec4ed21b35945ae1185aca577b120
2017-08-22 17:47:00 +03:00
Makoto Kato 3ee9303468 Bug 1381541 - queryCommandState should consider that parent node of selection is null. r=masayuki
When parent node of selected node is null, crash might occur in GetCSSBackgroundColorState.  So when parent is null, we should return default value.  In this situation, Edge and Blink don't throw error, Gecko shouldn't return error too.

MozReview-Commit-ID: 5C6jSAFkCso

--HG--
extra : rebase_source : 0185f9fb5fde92eee5611e6bb95e8676c10b135c
2017-08-18 14:48:39 +09:00
Masayuki Nakano a7240d8532 Bug 1391538 - nsTextFragment for text nodes in <input> or <textarea> shouldn't store text as single byte characters even if all characters are less than U+0100 r=smaug
nsTextFrame stores text as single byte character array if all characters are
less than U+0100.  Although, this saves footprint, but retrieving and modifying
text needs converting cost.  Therefore, if it's created for a text node in
<input> or <textarea>, it should store text as char16_t array.

MozReview-Commit-ID: 9Z82rketT7g

--HG--
extra : rebase_source : 59f59ac1488c21a57d95d253cc794a011d672c95
2017-08-18 16:05:16 +09:00
Wes Kocher c043502159 Merge m-c to autoland, a=merge
MozReview-Commit-ID: 7sFZmPUXSx6
2017-08-18 17:21:29 -07:00
Masayuki Nakano 30fb5747b0 Bug 1391165 - part4: nsIEditor::EndOfDocument() should be implemented with an internal method which takes pointer to Selection r=smaug
EditorBase::GetSelection() sometimes appears in profile.  So, it shouldn't be
called in nsIEditor::EndOfDocument() if the callers of
nsIEditor::EndOfDocument() has a pointer to Selection.

This patch adds EditorBase::CollapseSelectionToEnd() for the internal method
and make all callers of nsIEditor::EndOfDocument() use it.

MozReview-Commit-ID: 8H4ThxzdKDf

--HG--
extra : rebase_source : 7436d7f286351fa9c91175b40e686f7ca1f3c69f
2017-08-17 17:08:22 +09:00
Masayuki Nakano a329587e5e Bug 1391165 - part3: TextEditRules::CollapseSelectionToTrailingBRIfNeeded() should use EditorBase::GetChildOffset() only when it's necessary r=smaug
In most cases, TextEditRules::CollapseSelectionToTrailingBRIfNeeded() doesn't
use the index anymore.  Therefore, it should stop using
EditorBase::GetNodeLocation() and use EditorBase::GetChildOffset() only when
the offset is necessary.

MozReview-Commit-ID: 9vGcLnTUnsu

--HG--
extra : rebase_source : af0cdad3a1905bf2e5654a109aa4037ec70b422b
2017-08-17 16:48:49 +09:00
Masayuki Nakano 0290f8a69f Bug 1391165 - part2: TextEditRules::CollapseSelectionToTrailingBRIfNeeded() should use nsINode::GetNextSibling() for retrieving next child of a node r=smaug
nsINode::GetChildAt() is too expensive if it's used for next sibling of a node.

This patch makes it use nsINode::GetNextSibling() instead.

MozReview-Commit-ID: CAC7gFNo77w

--HG--
extra : rebase_source : 185457b910e2e09c58a6f02525ae61aff149511c
2017-08-17 16:35:30 +09:00
Masayuki Nakano 87f491432c Bug 1391165 - part1: EditorBase::GetChildOffset() and EditorBase::GetNodeLocation() shouldn't use nsINode::IndexOf() as far as possible r=smaug
nsINode::IndexOf() is expensive especially when it's in a hot path, it's too
expensive.  So, EditorBase::GetChildOffset() and EditorBase::GetNodeLocation()
should check child's siblings first.  If some of them are nullptr, it means
that it's first child or last child of the parent.

Note that EditorBase::GetChildOffset() may return wrong index if it's called
while aChild is being removed from aParent or aParent isn't actual parent of
aChild.  However, there are MOZ_ASSERTs to ensure value isn't -1.  Therefore,
it's safe to assume that aParent is always the parent of aChild and it won't
be called from ContentRemoved() of mutation observers.

MozReview-Commit-ID: 8JdYWuZbHe5

--HG--
extra : rebase_source : 6ded91a3aa8b00ab4d2d544c2c392d88cb769cef
2017-08-17 16:24:16 +09:00
Ehsan Akhgari 950a791753 Bug 1391315 - Avoid using nsINode::GetChildAt() in TextEditRules::DocumentIsEmpty(); r=masayuki
This method will become a lot slower when bug 651120 lands.
2017-08-18 01:49:08 -04:00
Yoshi Huang b930b3d1ee Bug 1390770 - rewrite test_bug289384.html for new data: URI inheritance model. r=masayuki 2017-08-18 10:35:58 +08:00
Ehsan Akhgari 43a6f66350 Backout bug 1386480 for causing bug 1391410 2017-08-17 17:16:27 -04:00
Carsten "Tomcat" Book 99aa3f8e70 Merge mozilla-central to mozilla-inbound 2017-08-17 13:13:10 +02:00
Makoto Kato 4ad29844a4 Bug 1380824 - Call RepaintSelection out of script blocker. r=masayuki
MozReview-Commit-ID: LFyZLW0da7f
2017-08-17 15:28:04 +09:00
Nicholas Nethercote 025461bde7 Bug 1390428 (part 1) - Remove many nsXPIDLCString local variables. r=erahm.
These are all easy cases where an nsXPIDLCString local variable is set via
getter_Copies() and then is only used in ways that nsCStrings can also be used
(i.e. no null checks or implicit conversions to |char*|).

In every case the patch trivially replaces the nsXPIDLCString with an
nsCString. (Also, there are a couple of unused nsXPIDLCString variables that
the patch simply removes.)
2017-08-16 13:58:35 +10:00
Xidorn Quan 179961b3c9 Bug 1383845 - Enable tests disabled for bug 1383845. r=TYLin
MozReview-Commit-ID: Glao9d9PiUF

--HG--
extra : rebase_source : cfc70fcb350a7ee8e325ba1bda0bcdead62d786e
2017-08-17 10:51:59 +10:00
Masayuki Nakano d2dd8c5d8f Bug 1390831 - Make test_bug635636.html e10s-aware r=Ehsan
test_bug655636.html refers gBrowser, however, it's available only in chrome
process and it's referred only for listening to "pageshow" event instead of
"load" event of the data URI.  So, we must be able to use "unload" event of the
previous URL instead.

Although, this testcase (even without this change) won't cause crash even if
backing out the patch for bug 635636 anymore.

MozReview-Commit-ID: B8qOwVZqZQm

--HG--
extra : rebase_source : d383181886152684a8bf9c2caf7248d5f7582c0a
2017-08-16 21:03:18 +09:00
Masatoshi Kimura be91c9a266 Bug 886907 - Remove old synchronous contentPrefService from the tree. r=adw
MozReview-Commit-ID: BZsB3FR3jHC

--HG--
rename : toolkit/components/contentprefs/ContentPrefService2.jsm => toolkit/components/contentprefs/ContentPrefService2.js
rename : toolkit/components/contentprefs/nsContentPrefService.manifest => toolkit/components/contentprefs/ContentPrefService2.manifest
extra : rebase_source : ab45b7668e97734004502ea776effedcb9b74974
2017-08-11 23:29:55 +09:00
Masayuki Nakano e1a21d5a3e Bug 1387317 - part5: AutoPlaceHolderBatch should take EditorBase instead of nsIEditor r=m_kato
AutoPlaceHolderBatch can take EditorBase class and its inherited class, AutoEditBatch, can be removed if we implement other constructor which doesn't take transaction name.

Additionally, nsIEditor::(Begin|End)PlaceHolderTransaction() are referred only by AutoPlaceHolderBatch.  Therefore, they can be non-public methods and removed from nsIEditor interface.

Note that this patch also repalces "PlaceHolder" with "Placeholder" since it's a word.

MozReview-Commit-ID: 5dw3kcX3bOx

--HG--
extra : rebase_source : e926cc1c2ebea70eb08e43778a8b52912b559b7b
2017-08-14 14:56:39 +09:00
Masayuki Nakano 1bbc0d5920 Bug 1387317 - part4: Make editor flag setters use new AddFlags() or RemoveFlags() if useful r=m_kato
MozReview-Commit-ID: EMDeGfK37Lx

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

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

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

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

MozReview-Commit-ID: KnN6Fw4TYyn

--HG--
extra : rebase_source : 48412a5f81f30d9ada47550fdb4d1ee0d88de6f4
2017-08-08 10:57:19 +09:00
Carsten "Tomcat" Book bcbc42d4e3 Merge mozilla-central to mozilla-inbound 2017-08-15 13:09:01 +02:00
Yoshi Huang 60b7d9f697 Bug 1390398: fix failures on windows for new data: URI inheritance model. r=smaug 2017-08-15 18:09:28 +08:00
Carsten "Tomcat" Book 6b36e00b7c merge mozilla-inbound to mozilla-central a=merge 2017-08-15 11:42:11 +02:00