Граф коммитов

675 Коммитов

Автор SHA1 Сообщение Дата
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
Kirk Steuber 7fdb378650 Bug 1359556 - Optimize cloneNode by preinitializing attribute and child arrays r=bz
Currently, attribute and child arrays (implemented in dom/base/nsAttrAndChildArray.h) start out empty. When cloning, the array ends up being resized multiple times in order to add the attributes and children that are being cloned from the original node. This would be quicker if the array was initialized to the correct size in the first place so that resizes are not necessary.

However, preallocating space for children is only necessary when performing a deep clone. Therefore, an additional parameter is being added to the Clone, CopyInnerTo, and CloneDocHelper methods to indicate whether preallocation of children should happen. Attributes are copied either way, so that part of the array is preallocated in both cases.

MozReview-Commit-ID: 3iVezeAKXnI

--HG--
extra : rebase_source : 9c3deec6d7aafd6411044d623d4863637b45fd58
2017-04-20 12:57:48 -07:00
Emilio Cobos Álvarez f5de4cd5ee Bug 1359384: Check for display: contents on nsXBLResourceLoader::NotifyBoundElements. r=bz
MozReview-Commit-ID: KVARvE6dO54

--HG--
extra : rebase_source : 31293b7284b56d80312bb2f9f2e526a2214ea45b
2017-04-27 23:35:32 +02:00
Boris Zbarsky 77a2c8f1f2 Bug 1359859. Use the right entry global for XBL constructor/destructor/field execution. r=bholley
The test doesn't verify that the exceptions are reported to the browser console,
but I manually checked that they are.  Adding a test for that part could be
pretty annoying.
2017-04-26 13:57:55 -04:00
Iris Hsiao 27dd75df0c Backed out changeset d19a04e55bef (bug 1359859) for mochitest failure. a=backout
CLOSED TREE
2017-04-27 11:46:12 +08:00
Boris Zbarsky d91dc284ca Bug 1359859. Use the right entry global for XBL constructor/destructor/field execution. r=bholley
The test doesn't verify that the exceptions are reported to the browser console,
but I manually checked that they are.  Adding a test for that part could be
pretty annoying.
2017-04-26 13:57:55 -04:00
Emilio Cobos Álvarez d2f3dc13ec Bug 1357142: Kill PresShell::RecreateFramesFor. r=bz
It's not only inefficient, but also prone to buggyness. Since styles may not be
up-to-date when it happens.

Post a reconstruct instead, which ensures a style flush happens before running
frame construction.

MozReview-Commit-ID: DrakHsJv5fY
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>

--HG--
extra : rebase_source : 11900af908654336cc2391ab9480542c5474e38f
2017-04-17 18:01:37 +02:00
Emilio Cobos Álvarez 75493877fc Bug 1350147: Remove -moz-bound-element pseudo-class. r=xidorn
MozReview-Commit-ID: GySVYOfoL1A
2017-03-27 23:03:38 +02:00
Nicolas B. Pierron 39741d711a Bug 1331662 part 2 - Replace nsJSUtils::EvaluateString calls by ExecutionContext scopes. r=bz 2017-03-22 13:42:27 +00:00
Cameron McCormack 96685b05f7 Bug 1348746 - stylo: Only eagerly style newly appended children from bindings when the pres shell has been initialized. r=bholley
MozReview-Commit-ID: 9kxbgiw78AB

--HG--
extra : rebase_source : e3b05c4cc79d8b7d3026030d5514b4e18d954a9b
2017-03-20 17:08:15 +08:00
Masatoshi Kimura 7be7b11a1c Bug 1342144 - Remove version parameter from the type attribute of script elements. r=jmaher
This patch is generated by the following sed script:
find . ! -wholename '*/.hg*' -type f \( -iname '*.html' -o -iname '*.xhtml' -o -iname '*.xul' -o -iname '*.js' \) -exec sed -i -e 's/\(\(text\|application\)\/javascript\);version=1.[0-9]/\1/g' {} \;

MozReview-Commit-ID: AzhtdwJwVNg

--HG--
extra : rebase_source : e8f90249454c0779d926f87777f457352961748d
2017-02-23 06:10:07 +09:00
Tom Tromey f8ab4ddf02 Bug 1060419 - remove unneeded includes of prprf.h, r=froydnj
MozReview-Commit-ID: JifhpA3oOeH

--HG--
extra : rebase_source : 08460997dc3fd91f3065c718e17b41bb4acf8bae
2016-12-09 10:00:01 -10:00
Bill McCloskey 194043ae97 Bug 1339289 - Give names to a lot of common runnables (r=ehsan)
MozReview-Commit-ID: 5IdvK6kgoAW
2017-02-15 12:30:01 -08:00
Cameron McCormack b2ee81223c Bug 1334735 - Part 1: Move need style/flush flags from document to pres shell. r=bz
MozReview-Commit-ID: 2Amf9yGRiJA
2017-02-10 10:42:27 +08:00
Joel Maher c203f27827 Bug 1335099 - add BUG_COMPONENT to many dom/* subdir files. r=overholt
MozReview-Commit-ID: CyIIs98hnUI
2017-02-06 09:45:55 -05:00
Sebastian Hengst 7225ec6170 Backed out changeset 9a332af74af5 (bug 1335099) for build bustage (moz.build rule matches no files). r=backout on a CLOSED TREE 2017-02-06 16:21:20 +01:00
Joel Maher 60e61eed48 Bug 1335099 - add BUG_COMPONENT to many dom/* subdir files. r=overholt
MozReview-Commit-ID: CyIIs98hnUI
2017-02-06 09:45:55 -05:00
Boris Zbarsky ac6be6fde3 Bug 835981 part 6. Change nsIDOMXULElement::GetControllers consumers to nsXULElement. r=peterv 2017-02-02 10:32:58 -05:00
Florian Quèze bdc1ffa608 Bug 1334831 - script-generated patch to use .remove() instead of .parentNode.removeChild, r=jaws. 2017-01-30 08:10:22 +01:00
Florian Quèze 0e0865f4fc Bug 1331599 - script-generated patch to replace removeEventListener calls with the once option when possible, r=jaws. 2017-01-25 07:01:52 +01:00
Julian Seward 6f7fcae338 Bug 1232696 - Remove NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW as it causes segfaulting for GCC 6 builds (2 of 5, fixes for dom/). r=bkelly. 2017-01-24 17:10:39 +01:00
Neil Deakin 61da00566d Bug 1297342, reserved attribute should be on key element not on the command, r=felipe 2017-01-19 13:57:11 -05:00
Florian Quèze 85611a7b6d Bug 1331081 - script generated patch to omit addEventListener/removeEventListener's third parameter when it's false, r=jaws.
--HG--
extra : rebase_source : a22344ee1569f58f1f0a01017bfe0d46a6a14602
2017-01-17 11:50:25 +01:00
Jon Coppeard ca898ea355 Bug 1325406 - Refactor rooting base class templates r=sfink r=mccr8 2017-01-10 10:12:14 +00:00
Bobby Holley b32f310e62 Bug 1323649 - Reenable some crashtests. r=me 2017-01-09 11:50:23 -08:00
Cameron McCormack babad063ff Bug 1328832 - Part 2: Rename mozFlushType to mozilla::FlushType and make it an enum class. r=bzbarsky
MozReview-Commit-ID: D3fIngSHSsl
2017-01-05 15:31:56 +08:00
Bobby Holley 3ae99d4463 Bug 1323655 - Handle unstyled elements when applying XBL bindings. r=heycam 2017-01-04 19:08:37 -08:00
Olli Pettay 0364dbc792 Bug 1326507, remove NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS, r=mccr8
--HG--
extra : rebase_source : 3ae1207308de120b7299b13ecaa95dd1612b3459
2017-01-03 21:47:55 +02:00
Cameron McCormack e686107ee8 Bug 1324983 - Don't persist styles on elements not in the document. r=emilio
MozReview-Commit-ID: 4Z8IxPS6rfE
2016-12-29 15:04:32 +08:00
Cameron McCormack 366f6eb24d Bug 1323892 - Disable currently crashing stylo crashtests. r=xidorn
MozReview-Commit-ID: 2BNjdBWdT5V
2016-12-16 18:54:41 +08:00
Bobby Holley 6871a9416e Bug 1294572 - Drop Servo data in SetXBLInsertionParent, and call StyleNewSubtree after all bindings have been removed and applied. r=heycam
MozReview-Commit-ID: Iv7uyq4uQye
2016-12-14 10:14:46 -08:00
Phil Ringnalda 5297375b79 Backed out changeset 62ad968c5c5d (bug 1294572) for mass crashes in mozilla::dom::FragmentOrElement::SetXBLInsertionParent
CLOSED TREE

MozReview-Commit-ID: Fw9sxk3lnML
2016-12-13 22:15:48 -08:00
Bobby Holley 9cf9854ad6 Bug 1294572 - Drop Servo data in SetXBLInsertionParent, and call StyleNewSubtree after all bindings have been removed and applied. r=heycam
MozReview-Commit-ID: Iv7uyq4uQye
2016-12-13 21:32:56 -08:00
Bobby Holley 2207c01808 Bug 1322945 - Change skip_root to unstyled_children_only and use StyleNewChildren in more places. r=heycam
I noticed that our current behavior in ContentRangeInserted is incorrect. Unlike
ContentInserted (where this code lived originally), ContentRangeInserted takes a
start and end element. I'm not sure if we ever take that path for new content that
needs style, but it seemed sketchy. And generally, it seems nice to just always
style new content the same way (though we still need to style NAC by the subtree
root, since it hasn't been attached to the parent yet).

For situations where there is indeed only one unstyled child, the traversal
overhead should be neglible, since we special-case the single-element in
parallel.rs to avoid calling into rayon.

Being more explicit about what we want here also makes us more robust against
the other handful of callpaths that can take us into
nsCSSFrameConstructor::{ContentRangeInserted,ContentAppended}. Currently we
can call StyleNewSubtree on an already-styled element via RecreateFramesForContent,
which triggers an assertion in the servo traversal.

MozReview-Commit-ID: DqCGh90deHH
2016-12-12 18:39:33 -08:00
Andrew McCreight fccb0645ed Bug 1323042 - forbid MOZ_COUNT_{CTOR,DTOR} for nsISupports classes; r=froydnj 2016-12-12 09:27:58 -05:00
Nathan Froyd 826598caba Backout aba6c73511a2 (bug 1307961) for massive test bustage resulting in a CLOSED TREE; r=alltheorange 2016-12-12 08:45:46 -05:00
Andrew McCreight e31b5489da Bug 1307961 - require consistent bloatview reporting for nsISupports classes; r=froydnj 2016-12-12 07:58:33 -05:00
Cameron McCormack 91631cac25 Bug 1320000 - Part 2: Make XBLChildrenElement::ParseAttribute delegate to its superclass. r=mrbkap
MozReview-Commit-ID: 8qXryZXKi4m
2016-12-01 09:25:21 +08:00
Tooru Fujisawa 515ef9ba45 Bug 1321218 - Remove legacy generator from dom/. r=smaug 2016-12-01 18:11:32 +09:00
Bobby Holley f8c9d884fc Bug 1317016 - Basic infrastructure for RestyleHint-driven traversal. r=emilio
MozReview-Commit-ID: 7wH5XcILVmX
2016-11-25 10:06:39 -08:00
Michelangelo De Simone 1c12c5271d Bug 1313788 - Remove DOM/wifi and related code. r=jst
MozReview-Commit-ID: BRT6bSvPpT

--HG--
extra : rebase_source : c5ae9e88e80ae1a9c46bf80439388bd9ef2ba4df
2016-11-08 15:02:45 -08:00
Sebastian Hengst d35f739e98 Bug 1310297 - Remove test annotations using b2g, mulet or gonk: dom/xbl. r=RyanVM
MozReview-Commit-ID: EqoZrlHQFNG

--HG--
extra : rebase_source : dfb4efc7e998c0e55ef86f1201245aa3fb7f9e44
2016-11-05 11:29:18 +01:00
Xidorn Quan 1cbd4cb699 Bug 1309868 part 1 - Use const nsIContent pointer in some DOM utils. r=bholley
MozReview-Commit-ID: H4g2VbWJUba

--HG--
extra : source : 77e67e5163ac9c450e18d4c4e5b690cee5d3f1a3
2016-10-18 15:29:03 +11:00
Jon Coppeard 6ca64e3652 Bug 1308919 - Don't make Handles to Heap<T> as it avoids the read barrier r=bz 2016-10-14 09:45:28 +01:00
Phil Ringnalda 400813c30b Merge m-i to m-c, a=merge 2016-09-30 23:24:52 -07:00
cku 818c1c0974 Bug 1302779 - Part 1. Resolve a local fragment against the current document that relative URLs are resolved against. r=heycam
MozReview-Commit-ID: 2vJDnfzoPiC

--HG--
extra : rebase_source : 3c43bd335caa918ac32f3ba1979f822db5319b11
2016-09-20 14:13:13 +08:00
Xidorn Quan 2f49a48a09 Bug 1304302 part 10 - Replace all uses of StyleSheetHandle. r=heycam
This commit is generated by the following commands with some minor
manual adjustment:

find . \( -name '*.h' -or -name '*.cpp' \) -not -path './layout/style/StyleSheet*' -exec sed -i -b \
  -e '/^\(#include\|using\)/s/StyleSheetHandle/StyleSheet/g' \
  -e 's/\(mozilla::\)\?StyleSheetHandle::RefPtr/RefPtr<\1StyleSheet>/g' \
  -e 's/StyleSheetHandle()/nullptr/g' \
  -e 's/->AsStyleSheet()//g' \
  -e 's/StyleSheetHandle/StyleSheet*/g' {} +
sed -i -b 's/sheet->AsVoidPtr()/sheet.get()/' layout/style/Loader.cpp
sed -i -b 's/AsHandle()/this/' layout/style/StyleSheet.cpp

MozReview-Commit-ID: 7abdvlKHukd

--HG--
extra : source : e5682242db07203b5a91810fe1e243c955310588
2016-09-26 22:03:25 +10:00
Terrence Cole 0edc10380c Bug 1297558 - Use a read barrier on Heap to ExposeToActiveJS r=sfink r=mccr8 2016-02-07 09:08:55 -08:00
Masayuki Nakano 97735168f1 Bug 1297013 part.2 Implement some helper methods to log constants related to event handling r=smaug
This patch implements some helper methods to log constants related to event handling.

ToString(KeyNameIndex) and ToString(CodeNameIndex) converts the enum itmes to human readable string.  They use WidgetKeyboardEvent's helper class which returns Unicode text.  Therefore, this need to convert from UTF16 to UTF8.  That's the reason why these methods don't return |const char*|.

GetDOMKeyCodeName(uint32_t) returns DOM keycode name if it's defined.  Otherwise, returns hexadecimal value.  For generating switch-case statement, VirtualKeyCodeList.h shouldn't include ",".  Therefore, this patch removes "," from VirtualKeyCodeList.h and append it at defining NS_DEFINE_VK.  Additionally, the last item of enum and array should not end with ",".  Therefore, this adds dummy last item at each of them.  Finally, some of the keyCode values are shared between 2 keys.  Therefore, it needs to support NS_DISALLOW_SAME_KEYCODE for switch-case generator.  See the comment in the file for more detail.

GetModifiersName(Modifiers) returns all modifier names included in the given value.

MozReview-Commit-ID: 9i2ftFOTpDn

--HG--
extra : rebase_source : 458a4d28624dc10dd4454f2e7708d746d1fcb045
2016-09-15 00:48:47 +09:00
Andrea Marchesini 5994c71158 Bug 1301251 - Handle GetSpec() failure in nsContentUtils::GetWrapperSafeScriptFilename(), r=smaug 2016-09-19 15:50:22 +02:00
Nicholas Nethercote 5622a00748 Bug 1297300 - Add missing checks to GetSpec() calls in dom/xbl/. r=bz.
--HG--
extra : rebase_source : b7279c4ce02ac111c39dc099652fe0837b98f30b
2016-09-08 14:19:01 +10:00
Carsten "Tomcat" Book 7c6c7db247 Merge mozilla-central to autoland 2016-09-07 17:26:11 +02:00
Andi-Bogdan Postelnicu d8fd5713a3 Bug 1300769 - call ConstructPrototype only if mType is NS_HANDLER_TYPE_XUL. r=mrbkap
MozReview-Commit-ID: H7vS03mVj4s

--HG--
extra : rebase_source : 045747d04c04ba589f5b1e7c4a371bc727613fb4
2016-09-07 11:01:51 +03:00
Nicholas Nethercote 34dcc7b852 Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm.
This change avoids lots of false positives for Coverity's CHECKED_RETURN
warning, caused by NS_WARN_IF's current use in both statement-style and
expression-style.

In the case where the code within the NS_WARN_IF has side-effects, I made the
following change.

> NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));
> -->
> Unused << NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));

In the case where the code within the NS_WARN_IF lacks side-effects, I made the
following change.

> NS_WARN_IF(!condWithoutSideEffects);
> -->
> NS_WARNING_ASSERTION(condWithoutSideEffects, "msg");

This has two improvements.
- The condition is not evaluated in non-debug builds.
- The sense of the condition is inverted to the familiar "this condition should
  be true" sense used in assertions.

A common variation on the side-effect-free case is the following.

> nsresult rv = Fn();
> NS_WARN_IF_(NS_FAILED(rv));
> -->
> DebugOnly<nsresult rv> = Fn();
> NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Fn failed");

--HG--
extra : rebase_source : 58788245021096efa8372a9dc1d597a611d45611
2016-09-02 17:12:24 +10:00
Nicholas Nethercote 742fc7eb48 Bug 1297961 (part 1) - Introduce nsURI::GetSpecOrDefault(). r=hurley.
This function is an infallible alternative to nsIURI::GetSpec(). It's useful
when it's appropriate to handle a GetSpec() failure with a failure string, e.g.
for log/warning/error messages. It allows code like this:

  nsAutoCString spec;
  uri->GetSpec(spec);
  printf("uri: %s", spec.get());

to be changed to this:

  printf("uri: %s", uri->GetSpecOrDefault().get());

This introduces a slight behavioural change. Previously, if GetSpec() failed,
an empty string would be used here. Now, "[nsIURI::GetSpec failed]" will be
produced instead. In most cases this failure string will make for a clearer
log/warning/error message than the empty string.
* * *
Bug 1297961 (part 1b) - More GetSpecOrDefault() additions. r=hurley.

I will fold this into part 1 before landing.

--HG--
extra : rebase_source : ddc19a5624354ac098be019ca13cc24b99b80ddc
2016-08-26 16:02:31 +10:00
Jared Wein b2e0fdce56 Bug 1297993 - Include the ID of the offending <key> element in the key conflict message. r=masayuki
MozReview-Commit-ID: 7hZLCZqfHAy
2016-08-31 12:53:24 -04:00
Bobby Holley 7d4ef4ac54 Bug 1292662 - Style XBL anonymous content after binding explicit children to insertion points. r=heycam
We're doing it too soon, which means that the subtree isn't fully set up.
2016-08-25 21:36:46 -07:00
Bobby Holley 263669837b Bug 1292279 - Clear up the semantics of our Servo traversal APIs. r=heycam 2016-08-25 21:34:31 -07:00
Leo Gaspard 2df9fd1853 Bug 1297244 - Assert on the type given as a parameter to Heap. r=terrence
--HG--
extra : rebase_source : 2523f190a45bf3669f40392226df6a0b6fbc9806
2016-08-24 14:21:42 -07:00
Jon Coppeard d1435a2a8c Bug 1296688 - Add JSCLASS_FOREGROUND_FINALIZE flag r=sfink r=smaug 2016-08-24 14:18:10 +01:00
Kan-Ru Chen b6d880aca1 Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj
The patch is generated from following command:

  rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,

MozReview-Commit-ID: AtLcWApZfES


--HG--
rename : mfbt/unused.h => mfbt/Unused.h
2016-08-24 14:47:04 +08:00
Jonathan Kingston 556ed99119 Bug 1173199 - Create preference to disable MathML. r=heycam, r=huseby, r=smaug
If the mathml.disabled preference is true, treat <math> and other MathML
elements as generic XML elements.

This patch disables the rendering code of MathML however preserves the
namespace so to reduce the breakage.

Original patch by: Kathy Brade <brade@pearlcrescent.com>

MozReview-Commit-ID: A2f2Q2b4eqR

--HG--
extra : rebase_source : 3c8530816727c01b68a831d560bfe16e7b02bd9d
2016-06-28 15:24:48 +01:00
Emilio Cobos Álvarez 11ac7c1d96 Bug 1288590: Rename nsAttrInfo to mozilla::dom::BorrowedAttrInfo. r=bholley
Unfortunately couldn't add all the debug checks that I'd want, since we can't
assert that is not safe to run script in quite a few places :(

MozReview-Commit-ID: 8m3Wm1WntZs
2016-07-27 11:18:33 -07:00
Emilio Cobos Álvarez ba64988f2f Bug 1288590: Use GetAttrInfoAt in nsXBLPrototypeBinding.cpp. r=bholley
MozReview-Commit-ID: EDqajfBFPra
2016-07-27 11:18:33 -07:00
Emilio Cobos Álvarez 16ed085072 Bug 1288590: Use GetAttrInfoAt in nsXBLBinding.cpp. r=bholley
MozReview-Commit-ID: Bm29ogNHXwR
2016-07-27 11:18:33 -07:00
Bobby Holley 64639661c1 Bug 1289620 - Hook up initial styling. r=heycam
Aside from the parser-side hacks, this should subsume all the current scattered
logic in the stylo tree to handle initial styling.
2016-07-27 09:44:25 -07:00
Eric Rahm 7db242c608 Bug 1286084 - Remove warning that startup cache is null. r=enn 2016-07-26 14:31:03 -07:00
Tom Tromey 5538d692d3 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

    perl -pi -e 's/; *c-basic-offset: *[0-9]+//'

... on the affected files.

The bulk of these files are moz.build files but there a few others as
well.

MozReview-Commit-ID: 2pPf3DEiZqx

--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
2016-07-14 10:16:42 -06:00
Chris Peterson b175c9fdd5 Bug 1277106 - Part 2: Expand MOZ_UTF16() strings to u"" string literals. r=Waldo 2016-07-20 22:03:25 -07:00
Andrew McCreight 2c5b2b21f3 Bug 1287624, part 1 - Use RefPtr::forget() instead of ::swap() in dom/. r=froydnj
These uses all null the return value first, so there should be no change in behavior.
2016-07-20 15:19:00 -07:00
Emilio Cobos Álvarez 1a49c35a07 Bug 1286445: stylo: Support restyles of non-pseudo content on state change. r=heycam
This includes, for example :hover.

Also removes the call to IsStyledByServo() in the document constructor, it's not
only unnecessary, but also we call UpdateStyleBackendType() too early.

MozReview-Commit-ID: 4YfCdmLoSxu
2016-07-16 16:22:12 -07:00
Lee Salzman 0e1e833b40 Bug 1286317 - part 2 - remove Qt widget usage from plugins. r=jrmuizel 2016-07-12 20:28:31 -04:00
Boris Zbarsky efc4dcf284 Bug 1275315 part 2. Use the new Realm getters in binding code. r=peterv 2016-07-09 00:19:52 -04:00
Jonathan Watt b15368cfcb Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
Nicholas Nethercote 3c7909e181 Bug 1278452 - Fix some null checks in dom/xbl/. r=mrbkap.
--HG--
extra : rebase_source : 2ffe1b24834ee863705b36085da44cefe331f951
2016-06-07 15:24:48 +10:00
Olli Pettay 1c8273e348 Bug 1277078 - inline some commonly used methods in bindingmanager, r=baku 2016-06-01 12:03:45 +03:00
Boris Zbarsky dc120449d2 Bug 1275698. Get rid of nsScriptSecurityManager::ScriptAllowed and replace it with xpc::Scriptability::Get(obj).Allowed() for better performance and less indirection. r=khuey 2016-05-27 20:26:56 -04:00
Jim Chen a7f33faa4e Bug 1275371 - Don't forward delete on shift+backspace; r=esawin
Shift+backspace causes a forward delete on some platforms, but not on
Android. The new Google keyboard is sending us shift+backspace, and we
need to handle it normally like a backspace.
2016-05-27 14:29:15 -04:00
Cameron McCormack 45dfce2c7c Bug 1275452 - Part 3: Eagerly restyle XBL-provided anonymous content in stylo. r=bholley
--HG--
extra : rebase_source : 4da7aa1a6364581cc9970baa42401bc49d33fa68
2016-05-25 16:55:50 +10:00
Mike Conley 359f06fb50 Bug 1166351 - Prioritize getting the nsXBLDocumentInfo out of the bound document's nsBindingManager instead of the nsXULPrototypeCache. r=bobbyholley+313730
This is kind of a long story, stay with me on this.

In bug 990290, a WeakMap was added to any JS scope that loaded an XBL
binding. That WeakMap stored the JS prototypes that are injected into
a bound node's prototype chain.

When a binding is removed, we search the prototype chain for the
JS prototype that we'd added, and remove it.

The XUL prototype cache caches numerous things, including nsXBLDocumentInfo,
which we use to get at the nsXBLPrototypeBinding for a particular binding,
which is then used to generate the class object that's put into the WeakMap.

When the XUL prototype cache is flushed, that means that when a binding
is bound, its definition needs to be reloaded off of the disk. If, however,
there was a pre-existing instance of the binding already being used in a
document, now we were in a funny case.

We were in a funny case, because when attempting to remove a binding, we
would look up the nsXBLPrototypeBinding via the nsXBLDocumentInfo that's
being held within the nsXULPrototypeCache, find (or load off the disk) a
_new_ nsXBLDocumentInfo and generate a _new_ nsXBLPrototypeBinding that
did not match to the one that we'd already stored in the WeakMap. This
would mean that removal would go wrong, and things would break horribly.

This patch makes it so that we prioritize checking the nsBindingManager
for a document for the nsXBLDocumentInfo before checking the
global nsXULPrototypeCache. That way, even if the cache gets cleared,
if the binding was ever used in this document, it'll be in the
nsBindingManager, and we'll get the same nsXULProtoypeBinding that
we'd been using before, and sanity will prevail.

MozReview-Commit-ID: G8iLDbCPRAC

--HG--
extra : rebase_source : 4322965c0b7150b22454651ad7a9461ee76d766b
2016-05-16 19:07:26 -04:00
Mike Conley 4e5e8f7b73 Bug 1166351 - Add an assertion to make sure that we use the correct cached XBL binding prototypes. r=bobbyholley+313730
MozReview-Commit-ID: 7MfslXmortQ

--HG--
extra : rebase_source : 478d19031d5820acf2eeb077d689159769318b2a
2016-04-29 14:54:12 -04:00
Makoto Kato fbbac87fd2 Bug 1253284 - Allow reserved attribute without command attribute r=masayuki
MozReview-Commit-ID: A2aEOgTx5Jz

--HG--
extra : rebase_source : f0ecefde7d39b63caf1b69cb88e3ed49b1bef084
2016-05-06 18:38:44 +09:00
Chris Peterson 353ee65255 Bug 1272513 - Part 1: Suppress -Wshadow warnings-as-errors in some directories. r=glandium 2016-05-11 00:00:01 -07:00
Kyle Huey 941ab1f522 Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-05-05 01:45:00 -07:00
Terrence Cole 8e2294b2b6 Bug 1267699 - Move some public types to the right namespace; r=sfink
--HG--
extra : rebase_source : f79f7d86aab708b86a65e6f2426baeb8488f47e5
2016-04-26 09:18:48 -07:00
Carsten "Tomcat" Book ba3fe0975c Backed out changeset 85ce8cb0639a (bug 1268313)
--HG--
extra : rebase_source : 56d1cf41a2dc4959b67f834e07192a5c772176a8
2016-04-29 14:21:16 +02:00
Kyle Huey 48a594a09e Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-04-28 14:08:25 -07:00
Geoff Brown 22f6c292d5 Bug 1268050 - Skip dom/xbl/crashtests/336744-1.html on Android, for frequent failures 2016-04-28 10:49:40 -06:00
Christoph Kerschbaumer da0d241d98 Bug 1206961 - Use channel->AsyncOpen2() for imageLoader; Remove security checks from callsites (r=bz) 2016-04-27 19:41:13 +02:00
Masayuki Nakano 8f62c5aa3c Bug 1257759 part.8 nsXBLWindowKeyHandler should handle eKeyDownOnPlugin and eKeyUpOnPlugin events only with reserved shortcut key handlers r=smaug
eKeyDownOnPlugin (mozkeydownonplugin) and eKeyUpOnPlugin (mozkeyuponplugin) should execute if the key combination is reserved by the linked <command> element.

Note that there is no eKeyPressOnPlugin.  Therefore, eKeyDownOnPlugin may execute shortcut key handler which is registered as a keypress event handler.

MozReview-Commit-ID: CpjsFW02y26

--HG--
extra : rebase_source : 361be61bc6ff0213e3386427878d2f81321ca0df
2016-04-23 02:12:54 +09:00
Masayuki Nakano eb041d2df7 Bug 1257759 part.7 Add new internal events which represent key events on plugin r=smaug
If a plugin process posts native key events to the widget, it needs to check if the key combination is reserved by chrome because if it's reserved by chrome, the reserved shortcut key handler should be executed and the event shouldn't be handled by the focused plugin.

This patches add eKeyDownOnPlugin and eKeyUpOnPlugin.  nsXBLWindowKeyHandler will listen to them and handle them as normal keydown and keypress or keyup event.  Note that these events won't be fired on content in the default event group and won't be sent to the remote process.

MozReview-Commit-ID: H5OKPLtVdr6

--HG--
extra : rebase_source : c6852423e47c40e9953b72061262730f7cce35d7
2016-04-23 01:22:49 +09:00
Masayuki Nakano 9170348baf Bug 1259656 part.7 Rename WidgetEvent::originalTarget to WidgetEvent::mOriginalTarget r=smaug
MozReview-Commit-ID: G1WVCWkS0Lt

--HG--
extra : rebase_source : e4790266f4efa33269c073bca1d98f9e8e6c90d7
2016-04-19 01:33:23 +09:00
Cameron McCormack c5e251b3b9 Bug 1247182 - Add an nsCSSRuleProcessor constructor that takes ownership of the given sheet array. r=birtles 2016-04-14 16:02:44 +10:00
Nicholas Nethercote 60dcde7875 Bug 1261723 (part 2) - Separate class ops from js::Class. code=njn,h4writer. r=efaust,bz.
js::Class op are often all null. And when they're not all null, they're often
duplicated among classes. By pulling them out into their own struct, and using a
(possibly null) pointer in js::Class, we can save 114 KiB per process on
64-bit, and half that on 32-bit.
* * *
imported patch separate-ClassOps-2

--HG--
extra : rebase_source : bd751bf247e9491c1966a123dbeffa573657dfb1
2016-04-01 11:00:01 +11:00
Jonathan Watt 9480920b04 Bug 1263785 - Kill off the deprecated nsINode::GetCurrentDoc. r=baku 2016-03-31 12:46:32 +01:00
Jonathan Watt fb7bb15e68 Bug 1263782 - Kill off the deprecated nsINode::IsInDoc(). r=baku 2016-03-31 11:58:25 +01:00
Christoph Kerschbaumer 52a7f283b3 Bug 1256999 - Pass the right context to new channels for image loads. r=bz r=seth 2016-04-11 10:58:03 +02:00
Nicholas Nethercote d376f9f82e Bug 1260871 - Remove do_GetAtom() and rename NS_NewAtom() as NS_Atomize(). r=erahm.
do_GetAtom() is currently just a synonym for NS_NewAtom().

--HG--
extra : rebase_source : f4409784f931616cbc300591e6b843d30805c273
2016-03-29 10:09:43 +11:00
Cameron McCormack 72db41da62 Bug 1253788 - Don't reload inline chrome:// style sheets in nsXBLPrototypeResources. r=bzbarsky 2016-03-26 17:02:30 +11:00
Nicholas Nethercote 57f7f7948c Bug 1259182 - Shrink keyCodeData. r=bz.
This reduces static data size by 1480 B per process.

--HG--
extra : rebase_source : 74bb52af763cb96cd9a58a37d8adad9667dbb4db
2016-03-16 14:36:37 +11:00
Boris Zbarsky e3b2de6aa9 Bug 1255817 part 2. Get rid of AutoJSAPI::OwnsErrorReporting and AutoJSAPI::TakeOwnershipOfErrorReporting. r=bholley 2016-03-23 11:44:54 -04:00
Masayuki Nakano cea0b9cf02 Bug 1256589 part.6 Move the implementation of IsTrusted() from dom::Event to WidgetEvent r=smaug
MozReview-Commit-ID: 1SgMbTL8csl

--HG--
extra : rebase_source : 748fa8a594176edf7b2addd038b8031019d0dd35
extra : source : f4ce36e68ce06c405a6fab31facc120b94709aed
2016-03-17 16:01:30 +09:00
Masayuki Nakano 2748ab1e88 Bug 1256589 part.3 Move the implementation of StopCrossProcessForwarding() from dom::Event to WidgetEvent r=smaug
MozReview-Commit-ID: KXeVxCJ05Mo

--HG--
extra : rebase_source : 2f8d49412e32eec4a0a8f599984d057637f491a1
extra : source : a68c4bb4878612d61425d87a47b4eca78f271240
2016-03-22 16:01:46 +09:00
Masayuki Nakano 3af2033805 Bug 1154183 part.7 Don't dispatch preceding keydown events of reserved keypress events on content in the default event group r=smaug
MozReview-Commit-ID: 5zdkdfNxbxb
2016-03-22 15:05:25 +09:00
Masayuki Nakano ac1b2491bc Bug 1154183 part.6 Add nsXBLWindowKeyHandler::IsExecuteableElement() r=smaug
MozReview-Commit-ID: 8FyDzkfHihH
2016-03-19 23:16:21 +09:00
Masayuki Nakano 5b0e7ecdae Bug 1154183 part.5 Make nsXBLWindowKeyHandler::GetElementForHandler() use early return style r=smaug
MozReview-Commit-ID: CezO0rZBOEl
2016-03-19 23:12:39 +09:00
Masayuki Nakano d62ef1ba67 Bug 1154183 part.4 Implement nsXBLWindowKeyHandler::GetElementForHandler() r=smaug
MozReview-Commit-ID: 9qsOLU3QCnr
2016-03-18 11:25:22 +09:00
Masayuki Nakano 77166dd790 Bug 1154183 part.3 Clean up some variable names in nsXBLWindowKeyHandler::WalkHandlersAndExecute() r=smaug
MozReview-Commit-ID: 17fCUBwFf92
2016-03-18 11:25:08 +09:00
Masayuki Nakano 963976b46d Bug 1154183 part.1 Move shortcut/access key candidate list creators from nsContentUtils to WidgetKeyboardEvent r=smaug
MozReview-Commit-ID: Ied6qEUc2Kz
2016-03-18 11:22:37 +09:00
Boris Zbarsky 172598b4e2 Bug 1257335. Replace some AutoSafeJSContext uses with AutoJSAPI or AutoJSContext uses. r=bholley
In general, using an AutoJSAPI inited with an object is NOT the same as using
AutoSafeJSContext (or AutoJSAPI inited without an object) and then entering the
compartment of the object: the former will report exceptions to the global of
the object as it comes off the stack, while the latter will not.  This only
really matters if we have an object from a window or worker global and hence
might fire error events, or report internal stuff to the web console.

The changes to initing with an object made in this bug are OK for the following
reasons:

1) dom/base/Console.cpp: Always clears its exception before coming off the stack.
2) dom/base/nsDOMClassInfo.cpp: Inits with a non-web global.
3) dom/base/nsFrameMessageManager.cpp: Inits with a non-web global.
4) dom/media/MediaPermissionGonk.cpp: We probably want the caller to notice if
   anything here throws.
5) dom/xbl/nsXBLPrototypeBinding.cpp: Inits with a non-web global.
6) dom/xul/nsXULElement.cpp: Inits with a non-web global.
7) extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp: Inits with a non-web global.
8) ipc/testshell/XPCShellEnvironment.cpp: Inits with a non-web global.
2016-03-18 10:48:38 -04:00
Masayuki Nakano 10086a4e8d Bug 1203059 part.3 Installing and removing keyboard event listeners of nsXBLWindowKeyHandler should be done by the class itself r=smaug 2016-03-16 10:58:28 +09:00
Masayuki Nakano 86ac26d06f Bug 1203059 part.1 nsXBLWincowKeyHandler mark WidgetEvent::mFlags if it's reserved by chrome before the event is dispatched into the content r=smaug 2016-03-16 10:58:28 +09:00
Ryan VanderMeulen 46d20eff50 Bug 617653 - Re-enable the crashtest on e10s.
--HG--
extra : rebase_source : a022d3f34c7e015346f4907cad95dd7b8c113126
2016-03-11 18:30:06 -05:00
Boris Zbarsky 36d4079be7 Bug 1254847 part 3. Make AutoEntryScript always take ownership of error reporting. r=bholley 2016-03-09 19:02:03 -05:00
Peter Van der Beken 946ac27409 Bug 1251655 - Remove support for JavaScript-DOM-class and JavaScript-DOM-interface. r=bz.
--HG--
extra : rebase_source : 88c93e93905e20d2f6755d67d86902fdfc923eb4
2016-02-14 15:59:48 +01:00
Nathan Froyd 12d9670a60 Bug 1249389 - part 4 - make StartupCache::GetBuffer take a UniquePtr outparam; r=erahm
This change eliminates a number of nsAutoArrayPtr usages, as well as
making the pattern GetBuffer() -> NewObjectInputStreamFromBuffer more
pleasant.
2016-02-18 12:26:28 -05:00
Nathan Froyd f49b2c8d86 Bug 1249389 - part 2 - change NewBufferFromStorageStream's outparam into a UniquePtr; r=erahm
Similar to the previous change to NewObjectInputStreamFromBuffer, we
want to make the ownership transfer out of NewBufferFromStorageStream
more obvious.  Doing this also lets us get rid of some uses of
nsAutoArrayPtr, which is less idiomatic than UniquePtr.
2016-02-18 12:04:40 -05:00
Nathan Froyd cd3c15f774 Bug 1249389 - part 1 - change NewObjectInputStreamFromBuffer to take a UniquePtr argument; r=erahm
Because NewObjectInputStreamFromBuffer takes a raw pointer as input, the
typical coding pattern to use it is:

  nsAutoArrayPtr<char> buf;
  // assign something to buf
  nsresult rv = NewObjectInputStreamFromBuffer(buf, ...);
  if (NS_FAILED(rv)) {
    ...
    return rv;
  }
  buf.forget();

Which is clumsy, error-prone, and obscures the ownership transfer of the
pointer into the stream returned by NewObjectInputStreamFromBuffer.
Let's address all of these concerns by changing the argument to a
UniquePtr<char[]>.
2016-02-18 11:14:02 -05:00
Cameron McCormack 0ecd5593cc Bug 1244074 - Part 4: Use StyleSheetHandle instead of concrete style sheet class in most places. r=dholbert 2016-02-24 18:01:12 +11:00
Olli Pettay 3af8f71a7e Bug 1249428 - Unlink binding properly from element , r=mccr8
--HG--
extra : rebase_source : e549e1f2722173d2829c61a0c98c0d3c338379a5
2016-02-19 21:13:42 +02:00
Aidin Gharibnavaz 6863090c8a Bug 1235830 - Renaming GetInternalNSEvent to WidgetEvent, in nsIDOMEvent r=smaug
MozReview-Commit-ID: Hm8Owq17KXn

--HG--
extra : transplant_source : 2%82%D5%89%19%94%7C%E7%CA1%99%B5%24%1F5%E1%C0%1F%DE%07
2016-02-12 19:10:07 +03:30
Birunthan Mohanathas d7371d07d0 Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-02-02 17:36:30 +02:00
Phil Ringnalda d381b4bca6 Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray
CLOSED TREE

Backed out changeset d66c3f19a210 (bug 1235261)
Backed out changeset 467d945426bb (bug 1235261)
Backed out changeset 32b61df13142 (bug 1235261)
Backed out changeset c50bb8ed4196 (bug 1235261)
Backed out changeset 0ff0fa6fe81f (bug 1235261)
Backed out changeset df70e89669da (bug 1235261)
Backed out changeset 064969357fc9 (bug 1235261)
2016-01-31 10:10:57 -08:00
Birunthan Mohanathas 373593275e Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-01-31 17:12:12 +02:00
Kyle Huey 91efc5a86c Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
Tom Schuster 4d6aaf2f25 Bug 1242214 - Rename JSPropertyDescriptor JS::PropertyDescriptor everywhere else. r=smaug 2016-01-28 11:28:04 +01:00
Terrence Cole eff749c612 Bug 1234862 - Part 1: Rename GCMethods to BarrierMethods; r=sfink
--HG--
extra : rebase_source : a773cf25e8e9986a154b8a8b0d04c6b9267545b8
2015-12-28 10:11:40 -08:00
Aidin Gharibnavaz e6606278c0 Bug 1230216 - Changing nsIDOM*Event interfaces so that they don't inherit nsIDOMEvent. r=smaug
All the event interfaces changed except for nsIDOMUIEvent and its inheritors.

--HG--
extra : transplant_source : %A5U%3F%80%2B%DD%01%F4%D8%21%F2%E9z%C1%D6%AA%CC%D4%EC%F8
2016-01-12 07:49:08 +03:30
Birunthan Mohanathas 399934f259 Bug 1217307 - Remove some unnecessary null checks in rest of dom/. r=njn 2015-11-19 09:13:49 +02:00
Nicholas Nethercote e99bb13f2e Bug 1187781 (part 5) - Replace nsBaseHashtable::EnumerateRead() calls in dom/xbl/ with iterators. r=mrbkap.
--HG--
extra : rebase_source : e5979d0a665048ce4dade42db4da7e9c86911d47
2015-11-15 15:28:57 -08:00
Nicholas Nethercote cbe61a9761 Bug 1187781 (part 4) - Replace nsBaseHashtable::EnumerateRead() calls in dom/xbl/ with iterators. r=mrbkap.
--HG--
extra : rebase_source : 7b6d6a69626b52c019ef2b5bdc9f80fd9f1c0e47
2015-11-15 15:24:38 -08:00
Nicholas Nethercote 623ee6ff1e Bug 1187781 (part 3) - Replace nsBaseHashtable::EnumerateRead() calls in dom/xbl/ with iterators. r=mrbkap.
--HG--
extra : rebase_source : 267f220e498d279e5397372d313cea2779258f4a
2015-11-15 14:58:50 -08:00
Nicholas Nethercote 5d476a7a03 Bug 1187781 (part 2) - Replace nsBaseHashtable::EnumerateRead() calls in dom/xbl/ with iterators. r=mrbkap.
--HG--
extra : rebase_source : 5248a9b05e2553c890f5d775ce830147dc233dfa
2015-11-15 14:55:10 -08:00
Nicholas Nethercote d6100413c6 Bug 1187781 (part 1) - Replace nsBaseHashtable::EnumerateRead() calls in dom/xbl/ with iterators. r=mrbkap.
--HG--
extra : rebase_source : bc7849aa54f110afedb3dcff6ef1bb9197eacbdb
2015-11-15 14:52:57 -08:00
Neil Rashbrook 95afcd7585 Bug 1211708 Allow themes to specify XBL bindings even in unprivileged documents r=sicking 2015-11-04 22:31:46 +00:00
Birunthan Mohanathas 9985829ecc Bug 1219392 - Capitalize mozilla::unused to avoid conflicts. r=froydnj 2015-11-02 07:53:26 +02:00
Ryan VanderMeulen 028dec7cc8 No bug - Various crashtest manifest cleanups.
--HG--
rename : dom/base/crashtests/713417.html => dom/base/crashtests/713417-1.html
rename : dom/workers/test/1158031.html => dom/workers/test/crashtests/1158031.html
rename : dom/workers/test/779707.html => dom/workers/test/crashtests/779707.html
rename : dom/workers/test/943516.html => dom/workers/test/crashtests/943516.html
rename : dom/workers/test/crashtests.list => dom/workers/test/crashtests/crashtests.list
rename : layout/generic/crashtests/812879.html => layout/generic/crashtests/812879-1.html
rename : layout/generic/crashtests/first-letter-638937.html => layout/generic/crashtests/first-letter-638937-1.html
extra : rebase_source : b9274dc6870030ed62bcee35350d566160502869
2015-10-31 19:35:27 -04:00
Ryan VanderMeulen 397e16525b Bug 429586 - Remove assertion annotations that are no longer needed and add crashtest. 2015-10-30 19:41:18 -04:00
Shu-yu Guo d68a20c4a7 Bug 932517 - Treat let as a contextual keyword in sloppy mode and make it versionless. (r=jorendorff) 2015-10-27 20:13:17 -07:00
Kyle Huey c7d3c4e21a Bug 1216401: Eviscerate nsIDOMWindow, move still needed methods to nsPIDOMWindow. r=bz 2015-10-26 14:37:32 -07:00
Cameron McCormack 2f1046d287 Bug 1216043 - Rename nsStyleSheet::sheetType and make it an enum class. r=dbaron
The only substantive change here, apart from a few variables changing in
size from uint16_t to uint8_t, is FontFaceSet's use of SheetType::Unknown
(0xFF) instead of 0 for FontFaceRecords for script-created FontFaces.
2015-10-20 10:16:20 +11:00
Ehsan Akhgari ecda739d3e Bug 1216177 - Remove the remaining nsRefPtr forward declarations; r=froydnj 2015-10-19 12:02:14 -04:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Tooru Fujisawa 7431783521 Bug 1207494 - Part 14: Remove use of expression closure from dom/xbl/. r=bz
--HG--
extra : commitid : GBNpwrxxzil
extra : rebase_source : 1527a44b38903617ae9559aa4704ca3b2e228c57
2015-09-23 18:39:17 +09:00
Jason Orendorff deb2270515 Bug 1054756, part 5 - Remove Class::convert.
--HG--
extra : commitid : 6KCxWrCseSZ
extra : rebase_source : 63f3cd6ec1ade43c732ffd9b661fe6f2dca9eb4b
2015-03-20 16:28:59 -05:00
Neil Deakin 2d636ad4b5 Bug 1180761, cancel the event earlier so that space doesn't trigger checkbox change and scroll, r=neil 2015-09-29 14:49:32 -04:00