When setting same value (including empty to empty), some browsers might not turn off undo. If settings non-empty value, all browsers doesn't turn off undo. Also, if empty value, Edge and Chrome doesn't turn off undo.
MozReview-Commit-ID: 1nVYEzBr5KJ
--HG--
extra : rebase_source : e49f38e7c5a8f69902d6320eb6740e34e3f161ed
Actually, input.value setter behaviour (when editor has focus) is the following.
- select all
- delete selection
- delete text node
- insert text
- create text node
- create nsIFrame since we don't support lazy construction for editable element
It is too expensive to change text. So I would like to change like the following when there is 1 text node only (normal case). If child nodes isn't 1 text node only, use original way.
- set text on existed text node
So, for this fast path, I would like to add SetText transaction API.
MozReview-Commit-ID: A7bjXtCtSoB
--HG--
extra : rebase_source : ff6348d7a3304e676a0a4b897f91623962961ae0
The MOZ_CRASH was added because we were lacking a implementation of ServoDeclarationBlock::GetPropertyValueByID, but it was added in Bug1294299
MozReview-Commit-ID: GPsFvTLxsMd
--HG--
extra : rebase_source : d51837def3a9a76dfa2af01dcb26b607dd48a5e6
Currently, edit commands for native key bindings are stored in widget. This is
stateful and really complicated in content process because it needs to cache
them.
We can make this simpler if we make WidgetKeyboardEvent store edit commands for
the key combination. Then, child process can handle it even if it's delayed
event or it's a nested event.
This patch adds arrays to WidgetKeyboardEvent to store edit commands which are
initialized with nsIWidget::ExecuteNativeKeyBinding() and adds
WidgetKeyboardEvent::ExecuteEditCommands() to execute stored edit commands as
same as nsIWidget::ExecutenativeKeyBinding().
MozReview-Commit-ID: BGRvBrLz5lp
--HG--
extra : rebase_source : b7ecd704d9c331ca1e0aedc66f230114015b853b
InitSpellChecker allows that 3rd callback parameter is null. We should consider that it is null.
MozReview-Commit-ID: BMAM6BiYlw5
--HG--
extra : rebase_source : fbe767694d6380988854ff133b780b8fe334bf3a
nsIEditRules::GetDocumentIsEmpty doesn't return error without null parameter, so we should use bool as return value instead.
MozReview-Commit-ID: HIoQmKu6ETF
--HG--
extra : rebase_source : 570452e7072d8e0e837bb2822c9c0ab9c0d1a8cf
Nobody uses them anymore. Therefore, we can remove them from the tree.
MozReview-Commit-ID: KTqCeI2eeFW
--HG--
extra : rebase_source : f3fc274f39c135af51245efd4c4aebbc4c49a61f
IMEStateManager should cache nsIWidget for sPresContext at caching sPresContext. Then, even if sPresContext has gone, IMEStateManager can clean up with the nsIWidget cache.
Unfortunately, editor has some bugs about calling IMEStateManager::UpdateIMEState(). That is, calling it *before* IMEStateManager::OnFocusChange(). In such case, this patch makes UpdateIMEState() ignore the call.
MozReview-Commit-ID: 1cydI03WyB8
nsIDocumentEncoder has nativeInit for nsIDocumnet, we should use it to reduce QueryInterface.
MozReview-Commit-ID: Ffn19yf9jra
--HG--
extra : rebase_source : 37c8b27cc0eddd4f0501ec1e61ea27d74ee1e6f3
From profiling TextEditor::OutputToString, most of WillOutputText is ToLowerCase. So, we should use LowerCaseEqualsLiteral instead. It can reduce string copy.
MozReview-Commit-ID: LwqZtxIJTbW
--HG--
extra : rebase_source : 94da785d8288dfd93666a3dcb2d374874c79db89
To clean up TextEditRules, I would like to replace nsIDOMNode with nsINode and nsIContent in TextEditRules.
GetTopEnclosingPre is unused define, so I also remove it.
MozReview-Commit-ID: 6LraexH5t4m
--HG--
extra : rebase_source : 1037dcfd949d544282dc30360bd43773f21fd929
It's not only inefficient, but also prone to buggyness. Since styles may not be
up-to-date when it happens.
Post a reconstruct instead, which ensures a style flush happens before running
frame construction.
MozReview-Commit-ID: DrakHsJv5fY
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
--HG--
extra : rebase_source : 11900af908654336cc2391ab9480542c5474e38f
On Ubuntu 16.04 TLS, test_dragdrop.html due to control margin. So we should adjust the point of dragstart.
MozReview-Commit-ID: EPW2UnaIWRt
--HG--
extra : rebase_source : a97c66dc36328563497130aa7a3829bc8a9eb204
This test is failing intermittently even on non-QuantumRender builds, and bug
1361820 is tracking that issue. Once that is fixed we should be able to re-enable
this test.
MozReview-Commit-ID: HANsz08bujB
--HG--
extra : rebase_source : 4500022a5ffbac6bbd4de3e61c3dc3bba3881b1f
We can't depend on information from layout to be correct unless we've
flushed pending notifications, which we can't do at every editability
check. So let's forget about layout. Nobody knows why editability ever
depended on visibility in the first place.
This allows us to revert the additions from bug 795418 as well.
The original test-case submitted on the bug report was very big and
complicated, so I have a minimal test-case instead. This might not
exactly correspond to the originally reported bug, but this fix works for
both the original and minimal test case.
MozReview-Commit-ID: LOKjlgiAEOT
--HG--
extra : rebase_source : 5aaeae87fdc0dd78cb6f1060399c09d2945f8e08
Now that this is a pref that is different in different versions, tests
have to work no matter what the pref's value is. For tests that
actually tested line-breaking-related behavior, I made them test all
three separator values. For tests that tested something else and only
incidentally depend on the default paragraph separator, I set
defaultParagraphSeparator to "div".
MozReview-Commit-ID: 8m7eoFRXpEy
--HG--
extra : rebase_source : dc664e87f7ce4f621aa48639cef6e754793e8ab4