Commit Graph

16597 Commits

Author SHA1 Message Date
Ehsan Akhgari
7c156959da Bug 1476796 - Enable AntiTrackingCommon::AddFirstPartyStorageAccessGrantedFor() to notify consumers about completion of asynchronous results; r=baku
Right now consumers can't know when the parent process has finished talking
to the permission manager.  It would be nice to enable consumers to depend
on the status of the asynchronous task using a promise.
2018-07-19 16:20:20 -04:00
Jed Davis
96c18b6c4a Bug 1467889 - Adjust some uses of XPCOM strings. r=mrbkap r=mstange
MozReview-Commit-ID: 5AG4WAmbLZz
2018-07-19 14:14:50 -06:00
Neil Deakin
0cc9fd046c Bug 1461742, add a mechanism so that custom elements can implement interfaces akin to XBL implements. This is accomplished by an additional chrome-only callback getCustomInterface that can be implemented by custom elements, r=bz 2018-07-19 08:38:45 -04:00
Andrea Marchesini
c3238135af Bug 1476612 - AntiTracking should use nsIDocument::Get/SetUserHasInteracted instead of UserGestureActivation, r=cpearce 2018-07-19 13:14:27 +02:00
Csoregi Natalia
143b18ba60 Backed out 2 changesets (bug 1461742) for build bustage on CustomElementRegistry.cpp:97. CLOSED TREE
Backed out changeset ca5415dbc51a (bug 1461742)
Backed out changeset 30bd77de7bf5 (bug 1461742)
2018-07-19 13:36:31 +03:00
Neil Deakin
c2c722be92 Bug 1461742, add a mechanism so that custom elements can implement interfaces akin to XBL implements. This is accomplished by an additional chrome-only callback getCustomInterface that can be implemented by custom elements, r=bz 2018-07-19 06:15:26 -04:00
Gurzau Raul
8a871a6c46 Merge inbound to mozilla-central. a=merge 2018-07-19 12:54:18 +03:00
Nicholas Nethercote
3c181ba385 No bug - Remove unused PLHashEntry and PLHashTable forward declarations. r=glandium
The uses of these types were removed in bug 1442480.

--HG--
extra : rebase_source : 55a1fbdbd0003ebce89db4f5e9c62cb1aea0d60a
2018-07-19 16:31:03 +10:00
Paolo Amadini
dc49387df8 Bug 1472555 - Part 5 - Remove the listbox layout. r=bz,surkov
MozReview-Commit-ID: Bx1p1nTurCz

--HG--
extra : rebase_source : 6910e500f30eb42b45032dbab85a3dc9c014390b
2018-07-18 11:23:32 +01:00
Andrea Marchesini
e9d8f213e0 Bug 1476324 - Storage activation via window.open(URL) applies across top-level domains - part 1 - window.open() from top-level, r=ehsan 2018-07-18 15:44:55 +02:00
Emilio Cobos Álvarez
243930608d Bug 1309752: Cleanup might_need_transitions_update. r=birtles
Thought I had to update this as well, but nope. When basically any style changes
we already update transitions.

needs_transitions_update already handles the physical mapping changing by
checking whether any transition for the physical property remain there or not.

MozReview-Commit-ID: 6vKwal4yzRU
2018-07-18 12:10:19 +02:00
Margareta Eliza Balazs
fb3762edac Merge inbound to mozilla-central. a=merge 2018-07-18 12:33:29 +03:00
Anny Gakhokidze
f7f703b0e1 Bug 1473161 - Add missing bound check in nsContentUtils::DataTransferItemToImage. r=nika
MozReview-Commit-ID: 3dq5yWZwJiG
2018-07-17 19:02:51 -04:00
Tiberius Oros
d701ae940f Merge inbound to mozilla-central. a=merge 2018-07-18 00:55:33 +03:00
Brian Birtles
8ab6ee61ba Bug 1471814 - Add a preference for {Document,Element}.getAnimations(); r=bz,hiro
This is probably the last thing we will ship since it needs the most spec work.

MozReview-Commit-ID: LLmDBLCsCBJ

--HG--
extra : rebase_source : c06752c9201a9ede87e1ac200ab12577bf784ce6
2018-07-14 09:23:03 +09:00
Brian Birtles
fc657410ff Bug 1471814 - Add a preference for implicit keyframes; r=bz,hiro
This preference controls whether authors are allowed to specify animations
without a 0% or 100% keyframe.

We intend to ship this soon but this preference acts as a safeguard in case we
discover we need to disable it.

This feature is very convenient and commonly used so this patch ensures it is
always enabled for system content.

MozReview-Commit-ID: BHTsuS2xO61

--HG--
rename : dom/animation/test/mozilla/file_disable_animations_api_core.html => dom/animation/test/mozilla/file_disable_animations_api_implicit_keyframes.html
rename : dom/animation/test/mozilla/test_disable_animations_api_core.html => dom/animation/test/mozilla/test_disable_animations_api_implicit_keyframes.html
extra : rebase_source : 04fd93dd26a4765c14b0b22febdb0311b650ea59
2018-07-14 09:23:03 +09:00
Brian Birtles
5d13151cb9 Bug 1471814 - Add a preference for Web Animations timelines; r=bz,hiro
We don't intend to ship this in the near future until the integration with
AnimationWorklet is clear (although we might ship a read-only version).

That said, we use this feature extensively internally (e.g. in DevTools etc.) so
we enable this feature for system callers.

MozReview-Commit-ID: AhB7ZmU1Xzw

--HG--
extra : rebase_source : 630d7dc56b44a9261bb34aa5417cb9b7050efba4
2018-07-14 09:23:03 +09:00
Margareta Eliza Balazs
ad89a11136 Backed out 7 changesets (bug 1475228) for causing Spidermonkey rust failures on Linux x64 debug
Backed out changeset e91802969fb7 (bug 1475228)
Backed out changeset 623af73419eb (bug 1475228)
Backed out changeset bf96bd78dc11 (bug 1475228)
Backed out changeset 104817d51d1b (bug 1475228)
Backed out changeset d3829c85f650 (bug 1475228)
Backed out changeset 74d10b32b3ea (bug 1475228)
Backed out changeset dde64fbe2f0d (bug 1475228)
2018-07-17 17:57:55 +03:00
Ehsan Akhgari
16d186f4ec Bug 1475697 - Part 3: Update the security UI when blocking 3rd party cookies from trackers; r=baku 2018-07-17 06:12:00 +03:00
Ehsan Akhgari
ac25ec44da Bug 1475697 - Part 2: Add infrastructure for notifying the DOM about a document containing blocked tracking cookies; r=baku 2018-07-17 06:12:00 +03:00
Ehsan Akhgari
51cc2694b0 Bug 1475697 - Part 1: Refactor the current way that Necko notifies DOM about the existence of blocked content; r=baku 2018-07-17 06:11:00 +03:00
Jon Coppeard
4bf9e8dfe9 Bug 1475228 - Make synchronous compile APIs take SourceBufferHolders exclusively r=jandem 2018-07-17 14:30:22 +01:00
Kris Maglione
5764d2a51d Bug 1473631: Part 12 - Replace pref observers with callbacks in nsNameSpaceManager. r=njn
MozReview-Commit-ID: 1RxEYL5LKjy

--HG--
extra : rebase_source : 8e491fe2ea3d074844ff349b9cce97a2f24573a7
2018-07-05 15:07:12 -07:00
Kris Maglione
a16a23e56f Bug 1473631: Part 4 - Replace pref observers with callbacks in FocusManager. r=njn
MozReview-Commit-ID: 533Qz2nIkmX

--HG--
extra : rebase_source : 71e32db787b150b8ef3cee3163953c0adb893c92
2018-07-05 13:36:07 -07:00
Kris Maglione
8d585408dc Bug 1473631: Part 0b - Add helper for registering instance methods as pref callbacks. r=njn
I also tried to avoid this change but, again, given the number of times I was
repeating the same pattern of defining a static method just to forward a
callback to an instance method, decided it was probably necessary. Without an
easy way to do this, people are more likely to register observers rather than
callbacks, for which we'll wind up paying a continued memory and performance
penalty.

This patch adds a helper which creates a type-safe preference callback
function which forwards calls to an instance method on its closure object.

The implementation is somewhat complicated, mainly due to the constraint that
unregistering a callback requires passing the exact same function pointer that
was used to register it. The patch achieves this by creating the callback
function as a template, with the method pointer as a template parameter. As
long as the Register and Unregister calls happen in the same translation unit,
the same template instance is guaranteed to be used for both.

The main difficulty is that, until C++ 17, there's no way match a value as a
template parameter unless you know its complete type, or can at least compute
its complete type based on earlier template parameters. That means that we
need a macro to extract the type of the method, and construct the template
with the full set of explicit parameters.

MozReview-Commit-ID: 10N3R2SRtPc

--HG--
extra : rebase_source : 7d0a8ddeb77e01d4a6f421459514e93bc0875598
2018-07-13 18:54:11 -07:00
Kris Maglione
0bfdb4329f Bug 1473631: Part 0a - Make preference callbacks typesafe. r=njn
I initially tried to avoid this, but decided it was necessary given the number
of times I had to repeat the same pattern of casting a variable to void*, and
then casting it back in a part of code far distant from the original type.

This changes our preference callback registration functions to match the type
of the callback's closure argument to the actual type of the closure pointer
passed, and then casting it to the type of our generic callback function. This
ensures that the callback function always gets an argument of the type it's
actually expecting without adding any additional runtime memory or
QueryInterface overhead for tracking it.

MozReview-Commit-ID: 9tLKBe10ddP

--HG--
extra : rebase_source : 7524fa8dcd5585f5a31fdeb37d95714f1bb94922
2018-07-06 12:24:41 -07:00
Kris Maglione
1751fb7124 Bug 1473634: Part 2 - Update some callers to use RegisterCallbacks where appropriate. r=njn
MozReview-Commit-ID: IqUmuOeSbNm

--HG--
extra : rebase_source : 0c742f6ca29456928f2027dcb70ee6dbb130d1f9
2018-07-04 19:06:57 -07:00
Emilio Cobos Álvarez
0da3dae9c9 Bug 1472403: Simplify generated image content. r=bz,dholbert
This way we reuse the same machinery everywhere for the content property.

The only difference is that we need to look at the parent style for content
instead of just our style, and at a given index.

Again, this is fine because changing content reframes, so no chance to mess up.

This allows the generated content stuff to not implement nsImageLoadingContent
and all that stuff, nor deal with events, which makes it much simpler IMO.

Now it just tracks an index. We may not even need for it to be an HTML element,
but I've kept that for now.

I added a crashtest that used to crash because of the bogus
nsCSSFrameConstructor code which trusted the node name without checking it was
native anonymous.

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

MozReview-Commit-ID: 1pAzIvRRVnL
2018-07-16 18:06:38 +02:00
Andrea Marchesini
ceea0172b0 Bug 1473587 - CSP Violation events should have the correct sample for inline contexts, r=jorendorff, r=ckerschb 2018-07-16 17:58:04 +02:00
Tiberius Oros
d6492ca47e Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-07-18 00:59:21 +03:00
shindli
ba72001f71 Backed out 2 changesets (bug 1473813, bug 1472403) for bustages in /builds/worker/workspace/build/src/dom/base/MessageSender.cpp:24:19 on a CLOSED TREE
Backed out changeset 93e4dff7e346 (bug 1473813)
Backed out changeset 365a0841117a (bug 1472403)
2018-07-16 18:45:33 +03:00
Emilio Cobos Álvarez
966f1a9206 Bug 1472403: Simplify generated image content. r=bz,dholbert
This way we reuse the same machinery everywhere for the content property.

The only difference is that we need to look at the parent style for content
instead of just our style, and at a given index.

Again, this is fine because changing content reframes, so no chance to mess up.

This allows the generated content stuff to not implement nsImageLoadingContent
and all that stuff, nor deal with events, which makes it much simpler IMO.

Now it just tracks an index. We may not even need for it to be an HTML element,
but I've kept that for now.

I added a crashtest that used to crash because of the bogus
nsCSSFrameConstructor code which trusted the node name without checking it was
native anonymous.

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

MozReview-Commit-ID: 1pAzIvRRVnL
2018-07-16 17:30:14 +02:00
Masayuki Nakano
0ed11cb188 Bug 1453629 - nsIWidget::GetNativeIMEContext() should return pseudo IME context if TextInputProcessor has a composition on the widget r=m_kato
Key of TextCompositionArrary to search composition on widget is native IME
context.  However, if TextInputProcessor dispatches composition events via
TextEventDispatcher, TextEventDispatcher::InitEvent() sets native IME context
of dispatching composition events to pseudo IME context (that's raw pointer
of TextEventDispatcher and process ID).

IMEStateManager::DispatchCompositionEvent() looks for existing TextComposition
with native IME context stored in WidgetCompositionEvent before dispatching
an event.  However, after dispatching it, it looks for remaining TextComposition
instance with widget stored in WidgetCompositionEvent.  Then,
TextCompositionArrary::IndexOf(nsIWidget*) will look for an instance with
the result of nsIWidget::GetNativeIMEContext() and this never returns actual
native IME context.  Therefore, IMEStateManager::DispatchCompositionEvent()
always fails to remove TextComposition instance from the array even after
a test composition is finished.

This patch moves nsIWidget::GetNativeIMEContext() to nsBaseWidget to refer
nsBaseWidget::mTextEventDispatcher makes it return pseudo IME context if
TextInputProcessor has input transaction.  Therefore, IMEStateManager becomes
always removes TextComposition from the array when every composition ends.

MozReview-Commit-ID: H1PCtPjBYJR

--HG--
extra : rebase_source : cbb3f3aae9954d65135d3840be8974fa30c4f7ff
2018-07-17 22:31:51 +09:00
Andrea Marchesini
4e97b69ebf Bug 1476306 - Moving NullPrincipal/ContentPrincipal/SystemPrincipal under mozilla namespace - part 3 - ContentPrincipal, r=ckerschb 2018-07-17 21:38:48 +02:00
Andrea Marchesini
a053cf1c15 Bug 1476306 - Moving NullPrincipal/ContentPrincipal/SystemPrincipal under mozilla namespace - part 1 - NullPrincipal, r=ckerschb 2018-07-17 21:37:48 +02:00
Emilio Cobos Álvarez
de1504e650 Bug 1475351: Properly clear associated ShadowRoot from StyleSheet objects. r=smaug
Just like we do from the document's destructor.

MozReview-Commit-ID: DygmZ0EI9es
2018-07-15 12:37:44 +02:00
Emilio Cobos Álvarez
dea0d7ad83 Backed out changeset e0841c88d3ae (bug 1474466) for landing with the wrong bug number. r=me 2018-07-15 12:36:07 +02:00
Emilio Cobos Álvarez
cadda9e720 Bug 1474466: Properly clear associated ShadowRoot from StyleSheet objects. r=smaug
Just like we do from the document's destructor.

MozReview-Commit-ID: DygmZ0EI9es
2018-07-15 12:27:05 +02:00
Ciure Andrei
14976cd6b3 Merge inbound to mozilla-central. a=merge 2018-07-15 12:52:50 +03:00
Olli Pettay
de99e4460b Bug 1439153 - Make WebExtensions work with Shadow DOM/WebComponents, r=kmag
--HG--
extra : rebase_source : 83638cba42eea1523d32d06a2eb14df20cbab404
2018-07-14 05:26:15 +03:00
Chris Pearce
848dee9a6f Bug 1472580 - Ensure we always get a allow/cancel response to an autoplay media permission request. r=smaug
The front end code can't always guarantee to give us an allow/cancel response
to a permission request. In particular in these cases:
* if we close a tab while showing a doorhanger, or
* if we navigate a tab while showing a doorhanger, or
* if the permission prompt requested in a background tab and never shown.

Handling all of these cases is problematic; we don't get events for all of
these where it's easy and cheap to determine that we should cancel the
permission request.

Canceling the permission request is important in the autoplay-media permission
request case as there's objects waiting on the resolution of the permission
request, and they leak in ASan builds while running chrome tests if the Gecko
size of the permission request doesn't get a notification telling it to stop
waiting.

But we can however rely on the doorhanger code to drop its reference to the
nsIContentPermissionRequest object that we pass to it when the doorhanger goes
away. So we can cancel the permission request in our
nsIContentPermissionRequest's implementation's destructor in order to easily
catch all the above cases.

In order to do that, we need to split AutoplayRequest into two; one part being
the implementation of nsIContentPermissionRequest (AutoplayPermissionRequest),
and the other part being the code to own the PromiseHolder and manage the
permission request (AutoplayPermissionManager).

AutoplayPermissionRequest keeps a weak reference to AutoplayPermissionManager,
so that it can tell the AutoplayPermissionManager to reject the request promise
when it's destroyed.

This fixes the ASan leak for which I got backed out from earlier in this bug,
and also fixes the cases above.

MozReview-Commit-ID: KoVkgIqDleW

--HG--
rename : dom/html/AutoplayRequest.cpp => dom/html/AutoplayPermissionManager.cpp
rename : dom/html/AutoplayRequest.h => dom/html/AutoplayPermissionManager.h
extra : rebase_source : dbca520a93d8c416f6d64c2da027630181bb5910
2018-07-06 21:15:20 +12:00
Boris Zbarsky
3546ea99f1 Bug 1475065 part 13. Remove nsIDOMOfflineResourceList. r=nika 2018-07-13 15:42:08 -07:00
Boris Zbarsky
c360173249 Bug 1475065 part 12. Stop using nsIDOMOfflineResourceList in bindings. r=nika 2018-07-13 15:42:07 -07:00
Noemi Erli
9793ca2da4 Merge inbound to mozilla-central. a=merge 2018-07-14 00:52:51 +03:00
Andrea Marchesini
1498612e1b Bug 1474812 - No needs to store granted storage access in nsILoadInfo and in the inner window, r=ehsan 2018-07-13 12:02:19 +02:00
Margareta Eliza Balazs
448f792f96 Merge inbound to mozilla-central. a=merge 2018-07-13 11:52:00 +03:00
Andrea Marchesini
bc5414c5f3 Bug 1471189 - Removing 'Terminating' state in workers, r=mrbkap 2018-07-12 19:33:41 +02:00
Masayuki Nakano
7581aff013 Bug 1450882 - part 4: Make C++ users of nsICommandParams use nsCommandParams directly r=Ehsan
nsICommandParams is implemented only by nsCommandParams.  So, all C++ users
can treat all instances of nsICommandParams as nsCommandParams.  Therefore,
this patch makes all set/get value calls use non-virtual methods and all
constructors directly create nsCommandParams instance.

MozReview-Commit-ID: CscgK0gKp5g

--HG--
extra : rebase_source : 62eb0f60aada795a44cf5496cdafbff6cba80013
2018-07-10 20:04:21 +09:00
Masayuki Nakano
5a2332692a Bug 1450882 - part 2: Make nsICommandParams::GetCStringValue() and nsICommandParams::SetCStringValue() treat nsACString instead of char r=Ehsan
nsICommandParams::GetCStringValue() and nsICommandParams::SetCStringValue()
treat char.  However, this makes their callers complicated.  So, they should
be rewritten as treating nsACString.

MozReview-Commit-ID: DWO9veSyzyG

--HG--
extra : rebase_source : fbea13f6d7116ea1887434c0842b7768a7dc59ec
2018-07-10 18:04:46 +09:00
Brian Birtles
a2a2e0da37 Bug 1475162 - Drop dom.animations-api.element-animate.enabled pref; r=bz
MozReview-Commit-ID: 5xKS30NmNbL

--HG--
extra : rebase_source : c34e8da8a04bee15d40c719db5e57037899cddd8
2018-07-12 15:56:05 +09:00