The method serializes the selection ranges to update the selection cache
for the OS only on macOS. So, there are a lot of cases to run
`nsHTMLCopyEncoder` only on macOS because repainting selection occurs
immediately after moving focus.
Therefore, we may see assertion failures around `RangeBoundaryBase` and
`nsHTMLCopyEncoder` itself only of debug builds on macOS. However,
the macOS machines in trysever are always busy and we need to wait at
least one day and the developers may not run the tests on macOS before
landing their patches due to the slowness.
For solving these issues, this patch makes it run on any debug builds
on any desktop platforms. So, basically, we don't need to run tests on
macOS on tryserver after landing this in the most cases.
Differential Revision: https://phabricator.services.mozilla.com/D280905
The method serializes the selection ranges to update the selection cache
for the OS only on macOS. So, there are a lot of cases to run
`nsHTMLCopyEncoder` only on macOS because repainting selection occurs
immediately after moving focus.
Therefore, we may see assertion failures around `RangeBoundaryBase` and
`nsHTMLCopyEncoder` itself only of debug builds on macOS. However,
the macOS machines in trysever are always busy and we need to wait at
least one day and the developers may not run the tests on macOS before
landing their patches due to the slowness.
For solving these issues, this patch makes it run on any debug builds
on any desktop platforms. So, basically, we don't need to run tests on
macOS on tryserver after landing this in the most cases.
Differential Revision: https://phabricator.services.mozilla.com/D280905
The only remaining purpose of the additional encoding is to detect XHTML documents,
but I think we can handle XHTML documents without doing that.
Differential Revision: https://phabricator.services.mozilla.com/D275398
`nsIDocumentEncoder::NativeInit()` was introduced in bug 574089. It took a
`nsIDocument` directly, whereas `::Init()` took a `nsIDOMDocument` instead.
But now they both take `Document` as an argument. So `NativeInt()` can be
removed and the call sites can use `Init()` instead.
Differential Revision: https://phabricator.services.mozilla.com/D272720
This reverts commit 62ce647fff.
Revert "Bug 1650720 - Part 3: Align link break coversion for clipboard copy with other browsers; r=masayuki"
This reverts commit 3ced2a72e8.
Revert "Bug 1650720 - Part 2: Simplify nsPlainTextSerializer::ConvertToLinesAndOutput; r=masayuki"
This reverts commit 5e63b05f54.
Revert "Bug 1650720 - Part 1: Add plaintext serializer tests for linebreak; r=masayuki"
This reverts commit 21953f6384.
Most changes are automated. Relevant bit is dom/.clang-format. I had to
manually disable clang-format in a few places where importing external
files and so on that aren't self-contained, and fix a couple includes /
forward declarations.
Differential Revision: https://phabricator.services.mozilla.com/D256800
This handles a race condition so if the user copies new data to the clipboard
while Content Analysis is ongoing, the original data will be used in the
paste action.
Differential Revision: https://phabricator.services.mozilla.com/D228719
This handles a race condition so if the user copies new data to the clipboard
while Content Analysis is ongoing, the original data will be used in the
paste action.
Differential Revision: https://phabricator.services.mozilla.com/D228719
`nsFrameSelection::NormalSelection()` returns a `Selection&`, which eliminates the need for nullptr check at call sites.
This simplifies the code in some places and removes unnecessarily indented blocks.
Differential Revision: https://phabricator.services.mozilla.com/D230583
This patches allows
1. when the selection is shadow-crossing, dragging it will have the
correct the drag image correctly displayed. It's hard to test, so
no tests for this.
2. The selection can now be serialized and dropped.
`test_drag_drop_shadow_crossing_selection.html` is the test for
this.
Differential Revision: https://phabricator.services.mozilla.com/D217318
This patches allows
1. when the selection is shadow-crossing, dragging it will have the
correct the drag image correctly displayed. It's hard to test, so
no tests for this.
2. The selection can now be serialized and dropped.
`test_drag_drop_shadow_crossing_selection.html` is the test for
this.
Differential Revision: https://phabricator.services.mozilla.com/D217318
This patches allows
1. when the selection is shadow-crossing, dragging it will have the
correct the drag image correctly displayed. It's hard to test, so
no tests for this.
2. The selection can now be serialized and dropped.
`test_drag_drop_shadow_crossing_selection.html` is the test for
this.
Differential Revision: https://phabricator.services.mozilla.com/D217318
This patches allows
1. when the selection is shadow-crossing, dragging it will have the
correct the drag image correctly displayed. It's hard to test, so
no tests for this.
2. The selection can now be serialized and dropped.
`test_drag_drop_shadow_crossing_selection.html` is the test for
this.
Differential Revision: https://phabricator.services.mozilla.com/D217318
And don't allow new request being associated with existing pending request if
the requests are from different origin.
This patch also set proper principal to nsItransferable for clipboard write in
various cases,
- Copy image via context menu.
- Copy current selection via keyboard shortcut or context menu.
- Data is provided by script when copy operation is triggered via keyboard
shortcut or context menu.
- Clipboard data is put via async clipboard.
Depends on D190761
Differential Revision: https://phabricator.services.mozilla.com/D190796
And don't allow new request being associated with existing pending request if
the requests are from different origin.
This patch also set proper principal to nsItransferable for clipboard write in
various cases,
- Copy image via context menu.
- Copy current selection via keyboard shortcut or context menu.
- Data is provided by script when copy operation is triggered via keyboard
shortcut or context menu.
- Clipboard data is put via async clipboard.
Depends on D190761
Differential Revision: https://phabricator.services.mozilla.com/D190796
I was going to write an automated test but turns out that some of this
became much harder to test after bug 582459 :-(
Let me know if you want me to take a look at writing a browser test
(since I think otherwise we can't test this, we need to move focus
outside of the active tab).
Differential Revision: https://phabricator.services.mozilla.com/D178825
It's hard to check Selection API calls from both JS and internals when we debug
web apps which has complicated `contenteditable` editor. Therefore, I'd like to
add an ability to log Selection API calls.
This patch needs to stop some methods inlined. Therefore, this could affect to
the performance in release builds, though. If so, I need to work on some
optimization later.
For minimizing the impact for performance, this patch also makes them to check
the logging level before calling logging methods. It's currently redundant
for `LogLevel::Info` case. However, this avoids any performance impact from
changes of `MOZ_LOG` implementation and in the blocks.
Differential Revision: https://phabricator.services.mozilla.com/D170585