Commit Graph

1690 Commits

Author SHA1 Message Date
Tom Schuster
e454809e2e Bug 571074 - Mark nsITransferable.getTransferData as [must_use]. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D13454
2018-11-29 21:57:40 +00:00
Kyle Machulis
f293508546 Bug 1505601 - Turn nsIDocShell XPIDL const lists into cenums; r=bzbarsky
Turn all const lists and related attributes into cenums, to provide a
vague sense of type safety.

Depends on D11715

Differential Revision: https://phabricator.services.mozilla.com/D11716
2018-11-28 03:30:56 +00:00
Razvan Maries
a15e46aa68 Merge mozilla-central to autoland. a=merge on a CLOSED TREE 2018-11-27 19:35:52 +02:00
Razvan Maries
159367c3fe Merge mozilla-inbound to mozilla-central a=merge 2018-11-27 19:32:31 +02:00
Emilio Cobos Álvarez
47807eb30a Bug 1505887 - Make CanCallerAccess(nsINode*) know about chromeonly content. r=bz
Differential Revision: https://phabricator.services.mozilla.com/D11409
2018-11-27 13:26:19 +01:00
Razvan Maries
15d8f89dca Backed out 4 changesets (bug 1505887, bug 1509989) for failing crashtests on tests/layout/style/crashtests/1509989.html on a CLOSED TREE.
Backed out changeset dc6c022e9fe1 (bug 1509989)
Backed out changeset 490a99122a7f (bug 1505887)
Backed out changeset 7b9afff4ff11 (bug 1505887)
Backed out changeset 15da6e919d80 (bug 1505887)
2018-11-27 14:10:30 +02:00
Ehsan Akhgari
6d06c0bc8f Bug 1508472 - Part 1: First batch of comment fix-ups in preparation for the tree reformat r=sylvestre
This is a best effort attempt at ensuring that the adverse impact of
reformatting the entire tree over the comments would be minimal.  I've used a
combination of strategies including disabling of formatting, some manual
formatting and some changes to formatting to work around some clang-format
limitations.

Differential Revision: https://phabricator.services.mozilla.com/D13046
2018-11-27 10:08:58 +00:00
Ehsan Akhgari
21592b8fdc Bug 1508044 - Part 3: Ensure that the third-party checks performed on channels in nsContentUtils::IsThirdPartyWindowOrChannel() follow the same logic as those performed in nsChannelClassifier r=francois
Depends on D12852

Differential Revision: https://phabricator.services.mozilla.com/D12853
2018-11-27 00:43:20 +00:00
Ehsan Akhgari
232cc78f09 Bug 1508044 - Part 2: Check the return values of mozIThirdPartyUtil::IsThirdPartyFoo() in nsContentUtils::IsThirdPartyWindowOrChannel() r=francois
Differential Revision: https://phabricator.services.mozilla.com/D12852
2018-11-27 00:38:52 +00:00
Boris Zbarsky
a16438afe4 Bug 1509101. Stop passing around anchor targets as char16_t*; use nsAString instead. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D12579
2018-11-21 18:53:39 +00:00
Ehsan Akhgari
97654a3b91 Bug 1509691 - Ensure that the antitracking backend uses the channel third-party tracking flag r=baku
This makes a difference for doubly nested trackers that are embedded
under the same top-level tracker, with a third-party origin in the
middle, as the test case in this commit has set up things.

The test case here fails without the code changes.

Differential Revision: https://phabricator.services.mozilla.com/D12855
2018-11-27 08:59:09 +00:00
Masayuki Nakano
54492886fc Bug 1504911 - part 4: Make all script for web content dispatch "input" event with proper event interface r=smaug
Currently, some "input" event dispatchers in our script dispatch "input" event
with UIEvent.  This is completely wrong.  For conforming to HTML spec, Event
is proper event.  Additionally, for conforming to Input Events, InputEvent
is proper event only on <textarea> or <input> element which has a single line
editor.

For making us to maintain easier, this patch adds new API, "isInputEventTarget"
to MozEditableElement which returns true when "input" event dispatcher should
use InputEvent for the input element.

Finally, this makes some dispatchers use setUserInput() instead of
setting value and dispatching event by themselves.  This also makes
us to maintain them easier.

Note that this does not touch "input" event dispatchers which dispatch events
only for chrome (such as URL bar, some pages in about: scheme) for making
this change safer as far as possible.

Differential Revision: https://phabricator.services.mozilla.com/D12247
2018-11-20 14:35:38 +00:00
Masayuki Nakano
8496847b12 Bug 1504911 - part 1: Make all "input" event dispatcher in C++ use new utility method r=smaug
Currently, a lot of code dispatch "input" event and some of them dispatch
"input" event with wrong interface and/or values.  Therefore this patch
creates nsContentUtils::DispatchInputEvent() to make all of them dispatch
correct event.

Unfortunately, due to bug 1506439, we cannot set pointer to refcountable
classes of MOZ_CAN_RUN_SCRIPT method to nullptr.  Therefore, this patch
creates temporary RefPtr<TextEditor> a lot even though it makes damage to
the performance if it's in a hot path.

This patch makes eEditorInput event dispatched with
InternalEditorInputEvent when "input" event should be dispatched with
dom::InputEvent.  However, this patch uses WidgetEvent whose message is
eUnidentifiedEvent and setting WidgetEvent::mSpecifiedEventType to
nsGkAtoms::oninput when "input" event should be dispatched with
dom::Event because we need to keep that eEditorInput and
InternalEditorInputEvent are mapped each other.

Differential Revision: https://phabricator.services.mozilla.com/D12244
2018-11-21 03:59:02 +00:00
Emilio Cobos Álvarez
fe07014831 Bug 1505887 - Make CanCallerAccess(nsINode*) know about chromeonly content. r=bz
Differential Revision: https://phabricator.services.mozilla.com/D11409
2018-11-27 11:40:41 +01:00
Ehsan Akhgari
55a9571fd5 Bug 1506947 - Part 1: Add a pref for site-specific workarounds for blocking cookies from trackers; r=francois
Differential Revision: https://phabricator.services.mozilla.com/D11979
2018-11-20 23:00:30 -05:00
Tom Schuster
4aff127bcd Bug 1493292 - Remove aDataLen parameters from nsITransferable.setTransferData. r=smaug
Depends on D11201

Differential Revision: https://phabricator.services.mozilla.com/D11202
2018-11-20 17:00:09 +00:00
Tom Schuster
8b2f90e93c Bug 1493292 - Remove aDataLen parameters from nsITransferable.getTransferData. r=smaug
Depends on D11200

Differential Revision: https://phabricator.services.mozilla.com/D11201
2018-11-20 16:59:56 +00:00
Csoregi Natalia
5ada471f97 Backed out 6 changesets (bug 1493292) for bustage on /nsTransferable.cpp. CLOSED TREE
Backed out changeset f198bf91320b (bug 1493292)
Backed out changeset 6487aa307123 (bug 1493292)
Backed out changeset f2cabd69c568 (bug 1493292)
Backed out changeset 71430fceb4a3 (bug 1493292)
Backed out changeset 3a9b6d65d8c7 (bug 1493292)
Backed out changeset 55769869037c (bug 1493292)
2018-11-20 17:13:18 +02:00
Tom Schuster
f500ae50a9 Bug 1493292 - Remove aDataLen parameters from nsITransferable.setTransferData. r=smaug
Depends on D11201

Differential Revision: https://phabricator.services.mozilla.com/D11202
2018-11-20 14:47:04 +00:00
Tom Schuster
e294f7e628 Bug 1493292 - Remove aDataLen parameters from nsITransferable.getTransferData. r=smaug
Depends on D11200

Differential Revision: https://phabricator.services.mozilla.com/D11201
2018-11-20 14:47:02 +00:00
Ehsan Akhgari
0b6dceed64 Bug 1504728 - Part 1: Add a content blocking notification for indicating when a top-level page is using cookies or site data r=baku,valentin,johannh
Differential Revision: https://phabricator.services.mozilla.com/D11122
2018-11-20 14:34:49 +00:00
Boris Zbarsky
e808e8154d Bug 1507540 part 7. Use notxpcom more in dom/. r=mccr8 2018-11-19 20:20:17 -05:00
Boris Zbarsky
685b646fa2 Bug 1507540 part 2. Use more notxpcom attributes in docshell/. r=smaug 2018-11-19 20:17:53 -05:00
Narcis Beleuzu
6e37dfa8f9 Backed out 2 changesets (bug 1504728, bug 1505198) for xpcshell failures on test_WebExtensionContentScript.js. CLOSED TREE
Backed out changeset 26318538f077 (bug 1505198)
Backed out changeset fc39602006be (bug 1504728)
2018-11-16 02:34:15 +02:00
Ehsan Akhgari
9d1220d4e7 Bug 1504728 - Part 1: Add a content blocking notification for indicating when a top-level page is using cookies or site data r=baku,valentin,johannh
Differential Revision: https://phabricator.services.mozilla.com/D11122
2018-11-14 17:19:25 +00:00
Timothy Guan-tin Chien
fb30ec3de3 Bug 1503019 - Part II, Remove dom.webcomponents.customelements.enabled pref r=smaug
This patch removes the following functions:

* nsContentUtils::IsCustomElementsEnabled()
* CustomElementRegistry::IsCustomElementEnabled(JSContext* aCx, JSObject* aObject)
* CustomElementRegistry::IsCustomElementEnabled(nsIDocument* aDoc)

and all references of the pref.

Depends on D11183

Differential Revision: https://phabricator.services.mozilla.com/D11249
2018-11-15 06:52:01 +00:00
Timothy Guan-tin Chien
2a63ce2955 Bug 1503019 - Part I, Remove dom.webcomponents.shadowdom.enabled r=smaug
This patch removes the dom.webcomponents.shadowdom.enabled pref and all its
references, including the following functions:

* nsContentUtils::IsShadowDOMEnabled()
* nsIDocument::IsShadowDOMEnabled()
* nsDocument::IsShadowDOMEnabled(JSContext* aCx, JSObject* aGlobal)
* nsDocument::IsShadowDOMEnabled(const nsINode* aNode)
* nsTextNode::IsShadowDOMEnabled(JSContext* aCx, JSObject* aObject)

This function is renamed and updated to nsDocument::IsCallerChromeOrAddon():

* nsDocument::IsShadowDOMEnabledAndCallerIsChromeOrAddon(JSContext* aCx, JSObject* aObject)

I didn't change the tests that load Shadow DOM tests in an iframe, in the interest of keeping hg annotation history.

Differential Revision: https://phabricator.services.mozilla.com/D11183
2018-11-15 06:51:07 +00:00
Ehsan Akhgari
367c98c425 Bug 1507058 - Compare the strings in nsContentUtils::IsURIInPrefList() case insensitively r=baku
Differential Revision: https://phabricator.services.mozilla.com/D11846
2018-11-14 18:45:59 +00:00
Andreea Pavel
f667cd7449 Backed out 2 changesets (bug 1503019) for failing crashtests at dom/base/crashtests/1505811.html on a CLOSED TREE
Backed out changeset 06b12fd41ff1 (bug 1503019)
Backed out changeset 7b845eac9dd7 (bug 1503019)
2018-11-15 01:52:30 +02:00
Timothy Guan-tin Chien
3e86e5f53e Bug 1503019 - Part II, Remove dom.webcomponents.customelements.enabled pref r=smaug
This patch removes the following functions:

* nsContentUtils::IsCustomElementsEnabled()
* CustomElementRegistry::IsCustomElementEnabled(JSContext* aCx, JSObject* aObject)
* CustomElementRegistry::IsCustomElementEnabled(nsIDocument* aDoc)

and all references of the pref.

Depends on D11183

Differential Revision: https://phabricator.services.mozilla.com/D11249
2018-11-14 19:37:42 +00:00
Timothy Guan-tin Chien
0644cf5b9d Bug 1503019 - Part I, Remove dom.webcomponents.shadowdom.enabled r=smaug
This patch removes the dom.webcomponents.shadowdom.enabled pref and all its
references, including the following functions:

* nsContentUtils::IsShadowDOMEnabled()
* nsIDocument::IsShadowDOMEnabled()
* nsDocument::IsShadowDOMEnabled(JSContext* aCx, JSObject* aGlobal)
* nsDocument::IsShadowDOMEnabled(const nsINode* aNode)
* nsTextNode::IsShadowDOMEnabled(JSContext* aCx, JSObject* aObject)

This function is renamed and updated to nsDocument::IsCallerChromeOrAddon():

* nsDocument::IsShadowDOMEnabledAndCallerIsChromeOrAddon(JSContext* aCx, JSObject* aObject)

I didn't change the tests that load Shadow DOM tests in an iframe, in the interest of keeping hg annotation history.

Differential Revision: https://phabricator.services.mozilla.com/D11183
2018-11-14 19:34:52 +00:00
Boris Zbarsky
54f661b2d3 Bug 1505811. Don't leave exceptions dangling on the JSContext when regexp execution fails during HTML input pattern matching. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D11818
2018-11-14 18:48:34 +00:00
Jonathan Kingston
ef72c7fa98 Bug 1483815 - Implement stricter CORS checking for headers. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D11648
2018-11-14 11:45:46 +00:00
Andrea Marchesini
ffaa03d443 Bug 1505212 - Partitioned localStorage for 3rd party tracker pages, r=ehsan, r=asuth
LocalStorage needs to be exposed in every context except for sandboxes and
NullPrincipals (data: URLs, for instance). But we need to keep data
separate in some scenarios: private-browsing and trackers.
In private-browsing, LocalStorage keeps data in memory, and it shares
StorageEvents just with other origins in the same private-browsing
environment.
For Trackers, we expose a partitioned LocalStorage, which doesn't share
data with other contexts, and it's just in memory. Partitioned localStorage
is available only for trackers listed in the
privacy.restrict3rdpartystorage.partitionedHosts pref. See
nsContentUtils::IsURIInPrefList to know the syntax for the pref value.
2018-11-13 09:51:14 +01:00
Dorel Luca
c4f8caba67 Backed out changeset 365e0d2414bf (bug 1504728) for browser-chrome failures. CLOSED TREE 2018-11-09 18:48:39 +02:00
Ehsan Akhgari
75f342fb34 Bug 1504728 - Add a content blocking notification for indicating when a top-level page is using cookies or site data r=baku,valentin
Differential Revision: https://phabricator.services.mozilla.com/D11122
2018-11-09 15:36:02 +00:00
Ehsan Akhgari
ec4bc6f227 Bug 1504574 - Remove the XPCOM registration for nsDocumentEncoder; r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D10856
2018-11-05 23:16:04 -05:00
Kris Maglione
87a66e6f27 Bug 1356412: Part 2 - Remove script loader path mangling from DOM code. r=bz
As in part 1, this no longer serves any purpose.

This patch also removes the otherwise unused WrappersEnabled() method, which
was similarly only useful before we had compartment-based security isolation.
Its functionality is now handled by compartment flags.

Differential Revision: https://phabricator.services.mozilla.com/D10796
2018-11-02 16:15:26 -07:00
Timothy Guan-tin Chien
e665860c8d Bug 1496242 - Part II, Convert datetimebox to UA Widget r=dholbert,jaws,smaug
This patch converts datetimebox.xml to datetimebox.js and loads it as a UA Widget,
while touches things here and there to make it work.

In HTMLInputElement manages the lifecycle of the datetimebox UA Widget.
It is loaded when in <input> has type date or time, or have its type switch to date or time.

nsDateTimeControlFrame is changed so that when UA Widget is enabled,
it would not generate <xul:datetimebox>.

Like bug 1483972, a check is added in nsCSSFrameConstructor::CreateGeneratedContentItem()
to make sure we don't generate pseudo content inside <input>.

Assertions in IntlUtils is changed to allow UAWidget to call the methods.

Depends on D9056

Differential Revision: https://phabricator.services.mozilla.com/D9057
2018-11-03 05:31:05 +00:00
Emilio Cobos Álvarez
e86a54ad5a Bug 1489858 - Simplify a bit the conditional. r=smaug 2018-11-02 22:45:31 +01:00
Emilio Cobos Álvarez
1f7599f27a Bug 1489858 - Disable mutation events on shadow trees. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D10747
2018-11-02 20:53:34 +00:00
Matt Woodrow
450dfe2e38 Bug 1464632 - Add the option to explicitly cache the internal results of nsContentUtils::ComparePoints since nsRange::IsNodeSelected calls it repeatedly with the same value and we don't want to pollute the internal caching of nsINode... r=mats
...::ComputeIndexOf. r?mats

MozReview-Commit-ID: HKFmy1QeCs6

Differential Revision: https://phabricator.services.mozilla.com/D10138
2018-10-30 22:28:34 +00:00
Nika Layzell
70dd9e5996 Bug 1500011 - Use CheckedInt more in CalculateBufferSizeForImage, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D9145
2018-10-22 20:37:06 -04:00
Cameron McCormack
170191a2b6 Bug 1495984 - Make css::URLValue::IsLocalRef call into CssUrlData::is_fragment. r=emilio
This fixes the issue that we should no longer be looking for control characters.



MozReview-Commit-ID: 8k89Aheq3NY

Differential Revision: https://phabricator.services.mozilla.com/D8876
2018-10-17 09:43:45 +00:00
Diego Pino Garcia
395c3d8ad4 Bug 734063 - Remove the multicol element from nsContentUtils::IsHTMLBlock r=hsivonen 2018-10-12 12:59:00 +03:00
Tom Schuster
8e820b5c01 Bug 1497831 - Use nsTArray instead of nsIArray for nsITransferable. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D8194
2018-10-10 20:25:54 +00:00
Neil Deakin
117d5b55bb Bug 1310193 - Remove wrapping of nsISupports as nsISupportsInterfacePointer in transferables. r=smaug 2018-10-07 16:33:07 +02:00
Nicholas Nethercote
325d491a33 Bug 1451169 - Use nsStaticAtom* instead of nsStaticAtom** in Element.h. r=baku 2018-04-03 13:21:06 +10:00
Emilio Cobos Álvarez
a1abfb45c7 Bug 1493222 - Expose InspectorUtils to fuzzers. r=bzbarsky
I can be more granular if we want, by adding more ChromeOnly annotations for the
functions that we don't want to expose.

Differential Revision: https://phabricator.services.mozilla.com/D6530
2018-09-27 19:00:33 +00:00
Emilio Cobos Álvarez
850464117c Bug 1484285 - Avoid loading XBL bindings for stuff that is very likely to be a custom-element. r=smaug
This should be more generic than hardcoding the tags, and be enough for our
chrome to avoid regressions as they migrate more stuff to CE, avoiding calling
into the GetComputedStyle machinery..

Differential Revision: https://phabricator.services.mozilla.com/D6537
2018-09-21 21:29:25 +00:00