Commit Graph

579 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
4deb3bee3b Bug 1411754: Rename PresShell::DestroyFramesFor to DestroyFramesForAndRestyle. r=mats
I'm drive-by removing the comment about the frame tree state because I looked
into it, and the answer is: we properly restore it.

The gotcha is that we retain it too much, indeed, we retain it enough that it
can leak. See bug 1397239.

MozReview-Commit-ID: LP6bXkduEZ4

--HG--
extra : rebase_source : f7e18fc35e48b75c07fcc84b939614d379926828
2017-10-25 23:12:25 +02:00
Emilio Cobos Álvarez
273bc65bb1 Bug 1410895: Make XBL slots hold the insertion point, not the XBL parent. r=bz
This is pretty much a straight-forward change except for a single thing, the
UpdateInsertionParent calls.

However, I cannot make any sense of them. They go through the inserted children
setting the insertion point, but then ClearInsertionPoints() is called.

ClearInsertionPoints calls XBLChildrenElement::ClearInsertedChildren, which sets
all the insertion points to null anyway.

Thus, I've removed that function completely.

MozReview-Commit-ID: 80daGQfLZrV

--HG--
extra : rebase_source : d52a37a60147ac11794c3cfe1aad5d202e9d2d9f
2017-10-23 15:52:08 +02:00
Attila Craciun
03687d95f5 Backed out 4 changesets (bug 1390694) for failing crash test and in reftest/tests/layout/reftests/xul/mac-tab-toolbar.xul r=backout on a CLOSED TREE.
Backed out changeset b9cff3469bfd (bug 1390694)
Backed out changeset e13dd2a3651f (bug 1390694)
Backed out changeset 83ff9e245757 (bug 1390694)
Backed out changeset 484a2644318f (bug 1390694)
2017-10-20 14:49:52 +03:00
Cameron McCormack
0a31e73ee0 Bug 1390694 - Part 3: Add nsBindingManager function to check for document state dependencies. r=emilio
MozReview-Commit-ID: Aw04MrVHyIz

--HG--
extra : rebase_source : dd1e15f0589ec532111711e14348c6d2ee590314
2017-10-18 17:26:41 +08:00
Cameron McCormack
2ceac13254 Bug 1390694 - Part 2: Allow EnumerateBoundContentBindings callbacks to stop enumeration. r=emilio
MozReview-Commit-ID: 25ZxscIi7T5

--HG--
extra : rebase_source : c0c45eba2d3375be98451cd9e627939e819791a2
2017-10-18 17:15:19 +08:00
Andrea Marchesini
6626e900f9 Bug 1409327 - NS_NewBufferedInputStream should take the ownership of the inputStream, r=smaug 2017-10-19 11:39:30 +02:00
Emilio Cobos Álvarez
0e037f3704 Bug 1409079: followup: Skip test also in release and add shell null-check. r=me
MozReview-Commit-ID: G2KA2eNyrH0
2017-10-17 20:02:04 +02:00
Sebastian Hengst
0fde5cb6b5 merge mozilla-central to autoland. r=merge a=merge 2017-10-17 11:46:52 +02:00
Emilio Cobos Álvarez
96a521052e Bug 1409078: Don't assume Gecko style backend on nsXBLPrototypeResources::FlushSkinSheets. r=heycam
MozReview-Commit-ID: 6ghFwpNhv6Z

--HG--
extra : rebase_source : b45c2aa3dd17019439c42ae46ffacd2b082ac7a5
2017-10-16 18:42:04 +02:00
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