Commit Graph

644 Commits

Author SHA1 Message Date
Masayuki Nakano
f3fb0d1af8 Bug 1569613 - Add surrogate pair handling API to nsTextFragment r=hsivonen
We check surrogate pair at specific index in `nsTextFragement` in a lot of
places.  This requires boundary check of the index so that it can cause
security issue and crash reason with simple mistake, and also it steals
your time to understand the code what it does especially when it's a
part of an `if` condition.

Therefore, this patch adds new API to `nsTextFragment` and makes the all
surrogate pair handlers of `nsTextFragument` use new API.

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

--HG--
extra : moz-landing-system : lando
2019-08-06 05:43:21 +00:00
Nicholas Nethercote
0fea42328a Bug 1570212 - Convert dom.allow_XUL_XBL_for_file to a static pref. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D40153

--HG--
extra : moz-landing-system : lando
2019-08-02 11:59:04 +00:00
Alex Catarineu
536fd2e65f Bug 1561322 - Allow spoofing strings in HTML forms r=baku,Pike
When privacy.spoof_english = 2, we should hide the user's
locale in content. So we use en-US default strings for HTML
form elements, such as a Submit button.

We also force GetLocalizedEllipsis() to always return the
ellipsis used by en-US.

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

--HG--
extra : moz-landing-system : lando
2019-07-24 13:22:22 +00:00
Hiroyuki Ikezoe
dfb3239dff Bug 1498729 - Move out nsContentUtils::ProcessViewportInfo. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D38920

--HG--
extra : moz-landing-system : lando
2019-07-25 04:24:08 +00:00
Ciure Andrei
c0756f3389 Backed out 10 changesets (bug 1523638) for causing high frequency Android 7.0 mochitests failures CLOSED TREE
Backed out changeset 644ceb2fe568 (bug 1523638)
Backed out changeset 27647ee7a927 (bug 1523638)
Backed out changeset 96f1ccb95570 (bug 1523638)
Backed out changeset b60a17ea716a (bug 1523638)
Backed out changeset 507e63186c5f (bug 1523638)
Backed out changeset 33255408ca61 (bug 1523638)
Backed out changeset d97b2d223616 (bug 1523638)
Backed out changeset eba2a0514cde (bug 1523638)
Backed out changeset d7065174c5c4 (bug 1523638)
Backed out changeset c21b361e175d (bug 1523638)
2019-07-23 05:13:32 +03:00
Nika Layzell
5dc554280a Bug 1523638 - Part 4: Move NextWindowId logic into nsContentUtils, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D37651

--HG--
extra : moz-landing-system : lando
2019-07-18 19:38:12 +00:00
Masayuki Nakano
aa340cd1c7 Bug 1548389 - part 4: Implement nsContentUtils::GetTextEditorFromAnonymousNodeWithoutCreation() to retrieve TextEditor instance from an anonymous node in HTMLInputElement or HTMLTextAreaElement r=smaug
This method makes the following patches simpler and avoid duplicating same
code.

The utility method retrieves `TextEditor` from `HTMLInputElement` and
`HTMLTextAreaElement`.  However, this won't cause creating corresponding
editor because when it calls from `TextEditor`, editor shouldn't be created
at that time due to requiring another reflow.  Additionally, it's not
necessary for `nsTextFrame` because without `TextEditor`, all characters
in password field should be masked.

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

--HG--
extra : moz-landing-system : lando
2019-07-22 03:54:33 +00:00
Gurzau Raul
a40be3ff67 Merge mozilla-central to autoland. a=merge CLOSED TREE 2019-07-17 06:53:00 +03:00
Bogdan Tara
ca45889546 Backed out 9 changesets (bug 1523638) for browser_contextmenu.js failures CLOSED TREE
Backed out changeset 0a584a07b696 (bug 1523638)
Backed out changeset 8c5af2289900 (bug 1523638)
Backed out changeset 40ed1bd64b09 (bug 1523638)
Backed out changeset 9a99a0391979 (bug 1523638)
Backed out changeset 07fb4748b91a (bug 1523638)
Backed out changeset 49047c3ebae9 (bug 1523638)
Backed out changeset d606d072126c (bug 1523638)
Backed out changeset 76dc1937fc77 (bug 1523638)
Backed out changeset c784c14b5d5d (bug 1523638)
2019-07-16 23:40:47 +03:00
Nika Layzell
4d83ce526b Bug 1523638 - Part 4: Move NextWindowId logic into nsContentUtils, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D37651

--HG--
extra : moz-landing-system : lando
2019-07-16 18:47:41 +00:00
Mirko Brodesser
8135a5859f Bug 1566046: move nsContentUtils::ContentIsShadowIncludingDescendantOf to nsINode::IsShadowIncludingInclusiveDescendantOf. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D38079
2019-07-16 09:25:02 +02:00
Mirko Brodesser
2f40f072ab Bug 1565584: move nsIContentUtils::ContentIsDescendantOf to nsINode::IsInclusiveDescendantOf. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D37880
2019-07-15 10:02:21 +02:00
Thomas Nguyen
fc05893051 Bug 1546334 - Use referrerInfo in style system. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D36478

--HG--
extra : moz-landing-system : lando
2019-07-16 11:43:56 +00:00
Ciure Andrei
f372470e10 Merge inbound to mozilla-central. a=merge 2019-07-10 12:41:47 +03:00
Mirko Brodesser
dce13c6b77 Bug 1564140: add const correctness for some methods in nsContentUtils. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D37278
2019-07-09 09:06:56 +02:00
Alex Catarineu
a8b667f825 Bug 467035 - Avoid leaking browser language via DTD r=Gijs,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D34187

--HG--
extra : moz-landing-system : lando
2019-07-08 10:47:05 +00:00
Alex Catarineu
dbce01f2ff Bug 467035 - Add new internal DTD content types r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D35232

--HG--
extra : moz-landing-system : lando
2019-07-03 17:28:25 +00:00
Emilio Cobos Álvarez
28801c9e84 Bug 1218456 - Allow navigating when there's no pres context. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D37404
2019-07-09 23:07:29 +02:00
Dorel Luca
9925ca654c Backed out 5 changesets (bug 1218456) for Crashtest failures on dom/l10n/tests/mochitest/dom_localization/test_overlay.html. CLOSED TREE
Backed out changeset 31afe89c2d42 (bug 1218456)
Backed out changeset 8bd57ebc4528 (bug 1218456)
Backed out changeset e5d37afff36a (bug 1218456)
Backed out changeset e3da86278ecf (bug 1218456)
Backed out changeset 343046089f8e (bug 1218456)

--HG--
extra : rebase_source : f092d903c8c80581d187493e036b1875d8668b3d
2019-07-09 22:04:13 +03:00
Emilio Cobos Álvarez
d5db3842a0 Bug 1218456 - Allow navigating when there's no pres context. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D37404

--HG--
extra : moz-landing-system : lando
2019-07-09 16:17:27 +00:00
Cameron McCormack
336cad5a55 Bug 1553705 - Make GenerateStateKey() infallible. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D32258

--HG--
extra : moz-landing-system : lando
2019-07-01 07:20:04 +00:00
Narcis Beleuzu
cc10ed7ce5 Backed out 2 changesets (bug 1553705) for causing Bug1562142 . CLOSED TREE
Backed out changeset fbb26a04ec1f (bug 1553705)
Backed out changeset dd6e7c0970d5 (bug 1553705)
2019-06-29 02:39:01 +03:00
Boris Zbarsky
b9289cedad Bug 1560055 part 7. Remove now-unused percentage handling in ParseHTMLInteger. r=mccr8
All callers treat '%' being found the same as not having consumed all the input,
so we can just stop consuming it.

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

--HG--
extra : moz-landing-system : lando
2019-06-28 17:39:52 +00:00
Masayuki Nakano
2a450c5196 Bug 1444847 - part 2: Sort out basic API of nsRange for consistency with coming StaticRange r=smaug
For avoiding confusion between API of `nsRange` and `StaticRange`, I'd like to
rename `nsRange::CreateRange()` to `nsRange::Create()` because
`StaticRange::CreateStaticRange()` is too long name and
`StaticRange::CreateRange()` sounds odd.  This patch renames it and changes
related methods to template methods to avoid runtime cost of temporary
`RawRangeBoundary` instance creation.

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

--HG--
extra : moz-landing-system : lando
2019-06-28 07:47:29 +00:00
Cameron McCormack
98706be760 Bug 1553705 - Make GenerateStateKey() infallible. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D32258

--HG--
extra : moz-landing-system : lando
2019-06-26 21:44:03 +00:00
Jonathan Watt
c327ad117f Bug 1559840. Add a pref to expose the transform getters on the Element interface. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D35208

--HG--
extra : rebase_source : 2910236db53d098fe725a3f8911668432cf02610
2019-06-17 15:51:33 -07:00
Thomas Nguyen
1d636c1d2d Bug 1557636 Use Referrer info in worker and fix sharedworker's wrong referrer r=baku
SharedWorker should use worker's referrer info instead of default value

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

--HG--
extra : moz-landing-system : lando
2019-06-13 20:37:34 +00:00
Andrea Marchesini
9023382549 Bug 1558923 - Remove nsContentUtils::GetThreadSafe{ASCII,UTF8}Origin, r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D34767

--HG--
extra : moz-landing-system : lando
2019-06-13 19:45:52 +00:00
Narcis Beleuzu
8e2da98d46 Backed out 2 changesets (bug 1558923) for mochitest crashes on AssertIsOnMainThread(). CLOSED TREE
Backed out changeset 643de99320a8 (bug 1558923)
Backed out changeset f758b5ccd0c0 (bug 1558923)
2019-06-13 20:59:33 +03:00
Andrea Marchesini
0d82acdb60 Bug 1558923 - Remove nsContentUtils::GetThreadSafe{ASCII,UTF8}Origin, r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D34767

--HG--
extra : moz-landing-system : lando
2019-06-13 16:42:53 +00:00
Noemi Erli
dec16f16c7 Backed out 2 changesets (bug 1558923) for failures in nsContentUtils.cpp
Backed out changeset 12c977801cb2 (bug 1558923)
Backed out changeset d8a688f1b7ce (bug 1558923)
2019-06-13 19:19:05 +03:00
Andrea Marchesini
15529ee673 Bug 1558923 - Remove nsContentUtils::GetThreadSafe{ASCII,UTF8}Origin, r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D34767

--HG--
extra : moz-landing-system : lando
2019-06-13 15:10:58 +00:00
Cosmin Sabou
934be35969 Backed out 2 changesets (bug 1558923) for build bustages on dom/URL.h. CLOSED TREE
Backed out changeset 0bb5857422f2 (bug 1558923)
Backed out changeset d0411a373ace (bug 1558923)
2019-06-13 13:35:54 +03:00
Andrea Marchesini
7f7c7c2ee3 Bug 1558923 - Remove nsContentUtils::GetThreadSafe{ASCII,UTF8}Origin, r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D34767

--HG--
extra : moz-landing-system : lando
2019-06-13 10:19:03 +00:00
Boris Zbarsky
d5a8a4a595 Bug 1557793 part 3. Change the signatures of various nsContentUtils localization methods to play nicer with the new stringbundle API. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D34201

--HG--
extra : moz-landing-system : lando
2019-06-08 21:26:12 +00:00
Ehsan Akhgari
4598c92440 Bug 1557409 - Part 2: Use WorkerPrivate objects to determine whether we should use fingerprinting resistance on worker threads; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D34208

--HG--
extra : moz-landing-system : lando
2019-06-10 19:32:05 +00:00
Masayuki Nakano
e8f3e9e9e0 Bug 1529884 - part 5: Make Document::ExecCommand() use EditorCommand directly as far as possible r=smaug
Most commands are dispatched only when the `document` has `contenteditable` or
in `designMode`.  In such case, command context is considered with the following
order:
1. `HTMLEditor` for the document.
2. `TextEditor` if the document has focus and it has `TextEditor`.
3. Other command controller table associated with window or DocShell.

In the case of #1 and #2, `ExecCommand()` can use `EditorCommand` directly
and we only need to send subject principal to the editor only in these cases.

In the case of #3, we need to fall back to traditional path.  There are 2 paths:
1. If it's "paste" command, handle it with `nsCommandManager` to dispatch
   "paste" event.
2. If it's "cur" or "copy", handle it with `DocShell` to dispatch "cut" or "copy"
   event in the window or focused sub-document.

Note that clipboard "cut" and "copy" commands are special cases.  Only them
were handled by `DocShell` instead of `nsCommandManager`  This difference
caused making active element's `TextEditor` is preferred rather than
`HTMLEditor`.  Although this behavior is better than our traditional behavior
because Chromium works as so.  But for now, we should keep our behavior.

Finally, this patch makes `ExecCommand()` creates `nsCommandParams` instance
since now, `EditorCommand` class can take only necessary parameter without it.

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

--HG--
extra : moz-landing-system : lando
2019-06-10 10:26:04 +00:00
Emilio Cobos Álvarez
b6728cedb7 Bug 1553769 - Have a single way of requesting window focus and switching to a tab. r=NeilDeakin,snorp
Right now there's some duplicated code with the focus manager and the
DOMWindowFocus event.

Android didn't handle the new framefocusrequested event, so the test-cases in
bug 416771 still didn't work there.

I think using the focus manager codepath everywhere is preferable. I confirmed
manually that the stuff that sent DOMWindowFocus events still works as expected
with this patch (i.e., switching to the right tab when you click on a
notification, etc.).

This fixes it so that it works in Fennec, and it sends the focus events right in
GeckoView Example (i.e., we get here[1] properly).

The snippet that Snorp provided on IRC to implement the "bring activity to
front" stuff (`startActivity(getIntent())`) didn't actually work for me, but I
confirmed that the right message is sent when the focus is requested, and that
we get there.

[1]: https://searchfox.org/mozilla-central/rev/952521e6164ddffa3f34bc8cfa5a81afc5b859c4/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java#503

Depends on D32353

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

--HG--
extra : moz-landing-system : lando
2019-06-03 19:42:28 +00:00
Emilio Cobos Álvarez
d143aaa5f3 Bug 1545499 - Remove dead code for threading accelerator state. r=NeilDeakin
It's only moved around, but not actually used anywhere.

I have no idea what this was supposed to control in the past but it doesn't seem
useful to keep it around.

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

--HG--
extra : moz-landing-system : lando
2019-06-03 15:29:06 +00:00
Ehsan Akhgari
98960a9c41 Bug 1554361 - Move the high-level storage access check APIs to mozilla/StorageAccess.h; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D32556

--HG--
extra : moz-landing-system : lando
2019-05-27 14:06:49 +00:00
Ehsan Akhgari
c3f03e82ee Bug 1547813 - Part 5: Introduce StorageAccess::ePartitionForeignOrDeny; r=baku
This StorageAccess code tells callers that they must partition third-party
storage, or deny storage access if that is not possible.

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

--HG--
extra : moz-landing-system : lando
2019-05-25 01:25:37 +00:00
Ehsan Akhgari
e4067ede93 Bug 1547813 - Part 4: Rename StorageAccess::ePartitionedOrDeny to ePartitionTrackersOrDeny; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D29739

--HG--
extra : moz-landing-system : lando
2019-05-25 01:25:35 +00:00
Paul Zuehlcke
4bccc4cede Bug 1428913 - Deny full-screen on right or middle mouse button. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D31481

--HG--
extra : moz-landing-system : lando
2019-05-22 19:16:31 +00:00
Emilio Cobos Álvarez
300ed443b9 Bug 416771 - Allow window.focus() to switch tabs. r=NeilDeakin,dao CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D31643

--HG--
extra : source : 5acccb49a66840b5c2266edfb7a8953878a2a040
extra : histedit_source : 33a19d54114ef5eda00aefb1c997d6dbcfb40501
2019-05-22 17:21:29 +00:00
Bogdan Tara
e34a09a25c Backed out changeset 5acccb49a668 (bug 416771) for gecko decision bustage CLOSED TREE 2019-05-22 20:38:33 +03:00
Emilio Cobos Álvarez
f11ec3db68 Bug 416771 - Allow window.focus() to switch tabs. r=NeilDeakin,dao
Differential Revision: https://phabricator.services.mozilla.com/D31643

--HG--
extra : moz-landing-system : lando
2019-05-22 17:21:29 +00:00
Noemi Erli
6430d23336 Backed out 12 changesets (bug 1547813) for failures in browser_partitionedIndexedDB.js CLOSED TREE
Backed out changeset 98989127264b (bug 1547813)
Backed out changeset f9d790139a26 (bug 1547813)
Backed out changeset a29f58cef022 (bug 1547813)
Backed out changeset c1288949de1c (bug 1547813)
Backed out changeset 8cad4fd197b1 (bug 1547813)
Backed out changeset 807ce59e7e6e (bug 1547813)
Backed out changeset 06943593738c (bug 1547813)
Backed out changeset 4ced8d49ddc3 (bug 1547813)
Backed out changeset 77a040f527e9 (bug 1547813)
Backed out changeset b4651cfaff30 (bug 1547813)
Backed out changeset 279c140a4d71 (bug 1547813)
Backed out changeset 0e0241f3d366 (bug 1547813)
2019-05-09 20:04:16 +03:00
Ehsan Akhgari
2560dad048 Bug 1547813 - Part 5: Introduce StorageAccess::ePartitionForeignOrDeny; r=baku
This StorageAccess code tells callers that they must partition third-party
storage, or deny storage access if that is not possible.

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

--HG--
extra : moz-landing-system : lando
2019-05-09 07:14:34 +00:00
Ehsan Akhgari
1b4236b4ee Bug 1547813 - Part 4: Rename StorageAccess::ePartitionedOrDeny to ePartitionTrackersOrDeny; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D29739

--HG--
extra : moz-landing-system : lando
2019-05-08 19:37:52 +00:00
Boris Chiou
6521583602 Bug 1545239 - Move GetNodeDepth into ResizeObserver.cpp r=dholbert
GetNodeDepth() is a special version for ResizeObserver to get the depth
of node (across Shadow DOM). Based on the comment in D27615, it's better
to move it into ResizeObserver.cpp.

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

--HG--
extra : moz-landing-system : lando
2019-05-08 20:52:51 +00:00