Commit Graph

620 Commits

Author SHA1 Message Date
Kris Maglione
60d080b412 Bug 1404198: Part 2i - Switch to NS_NewTimer* in dom. r=njn
MozReview-Commit-ID: 8Oei6TuXNbu

--HG--
extra : rebase_source : 31c583c699790cbcf302064146d313ee8126ef0c
2017-10-15 23:15:40 -07:00
Nicholas Nethercote
d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Catalin Badea
f8162c4bfd Bug 651120 - Remove index argument from content removed/appended/inserted notifications. r=peterv 2017-10-03 11:09:08 +01:00
Nicholas Nethercote
dfd3b7e7aa Bug 1400459 (part 2) - Devirtualize nsIAtom. r=heycam.
This patch merges nsAtom into nsIAtom. For the moment, both names can be used
interchangeably due to a typedef. The patch also devirtualizes nsIAtom, by
making it not inherit from nsISupports, removing NS_DECL_NSIATOM, and dropping
the use of NS_IMETHOD_. It also removes nsIAtom's IIDs.

These changes trigger knock-on changes throughout the codebase, changing the
types of lots of things as follows.

- nsCOMPtr<nsIAtom> --> RefPtr<nsIAtom>

- nsCOMArray<nsIAtom> --> nsTArray<RefPtr<nsIAtom>>
  - Count() --> Length()
  - ObjectAt() --> ElementAt()
  - AppendObject() --> AppendElement()
  - RemoveObjectAt() --> RemoveElementAt()

- ns*Hashtable<nsISupportsHashKey, ...> -->
  ns*Hashtable<nsRefPtrHashKey<nsIAtom>, ...>

- nsInterfaceHashtable<T, nsIAtom> --> nsRefPtrHashtable<T, nsIAtom>
  - This requires adding a Get() method to nsRefPtrHashtable that it lacks but
    nsInterfaceHashtable has.

- nsCOMPtr<nsIMutableArray> --> nsTArray<RefPtr<nsIAtom>>
  - nsArrayBase::Create() --> nsTArray()
  - GetLength() --> Length()
  - do_QueryElementAt() --> operator[]

The patch also has some changes to Rust code that manipulates nsIAtom.

MozReview-Commit-ID: DykOl8aEnUJ

--HG--
extra : rebase_source : 254404e318e94b4c93ec8d4081ff0f0fda8aa7d1
2017-09-26 08:33:21 +10:00
Jan de Mooij
dbca189324 Bug 1153592 part 2 - Remove JSPROP_SHARED; ensure accessor props don't have slots. r=evilpie 2017-09-26 12:26:50 +02:00
Kershaw Chang
53cf0a2a8e Bug 1247843 - Part 3: Set request context ID to the http channel created in imgLoader::LoadImage. r=baku
In order to let necko postpone the load of favicon, we have to set request context ID to the http channel that is created to load favicon.
This patch starts with passing a request context ID to nsContentUtils::LoadImage and makes other necessary changes to set the request context ID to the channel.
2017-09-20 20:09:00 -04:00
Jason Orendorff
ddaf859c55 Bug 1363200 - JSAPI for realms: Change a few XPConnect methods to take Realm arguments instead of JSCompartments. r=mrbkap
This also introduces JS::GetObjectRealmOrNull, which returns an object's realm,
or null if the object is a cross-compartment wrapper. In the new order,
wrappers can't have realms, since they must be shared across all realms in a
compartment. We're introducing this new function early (even though it's
*currently* possible to assign a realm to wrappers) in order to see in
advance if the possibility of returning null will cause problems.
(It looks like it won't.)

--HG--
extra : rebase_source : e55ebbbc4edf2a18ce267198928246592060e339
extra : source : d6bfce1187aa13dbfab03f9566ff7b05b6705e70
2017-06-28 12:31:53 -07:00
Boris Zbarsky
f23f66c56c Bug 1393806 part 1. Change nsNodeUtils cloning/adopting stuff to use an ErrorResult for errors. r=peterv
This will allow us to propagate out more informative errors in some cases.

MozReview-Commit-ID: 9FbzV5VRMqN
2017-09-13 13:34:55 -04:00
Emilio Cobos Álvarez
37df721a48 Bug 1397983: Synchronously bind/unbind XBL anonymous content from the bound content's Bind/UnbindFromTree. r=smaug
Doing it off a runnable makes the flattened tree inconsistent until that
runnable runs.

Also add an assert in frame construction that would've caught the first
only-unbind patch.

MozReview-Commit-ID: Hnua3aWSMHi

--HG--
extra : rebase_source : 2781e3b0a3f28b6b6a620902e7414dfe682fba51
2017-09-08 14:59:04 +02:00
Emilio Cobos Álvarez
82a163baff Bug 1397983: Rename nsXBLBinding::{Install,Uninstall}AnonymousContent to {Bind,Unbind}AnonymousContent. r=smaug
MozReview-Commit-ID: LZCjwiNtMYZ

--HG--
extra : rebase_source : 2e5f2d65f876d34c8ad97af6530b79e82cf94a30
2017-09-11 13:11:01 +02:00
Masayuki Nakano
4ce89d8f61 Bug 1369072 - part3: nsXBLPrototypeHandler::DispatchXBLCommand() should use controller of visible window r=smaug
With previous change, KeyboardEvent is dispatched even when invisible window
has focus.  However, nsRootWindow::GetControllerForCommand() returns controller
for focused window even when the window is invisible because it uses
nsFocusManager::GetFocusedDescendant() to retrieve focused window.

Perhaps, we can assume that users won't expect to do something with invisible
window when they type some keys.  Then, nsRootWindow::GetControllerForCommand()
should return controller for visible ancestor window if focused window is
invisible.

This patch makes nsFocusManager::GetFocusedDescendant() can return only visible
descendants.  However, it already has a bool argument.  Therefore, it should
have a flag instead of adding new flag.  Most changes of this patch is replacing
its callers.

Then, nsRootWindow::GetControllerForCommand() and nsRootWindow::GetControllers()
should have a bool flag if it should return controller(s) for visible window.
This patch adds a bool flag for it.  Fortunately, the interface isn't scriptable.

Finally, this patch makes nsXBLPrototypeHandler::DispatchXBLCommand() and
EventStateManager::DoContentCommandEvent() retrieve controller for visible
window since they are always handles user input.

MozReview-Commit-ID: GygttTHuKRm

--HG--
extra : rebase_source : 1341273c4606298cb9b890b9312d9f5c8a75d144
2017-09-07 22:54:49 +09:00
Andrew McCreight
e8ec349629 Bug 1390660, part 1 - Clean up some uses of the table-to-map segue. r=peterv
In a number of places, there's no substantial use of maps any more
after the segue.

The ELEMENT segue tries the FragmentOrElement QI, but that is
redundant with the Element QI.

This lets me use a few higher-level macros.

MozReview-Commit-ID: Gstq3Cm8LDl

--HG--
extra : rebase_source : f0c7dbf5281ce7375b1369b49db095a211569d6c
2017-08-16 13:37:20 -07:00
Ting-Yu Lin
748cb71860 Bug 1396700 - Add a method to ServoStyleSet for creating XBL style set. r=xidorn
The motivation of this patch is that clearing mPresContext should be an
implementation detail of XBL style set, so I create a method for that, and
remove ClearPresContext().

MozReview-Commit-ID: Ftta0rcAqu6

--HG--
extra : rebase_source : 0bdb1ac3e2c988e5a0220172f19ab4b006e883d7
2017-09-01 16:45:39 +08:00
Ting-Yu Lin
3b33ba27fb Bug 1382078 Part 4 - Avoid unneeded restyle when XBL styleset is utilized by different PresContext. r=emilio
This fixed layout/style/test/test_media_queries_dynamic.html after Part 3 is added.

MozReview-Commit-ID: 7ZpSunCnkIc

--HG--
extra : rebase_source : 6acab11ba784b801b90afc0558c32baabcc3f271
2017-09-04 17:57:00 +08:00
Ting-Yu Lin
b6d71d0740 Bug 1382078 Part 3 - Support media changes for XBL stylesheets. r=emilio
MozReview-Commit-ID: EJp8EMyanBT

--HG--
extra : rebase_source : 0ea61ea1f649548158fa600e5e11190631ce447f
2017-09-02 15:25:45 +08:00
Ting-Yu Lin
a61a1227e9 Bug 1382078 Part 2 - Make nsBindingManager::MediumFeaturesChanged() return bool directly. r=emilio
The method always returns NS_OK, and no other caller checks the nsresult.
Hence the patch.

MozReview-Commit-ID: CnYCZ8VchG

--HG--
extra : rebase_source : 8626332e2774c1d6f42c7afa5e9679091a3aeaa2
2017-08-30 15:22:31 +08:00
Ting-Yu Lin
f62ed82f17 Bug 1382078 Part 1 - Add method to nsBindingManager to iterate all bound contents. r=emilio
MozReview-Commit-ID: H00b3pGNC8V

--HG--
extra : rebase_source : 3c950d3b11bf9bdf87488057943c38ecb918214d
2017-08-28 17:47:55 +08:00
Sebastian Hengst
63bf10f8e9 Backed out changeset 684b78bb1062 (bug 1382078) for failing mochitest test_media_queries_dynamic.html on Windows stylo. r=backout 2017-09-02 20:45:05 +02:00
Sebastian Hengst
55fe61b6d6 Backed out changeset 06fd7e672abd (bug 1382078) 2017-09-02 20:43:42 +02:00
Sebastian Hengst
3764de542b Backed out changeset b49d8d47c3f1 (bug 1382078) 2017-09-02 20:43:36 +02:00
Ting-Yu Lin
d537ea001c Bug 1382078 Part 3 - Support media changes for XBL stylesheets. r=emilio
MozReview-Commit-ID: EJp8EMyanBT

--HG--
extra : rebase_source : 524aaa95070c7708b3c24a0c9ee8a24344be2645
2017-09-02 15:25:45 +08:00
Ting-Yu Lin
6d69dabd0c Bug 1382078 Part 2 - Make nsBindingManager::MediumFeaturesChanged() return bool directly. r=emilio
The method always returns NS_OK, and no other caller checks the nsresult.
Hence the patch.

MozReview-Commit-ID: CnYCZ8VchG

--HG--
extra : rebase_source : 062d643308b309dfe442384301860ffeec2dff9f
2017-08-30 15:22:31 +08:00
Ting-Yu Lin
1405de1443 Bug 1382078 Part 1 - Add method to nsBindingManager to iterate all bound contents. r=emilio
MozReview-Commit-ID: H00b3pGNC8V

--HG--
extra : rebase_source : 8329b86b8690c13366a1421a977fb20165d5be5e
2017-08-28 17:47:55 +08:00
Henri Sivonen
3c8567b60d Bug 1354989 - Avoid pivoting via UTF-16 when loading CSS in the Stylo mode. r=jdm,SimonSapin
MozReview-Commit-ID: Llt29dvB4Io

--HG--
extra : rebase_source : 3ae51dc8beff3fb19e9318a6c7c30c9ab08a5b57
2017-08-29 16:01:42 +03:00
Emilio Cobos Álvarez
afe0dfdd27 Bug 1384232: Let ServoStyleset know what its purpose is. r=TYLin
MozReview-Commit-ID: IwC6FcxhYMT

--HG--
extra : rebase_source : 6d15a71b5bd3bbcce4c255b6993ac000daabe09e
2017-08-31 22:50:24 +02:00
Jan de Mooij
bc31f1ee31 Bug 1394835 part 1 - Spit JS_DefineProperty* APIs in separate data/accessor overloads. r=evilpie,bz 2017-08-30 15:35:06 +02:00
Jan de Mooij
3e1a11f41d Bug 1393790 part 1 - Remove JS_STUBGETTER and JS_STUBSETTER. r=jorendorff 2017-08-28 10:39:57 +02:00
Jan de Mooij
a5de55dced Bug 1389510 part 3 - Remove getProperty/setProperty hooks from ClassOps. r=evilpie 2017-08-25 10:12:16 +02:00
Nicholas Nethercote
f582d96b98 Bug 1390428 (part 9) - Remove nsXPIDLCString. r=erahm.
This is straightforward, with only two notable things.

- `#include "nsXPIDLString.h" is replaced with `#include "nsString.h"`
  throughout, because all nsXPIDLString.h did was include nsString.h. The
  exception is for files which already include nsString.h, in which case the
  patch just removes the nsXPIDLString.h inclusion.

- The patch removes the |xpidl_string| gtest, but improves the |voided| test to
  cover some of its ground, e.g. testing Adopt(nullptr).

--HG--
extra : rebase_source : 452cc4a08046a1adb1a8099a7e85a1917de5add8
2017-08-17 15:29:03 +10:00
Eric Rahm
a33f11e0f5 Bug 1391803 - Use nsStringFwd.h for forward declaring string classes. r=froydnj
We should not be declaring forward declarations for nsString classes directly,
instead we should use nsStringFwd.h. This will make changing the underlying
types easier.

--HG--
extra : rebase_source : b2c7554e8632f078167ff2f609392e63a136c299
2017-08-16 16:48:52 -07:00
Emilio Cobos Álvarez
1e6e97fed1 Bug 1389743: Only reconstruct frames synchronously from ContentRemoved when called from frame construction. r=mats
There's only one case of sync frame construction from ContentRemoved now, and
it's not on the element being removed, but on the whitespace siblings if needed,
and _only_ when they don't support lazy frame construction.

Basically, this switches all the RecreateFramesForContent calls to use
`aAsyncInsert` (which I changed to an enum class for readability), except when
we're already reframing.

Also, it switches ReframeTextIfNeeded to opt-in into lazy frame construction,
since it's used only when aFlags == CONTENT_REMOVED.

This allows to simplify the DestroyFramesFor API (which I'm happy to rename to
something more meaningful, since now it's something like
DestroyFramesForAndRecreateThemAsync), and do some other consistency cleanups.

A bunch of the ContentRemoved callsites were pretty random at passing
aAsyncInsert, and that was some kind of a mess. This patch ensures consistency,
and makes it impossible to do O(n^2) work when removing DOM nodes, which is
nice.

The underlying reason for this is explained in the description of bug 1377848,
and basically allows us to remove a bunch of Servo hacks on the longer term (a
few of them are going away already, yay!).

MozReview-Commit-ID: 2DrUTxGV8RX

--HG--
extra : rebase_source : f428d839a5482477dea22c0fea600d54f3e8799c
2017-08-23 09:58:57 +02:00
Ting-Yu Lin
c7dc325aed Bug 1388165 - Clear mPresContext after creating XBL styleset. r=xidorn
MozReview-Commit-ID: VBmKMTt8lc

--HG--
extra : rebase_source : e2b16da8f3d9c55a1485558f76285dc10c39b530
2017-08-22 14:46:25 +08:00
Bobby Holley
d42f0733ac Bug 1389300 - Inherit style backend into NS_NewDOMDocument. r=smaug,r=heycam
Our current machinery for enabling stylo requires a docshell - if there isn't
one, we default to the Gecko style system.

When getComputedStyle operates on an element without a presshell, it uses the
caller's presshell instead. If the element has previously been styled with
one style system (but no longer has a presshell), and the caller uses a
different style backend, using the caller's style system can cause crashes when
we pull bits of cached data off the DOM (like cached style attributes).

So we want to throw when window.getComputedStyle(element) is called for a
(window, element) pair with different style backends (which is what the next
patch in this bug does).

However, that causes a few failures where stylo-backed documents try to do
getComputedStyle on an XHR document (which, without a docshell, will use the
gecko style system).

So this patch does some work to propagate the creator's style backend into
various docshell-less documents. This should allow both chrome (which uses gecko)
and content (which uses stylo) to use getComputedStyle on the response document
for XHRs they create.

Note that the second patch in this bug will make
chromeWin.getComputedStyle(contentObj) throw. If we discover code that does
that, we can just make it invoke the content's getComputedStyle method over Xrays.

MozReview-Commit-ID: 5OsmHJKq5Ui
2017-08-15 19:10:43 -07:00
Masatoshi Kimura
38894511bc Bug 1390106 - Stop using versioned scripts in dom. r=mrbkap
MozReview-Commit-ID: 89KvCoTAg3I

--HG--
extra : rebase_source : 24831fa454a1cc6fff70a9b1eb509d0f5aeb800a
2017-08-14 20:42:55 +09:00
Wes Kocher
936a9461f6 Merge inbound to m-c a=merge
MozReview-Commit-ID: KRQeIGmhAPA
2017-08-10 18:14:34 -07:00
Masayuki Nakano
71cc15557e Bug 1387406 - part5: nsXBLWindowKeyHandler should treat editor as HTMLEditor r=smaug
Editor treated in nsXBLWindowKeyHandler is always HTMLEditor.  So, it should treat the editor as is.

MozReview-Commit-ID: 7uE2p8t5cNW

--HG--
extra : rebase_source : 66b2f42d9d0281f4a244f9cd1ceb077e32ac3515
2017-08-07 15:08:02 +09:00
Jonathan Watt
26a2ad3013 Bug 1388939, part 5 - Rename nsFrameManager::GetUndisplayedContent to GetDisplayNoneStyleFor. r=dholbert
MozReview-Commit-ID: Kpe6DcBP8yX
2017-08-01 15:27:59 +01:00
Ryan Hunt
ccfa40939c Bug 1385071 - Don't do the default action for key inputs that are handled by APZ. r=masayuki
Before if a key input was handled with APZ we wouldn't dispatch it to content,
because it was guaranteed there wouldn't be any key listeners. Now we are
allowing passive key listeners behind a pref, and so we will sometimes handle
a key input in APZ and dispatch it to content. When this happens, XBL shouldn't
do the default action, otherwise we would double scroll.

MozReview-Commit-ID: 2zfszQ3itkp

--HG--
extra : rebase_source : 724b110fd55c5935df589f1cbcc0b3380028a1ed
2017-07-30 13:08:17 -04:00
Ting-Yu Lin
03f7131602 Bug 1381851 - Update comments for nsXBLPrototypeResources::ComputeServoStyleSet(). r=heycam
MozReview-Commit-ID: E1Ols3kfEKU

--HG--
extra : rebase_source : f656741996d01121a47e46683b64812d43196f77
2017-07-28 16:33:22 +08:00
Xidorn Quan
96a6c473b5 Bug 1386865 part 1 - Have GetServoStyleSet return non-const ServoStyleSet. r=TYLin
MozReview-Commit-ID: IOlcThK3PAr

--HG--
extra : rebase_source : 6664f5f988ec0c2cdb5b21d61585da84131dc618
2017-08-03 16:58:23 +10:00
Masatoshi Kimura
f143125cc2 Bug 1326520 - Rename nsIURI.path to pathQueryRef. r=valentin.gosu
MozReview-Commit-ID: DqJdTGopR9G

--HG--
extra : rebase_source : e8c9eb03468c075b79013b6e0bd8b367229c24cd
2017-07-29 20:50:21 +09:00
Carsten "Tomcat" Book
892bedca2e merge mozilla-inbound to mozilla-central a=merge 2017-07-28 15:24:39 +02:00
Bobby Holley
f3de753524 Bug 1384769 - Get rid of the ForNewlyBoundElement mode. r=emilio
MozReview-Commit-ID: 1IRn2iaPnVc
2017-07-27 17:49:42 -07:00
Julian Seward
408d24da56 Bug 1382563 - Remove ns*String::AssignWithConversion. r=erahm.
This patch replaces four functions of the name AssignWithConversion which
are essentially wrappers around CopyASCIItoUTF16 and LossyCopyUTF16toASCII
with direct calls to the latter two functions.  The replaced functions are:

  void nsCString::AssignWithConversion( const nsAString& aData )
  void nsString::AssignWithConversion( const nsACString& aData )

  void nsTString_CharT::AssignWithConversion(
                            const incompatible_char_type* aData,
                            int32_t aLength = -1);

The last of the three exists inside the double-included nsTString* world and
so describes two functions, giving four in total.

This has two advantages:

* it removes code

* at the call points, it makes clear (from the replacement name) which
  conversion is being carried out.  The generic name "AssignWithConversion"
  doesn't make that obvious -- one had to infer it from the types.

The patch also removes two commented out lines from
editor/composer/nsComposerCommands.cpp, that appear to be related.  They are
at top level, where they would never have compiled.  They look like
leftovers from some previous change.

--HG--
extra : rebase_source : fb47bf450771c3c9ee3341dd14520f5da69ec4f5
2017-07-24 19:23:52 +02:00
Bobby Holley
d1534d15b4 Bug 1341102 - Re-enable some crashtests. r=me
MozReview-Commit-ID: 65QY7FfZQcL
2017-07-24 18:35:19 -07:00
Masayuki Nakano
0ebdc75b7b Bug 1333459 - part2-3: Make nsMenuBarListener::KeyPress() wait reply from remote process if the eKeyPress event will be sent to a remote process later r=smaug
nsMenuBarListener::KeyPress() is eKeyEvent listener in the system event group.  If the target is a remote process, it shouldn't handle accesskey immediately because preceding eKeyDown event may be consumed in the remote process or eKeyPress event itself may be consumed in the remote process.

This patch makes nsMenuBarListener::KeyPress() mark eKeyPress event as "waiting reply from remote process" only when the event matches with a menu item's accesskey and it will be send to a remote process later.  Then, reply event should be handled in this method if it's available.

MozReview-Commit-ID: KOpCVgElnca

--HG--
extra : rebase_source : 881ec01f5c8e21c790bf9a8c3167d6c3f932524a
2017-07-19 18:39:34 +09:00
Sylvestre Ledru
7c0ae251cd Bug 1381253 - Remove redundant control flow declarations rs=ehsan
MozReview-Commit-ID: FFxP4aMCbOL

--HG--
extra : amend_source : 3aec108430b11048f47ffe19d5da7ac5034770a9
2017-07-15 19:03:04 +02:00
Bobby Holley
cdfdf83ff0 Bug 1382357 - Crashtest. r=heycam
MozReview-Commit-ID: IUqzytg3SqL
2017-07-19 21:52:38 -07:00
Bobby Holley
ff4e044f30 Bug 1382357 - Wait to destroy frames until after we've successfully fetched the binding. r=heycam
The issue here is that the DestroyFramesFor call does a ClearServoDataFromSubtree,
and then we subsequently fail to load the bindings, leaving ourselves with an unstyled
subtree that isn't marked with descendant bits and isn't rooted at a display:none element,
which is forbidden. This can trigger crashes when we call the innerText getter on one of
the unstyled elements, since that will first flush layout (which won't find the unstyled
subtree), and then invoke IsOrHasAncestorWithDisplayNone, which passes LazyComputeBehavior::Assert.

MozReview-Commit-ID: 7roBkH9fTGZ
2017-07-19 21:52:36 -07:00
Ryan Hunt
96c95dcf9e Bug 1381736 - Fix modifier masks for APZ keyboard shortcuts. r=masayuki
MozReview-Commit-ID: LGQzHabEqrz

--HG--
extra : rebase_source : 423970ec88f200f89c05e6bb697e8eeac7078641
2017-07-18 02:03:14 -04:00
Yoshi Huang
41473dd86d Bug 1373513 - Part 2: Revert Bug 1364367. r=ckerschb
Revert what we did in Bug1364367, as data URI for -moz-binding should be
same origin.
2017-07-12 11:00:27 +08:00
Boris Zbarsky
66481a7a29 Bug 1371259 part 9. Make UnwrapReflectorToISupports return already_AddRefed<nsISupports>. r=peterv
The main reason to not do this would be performance (avoiding the
addref/release), but there are two main mitigating factors:

1)  All calls to UnwrapReflectorToISupports that pass in a Web IDL object
    already do the addref (and in fact QI).  So this only affects the
    XPCWrappedNative case.

2)  The vast majority of the callers proceed to QI on the pointer anyway, and a
    second addref is cheap; it's the first addref after a CC that can be
    expensive on a cycle-collected object.

Going through the changes one by one:

* In GlobalObject::GetAsSupports, we do have a change that slightly slows down
  precisely in the XPCWrappedNative global case.  That's the message managers
  and the backstagepass.  And this really only affects calls to Web IDL statics
  from those globals.

* In UnwrapArgImpl we're talking about a Web IDL method taking an "external
  interface" type, and the UnwrapReflectorToISupports call is immediately
  followed by QI anyway.

* In UnwrapXPConnectImpl we're talking about the case when we have a
  non-WebIDL-object implementation of a Web IDL interface.  Again, this is the
  message manager globals, for EventTarget.  And we have a QI call immediately
  after the UnwrapReflectorToISupports.

* In the generated HasInstance hook for EventTarget we will be slightly slower
  when the LHS of the instanceof is an XPCWrappedNative.  And not much slower,
  because again there's an immediate QI.

* In InstallXBLField we're never going to have an XPCWrappedNative as thisObj;
  it's always an Element in practice.  So this is no more expensive than before.

* In sandbox's GetPrincipalOrSOP we now have an extra addref.  But it was
  followed by various QIs anyway.

* In XPCConvert::JSValToXPCException we have an extra addref if someone throws
  an XPCWrappedNative, which is fairly unlikely; our actual Exception objects
  are on Web IDL bindings.  Plus we have an immediate QI.

* In xpc::HasInstance we have an extra addred if the LHS of instanceof is an
  XPCWrappedNative.  But, again, there's an immediated QI after the
  UnwrapReflectorToISupports.

* In xpcJSWeakReference::Init we are likely doing an extra addref, but again
  immediately followed by QI.

I think it's worth making this change just to remove the footgun and that the
perf impact, if any, is pretty minimal.
2017-07-10 16:05:26 -04:00
Boris Zbarsky
9cdb2834a8 Bug 1371259 part 8. Get rid of nsIXPConnect::GetNativeOfWrapper. r=peterv
Most of these changes are just replacements of GetNativeOfWrapper with
UnwrapReflectorToISupports, which is all it did under the hood.

The other changes are as follows:

* In nsDOMClassInfo, we really care whether we have a window, so we can just
  UNWRAP_OBJECT to the Window interface, since Window is always on Web IDL
  bindings now.  Also, the weird compartment check hasn't been needed ever since
  GetNativeOfWrapper stopped returning things off the passed-in object's
  prototype chain (Firefox 22, bug 658909).
* The only use of do_QueryWrapper was to get a Window in nsDocument; again we
  can UNWRAP_OBJECT.
* In XPCJSRuntime, we again just want to check for a Window, so UNWRAP_OBJECT.
2017-07-10 16:05:25 -04:00
Boris Zbarsky
5c76874a46 Bug 1371259 part 3. Change UnwrapObject<> and the UNWRAP_OBJECT macro to allow passing in mutable object or value handles for the thing being unwrapped, and do so at various callsites. r=peterv
I did audit all UNWRAP_OBJECT callers to make sure that the lifetimes of all the
temporary Rooted or the RefPtrs they unwrap into are long enough.
2017-07-10 16:05:24 -04:00
Carsten "Tomcat" Book
49921c11be Merge mozilla-central to autoland 2017-07-05 13:05:51 +02:00
Masayuki Nakano
57f359b0de Bug 1377653 - part2: Add helper methods to WidgetEvent and BaseEventFlags to manage propagation state between parent process and remote process r=smaug
Currently, we have 2 bool flags (and optional 2 bool flags with related purpose) for managing propagation state between parent process and remote process.  However, it's really complicated.  Actually, setting these flags and referring the flags is usually follow explanation.

So, for making simpler, WidgetEvent and BaseEventFlags should have some utility methods for making them as self documented code.

This patch moves WidgetKeyboardEvent::mIsReserved to BaseEventFlags::mIsReservedByChrome.  That allows us to manage the cross process event propagation state in same place.

MozReview-Commit-ID: IXEDQJ4GpAZ

--HG--
extra : rebase_source : 5b63ac4f1d15e40e8bfc88423e336de28caa8ab6
2017-07-05 13:58:41 +09:00
Mats Palmgren
977a9e5f89 Bug 1376498 part 4 - Make all nsClassHashtable::RemoveAndForget() consumers use Remove() instead. r=froydnj
MozReview-Commit-ID: G64YQLlgm6r
2017-07-05 02:01:45 +02:00
Bill McCloskey
5ea47d3cf9 Bug 1376981 - Label nsBindingManager::PostProcessAttachedQueueEvent (r=smaug)
MozReview-Commit-ID: G0xxNwtXsex
2017-07-03 16:20:04 -07:00
Ting-Yu Lin
51d252c459 Bug 1377196 Part 1 - Store nsBindingManager* in ServoStyleSet. r=heycam
We need to call nsBindingManager's method from ServoStyleSet in a later
patch.

Also, we call nsStyleSet::SetBindingManager() immediately after we call
nsStyleSet::Init(). Therefore, we could pass binding manager to Init()
directly, and delete SetBindingManager().

MozReview-Commit-ID: 43WTpW3mSKX

--HG--
extra : rebase_source : f24f6085c51dfae1a969aee1e073720097d240d5
2017-06-29 13:43:59 -07:00
Ryan Hunt
341325dac4 Bug 1376549 - Prevent APZ handling of keyboard shortcuts hardcoded in ESM. r=kats
MozReview-Commit-ID: 1IolnCXGPjQ

--HG--
extra : rebase_source : 748ed1700383f255d4c32f82d7e5f1455ede8d50
2017-06-28 16:06:47 -04:00
Ting-Yu Lin
322430d9e4 Bug 1375513 Part 1 - Support non-chrome XBL bindings with stylesheets for stylo. r=heycam
MozReview-Commit-ID: bclwwk6uzI

--HG--
extra : rebase_source : 1dcbc7ef2f482333991e3bce1cf18ee5924c2740
2017-06-27 22:49:19 -07:00
Cameron McCormack
4cfbfe320e Bug 1372061 - Add node flag recording whether we might have anonymous children. r=bholley
MozReview-Commit-ID: CMaxJ1JnuYJ

--HG--
extra : rebase_source : ac5651b0d42125fd2a4ff3f5ce03f7a6c6ab1fbb
2017-06-27 23:56:12 -07:00
Ryan Hunt
fb04e72bad Bug 1351783 part 19 - Rename Keyboard.h to KeyboardMap.h. r=masayuki
This is a better name for the header that matches its main class.

MozReview-Commit-ID: KSt9LVT3yRR

--HG--
rename : gfx/layers/apz/src/Keyboard.cpp => gfx/layers/apz/src/KeyboardMap.cpp
rename : gfx/layers/apz/src/Keyboard.h => gfx/layers/apz/src/KeyboardMap.h
extra : rebase_source : ec4c9ec5afa8479dc4cd3e987fc3293f047beb9e
extra : histedit_source : caa3a11043fc1ccdff3d7853eda69a0a3dfff99e
2017-06-15 18:06:00 -04:00
Ryan Hunt
cc923c3909 Bug 1351783 part 6 - Create and send KeyboardMap to APZCTreeManager. r=kats
This commit makes it so we initialize, send, and store a KeyboardMap for every
APZCTreeManager for later keyboard event processing.

This is a naive approach so it may be worth improving.

MozReview-Commit-ID: CYTbLL3wRlC

--HG--
extra : rebase_source : 016b80a2a209d4fb5b92bc3adb95bd2dbb4399e0
2017-06-05 18:35:32 -05:00
Ryan Hunt
18867b218f Bug 1351783 part 5 - Add a KeyboardMap type. r=kats,masayuki
The XBL bindings used for scrolling are managed by a nsXBLWindowKeyHandler. This
class loads the handlers and has logic for searching through them to match a
keyboard event. This commit adds a KeyboardMap class for storing KeyboardShortcuts
and for mirroring the search logic of nsXBLWindowKeyHandler.

MozReview-Commit-ID: 5BmFBilKTJy

--HG--
extra : rebase_source : 96cd0f5808ba6c4926e9da368ab3780b1d9d1449
2017-06-05 18:29:04 -05:00
Ryan Hunt
710c2e9481 Bug 1351783 part 4 - Add a KeyboardShortcut type. r=kats,masayuki
Keyboard scrolling works by first dispatching a key event to the focused element
of the page. It is then caught by a XBL binding put on the chrome event handler of
every window. The XBL binding searches through all of its handlers to find one
that can handle the keyboard event. The matching binding has a command string
which is dispatched to the nsGlobalWindowCommands which dispatches to PresShell
which does the actual scrolling.

To do this asynchronously, we need a representation of the XBL handlers that can
be applied to a KeyboardInput to get a KeyboardAction.

This commit adds KeyboardShortcut for this purpose. KeyboardShortcut is designed
to be compatible with nsXBLPrototypeHandler and to only handle the specific cases
we care about for keyboard scrolling. If a XBL handler runs javascript or does
anything else we cannot handle in an OMT situation, then we create a
dispatch-to-content KeyboardShortcut.

MozReview-Commit-ID: 1qzywS3QHVp

--HG--
extra : rebase_source : 8ea4f85c02d04ce5e0fa6e430c44ac920269dd9f
2017-06-05 18:24:35 -05:00
Carsten "Tomcat" Book
4e00eff077 merge mozilla-inbound to mozilla-central a=merge 2017-06-27 10:56:41 +02:00
Bill McCloskey
f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Masatoshi Kimura
b515c9c804 Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen
MozReview-Commit-ID: GF0YXDwfA14

--HG--
extra : rebase_source : fdae0046f882d47fb539a7f882364e5c5caafdcd
extra : source : 49249788c0dee331ac2989dc39f0505d965a7bd8
2017-06-18 20:37:50 +09:00
Sebastian Hengst
dfc1ad2562 Backed out changeset 7235d05662b0 (bug 1373984) for Android bustage. r=backout on a CLOSED TREE 2017-06-25 18:30:13 +02:00
Masatoshi Kimura
2e04751921 Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen
MozReview-Commit-ID: GF0YXDwfA14

--HG--
extra : rebase_source : a84ab644f52e68676b45f112ff69f868d89f6177
extra : source : 49249788c0dee331ac2989dc39f0505d965a7bd8
2017-06-18 20:37:50 +09:00
Wes Kocher
e02435a31e Backed out changeset 77af189b5c49 (bug 1373984) for build bustage in nsHtml5Parser.cpp a=backout CLOSED TREE
MozReview-Commit-ID: 6kBmU71j2To
2017-06-25 05:10:14 -07:00
Masatoshi Kimura
241039fd97 Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen
MozReview-Commit-ID: GF0YXDwfA14

--HG--
extra : rebase_source : 09da1685795583513bf019d61c58230c2c4d298d
extra : source : 49249788c0dee331ac2989dc39f0505d965a7bd8
2017-06-18 20:37:50 +09:00
Carsten "Tomcat" Book
5f51e5596e merge mozilla-inbound to mozilla-central a=merge 2017-06-23 11:28:19 +02:00
Nicholas Nethercote
fe9268c4cd Bug 1374580 (part 2) - Remove nsAFlat{,C}String typedefs. r=froydnj.
All the instances are converted as follows.

- nsAFlatString  --> nsString
- nsAFlatCString --> nsCString

--HG--
extra : rebase_source : b37350642c58a85a08363df2e7c610873faa6e41
2017-06-20 19:19:05 +10:00
Nicholas Nethercote
1572f96f5d Bug 1374580 (part 1) - Remove nsASingleFragment{,C}String typedefs. r=froydnj.
All the instances are converted as follows.

- nsASingleFragmentString  --> nsAString
- nsASingleFragmentCString --> nsACString

--HG--
extra : rebase_source : e6a1ddc8938fecd9a735b15e872c054edf4c7910
2017-06-20 19:18:17 +10:00
Kirk Steuber
e967f9a6c1 Bug 1375189 - Don't use aNodesWithProperties in nsNodeUtils::CloneAndAdopt if it is not needed r=bz
MozReview-Commit-ID: 9vu3HCQkDKf

--HG--
extra : rebase_source : eb6231c88732133ee6d90e621a5833b9be1e81ce
2017-06-21 11:55:04 -07:00
Carsten "Tomcat" Book
8a1350b5a6 Backed out changeset 4f6302a98ae4 (bug 1372405)
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
2017-06-21 13:59:26 +02:00
Bill McCloskey
6b3e84ed5f Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book
ea1b86680c Backed out changeset 9846de3bd954 (bug 1372405)
--HG--
extra : rebase_source : 5d4a48e8ec394c329994689d938d2a6e9b2752b0
2017-06-20 08:27:02 +02:00
Bill McCloskey
4592152411 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Sebastian Hengst
20d16dadd3 merge mozilla-inbount to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 36YqbsnO3en
2017-06-15 11:11:30 +02:00
Carsten "Tomcat" Book
4f44c026f2 Merge mozilla-central to mozilla-inbound 2017-06-14 14:50:11 +02:00
Xidorn Quan
589d06fb7f Bug 1372757 - Remove several dependencies to ServoBindings.h. r=heycam
MozReview-Commit-ID: Lruin1acS19

--HG--
extra : rebase_source : 7aeb83df3e1bf21a68d2f3e9048c5bfaa295ccdb
2017-06-14 09:38:16 +10:00
Jan de Mooij
83f290de99 Bug 1370608 part 1 - Move newEnumerate hook from ObjectOps to ClassOps. r=evilpie,bz 2017-06-14 10:37:44 +02:00
Cameron McCormack
a6661ab735 Bug 1370793 - Part 1: Don't try to style unstyled children of elements with newly applied XBL bindings if in a display:none or unstyled subtree. r=bholley
MozReview-Commit-ID: EFi2Vp19AQm

--HG--
extra : rebase_source : 39ce54a1ffc4ec709afa552bc45cb6cd803ee827
2017-06-11 19:11:08 +08:00
Kirk Steuber
99a80af5db Bug 1365092 - Move side effects of SetAttr, UnsetAttr, and ParseAttribute functions to BeforeSetAttr and AfterSetAttr r=bz
This is necessary to facilitate the transition to cloning attributes instead of reparsing them.

MozReview-Commit-ID: Gyd1tD6ldly

--HG--
extra : rebase_source : 777cfed750c95c448f953a6ec98026481997e227
2017-06-07 10:28:20 -07:00
Ting-Yu Lin
2923be5074 Bug 1290276 Part 8 - Update test expectations after implementing XBL <stylesheet> for stylo. r=heycam
Disable 461917-1.xhtml under dom/xul/crashtests/ because I cannot reproduce
it locally.

Annotate assert-if on some crashtests (bug 1370830). Other modifications are
all removal of fails-if.

MozReview-Commit-ID: 6Q2A5M5rOry

--HG--
extra : rebase_source : b282a919fcda6287fe2eaa6b139a11f2663ad578
2017-05-31 16:44:38 -07:00
Ting-Yu Lin
414fb7a11d Bug 1290276 Part 6 - Add FFI functions to allow various XBL data to be used from servo side. r=heycam
MozReview-Commit-ID: 9yG7xrXXuRn

--HG--
extra : rebase_source : 724c55fb8d424524e5408eead53d7b380197eff6
2017-06-05 14:00:27 +08:00
Ting-Yu Lin
548c53752d Bug 1290276 Part 5 - Add XBL stylesheets to ServoStyleSet so that it can be used in servo cascading later. r=heycam
In gecko style backend, nsXBLPrototypeResources calls GatherRuleProcessor()
after all the XBL stylesheets are loaded. We use ServoStyleSet to implement
the similar functionality for stylo.

MozReview-Commit-ID: 431XGFALtDY

--HG--
extra : rebase_source : 34327d71e1c88717463b2e8f7dfbda804aca0664
2017-06-05 13:06:52 +08:00
Ting-Yu Lin
eee973bf80 Bug 1290276 Part 2 - Pass bound element to Loader through LoadResources(). r=heycam
We'll need the bound element to get PresContext in a later patch.

MozReview-Commit-ID: 2Gcb0yKgbTH

--HG--
extra : rebase_source : 6549eb726c32e25bea6045027805492984521d48
2017-06-05 14:30:52 +08:00
Ting-Yu Lin
107fd64974 Bug 1290276 Part 1 - Make LoadResources() return bool directly. r=heycam
MozReview-Commit-ID: 4z3cHiWXMAh

--HG--
extra : rebase_source : 5ddf298f9208569dc40e1e56c7908e1665e6c215
2017-06-05 14:29:31 +08:00
Ting-Yu Lin
2b96e807e3 Bug 1367286 - Remove loading user html binding via "dom.userHTMLBindings.uri". r=bz
MozReview-Commit-ID: 175udoeRUmT

--HG--
extra : rebase_source : fd1b3cbc546d972bba184223426e5d4761b714b9
2017-05-24 13:10:12 -04:00
Ting-Yu Lin
911f08dd7f Bug 1363640 Part 6 - Use bound document's style backend when creating an XBL document. r=heycam
The <content> in an XBL document could be injected into documents with
different style backend types. Therefore, we need to set the XBL document's
style backend to the same as the bound document's so that the style
attribute of the content can be processed by the correct backend. <marquee>
elements in xbl-marquee.xml is one such example.

MozReview-Commit-ID: 7M33zlbZqNF

--HG--
extra : rebase_source : 363fd7c2bc91e959fbcfb288bdc1b65cfd1bba97
2017-05-11 17:16:27 -07:00
Ting-Yu Lin
7e1743b337 Bug 1363640 Part 5 - Add a table in nsXULPrototypeCache to cache XBL documents with servo backend. r=bz,heycam
We assume those XBL documents without a bound document use gecko style
backend. Their backend type will be explicitly set when loading in Part 6.

MozReview-Commit-ID: 5c5xtYFvgAD

--HG--
extra : rebase_source : 578b50953d98ffa5280dac3440979e2aba7519cb
2017-05-19 15:18:00 -07:00
Ting-Yu Lin
200de4b5fa Bug 1363640 Part 3 - Strip whitespaces for files under dom/xbl. r=heycam
MozReview-Commit-ID: 3WBsFIgFZU9

--HG--
extra : rebase_source : 63699a4f10a418171cf9fa3205761c7b53129360
2017-05-09 20:45:11 -07:00
Ting-Yu Lin
83b30c2642 Bug 1371577 - stylo: Update test expectations after fixing pseudo element matching for XBL stylesheets. r=emilio
MozReview-Commit-ID: 39h2kZHww4k

--HG--
extra : rebase_source : 4c94d5addeb3fe69049fd4942db86d73224a1bd0
2017-06-14 16:45:46 +08:00
Yoshi Huang
60c7f0fc76 Bug 1364367 - rewrite test_bug379959.html. r=ckerschb
Update test_bug379959.html, meanwhile also added
test_bug379959_legacy.html to test the old behavior.
2017-05-23 09:02:06 +08:00
Yoshi Huang
87ffcf52fe Bug 1363612 - Part 3: fix for moz-binding: url. r=smaug
Also seperate this to make sure I modified the test correctly.
2017-05-16 16:57:20 +08:00
Yoshi Huang
9af1bdc477 Bug 1363612 - Part 1: move to seperate files. r=smaug 2017-05-16 16:57:19 +08:00