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

84 Коммитов

Автор SHA1 Сообщение Дата
Boris Zbarsky 09bd9b6dd3 Bug 1455055 part 5. Clean up HandleEvent implementations in dom/xbl. r=masayuki
MozReview-Commit-ID: 1DOlnGP4Sri
2018-04-20 00:49:29 -04:00
Boris Zbarsky 2b6097ae6d Bug 1455055 part 1. Convert nsIDOMEventListener to taking an Event, not an nsIDOMEvent. r=masayuki
This does no cleanup other than what's needed to compile.  Cleanup coming up in
later patches.

MozReview-Commit-ID: 3sOnkj71n09
2018-04-20 00:49:29 -04:00
Emilio Cobos Álvarez e128bf7b1a Bug 1447827: Remove ServoRestyleManager. r=xidorn
MozReview-Commit-ID: CFafQsb4rQn
2018-04-07 15:50:06 +02:00
Xidorn Quan 4cf9aed667 Bug 1449400 part 5 - Remove StyleSetHandle. r=emilio
This patch basically does:
* remove StyleSetHandle and its corresponding files
* revisit #includes of related header files and change correspondingly
* change nsIPresShell::mStyleSet to be UniquePtr<ServoStyleSet>
* change the creating path of ServoStyleSet to pass UniquePtr
* change other mentions of StyleSetHandle to ServoStyleSet*
* remove AsServo() calls on ServoStyleSet

Some unfortunate bits:
* some methods of (Servo)StyleSet only accepts ServoStyleSheet while
  many places call into the methods with StyleSheet, so there are many
  ->AsServo() added to sheets

MozReview-Commit-ID: K4zYnuhOurA

--HG--
extra : rebase_source : 459e8efeb171adad089d94272e143e8c244bd279
extra : source : 65ba2f174fcf7dba4e59c00ee8908b1bd0820a48
2018-03-29 22:15:46 +11:00
Xidorn Quan d9cb92544e Bug 1447828 part 2 - Remove StyleBackendType uses from nsXULPrototypeCache. r=emilio
MozReview-Commit-ID: 1tYFBTk9BqF

--HG--
extra : rebase_source : 72c783c84ff36fddd6d49e79e7912f42bb0c11a8
extra : source : 4972e279ef76127e4898874478fcbd75c9631d76
2018-03-29 02:31:23 +11:00
Emilio Cobos Álvarez 8fcda0e92d Bug 1448690: Remove IsStyledByServo. r=xidorn
MozReview-Commit-ID: I3MDbo2Yu7d
2018-03-26 09:39:26 +02:00
Emilio Cobos Álvarez e341b20ec4 Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE
MozReview-Commit-ID: JPopq0LudD
2018-03-22 20:06:24 +01:00
Emilio Cobos Álvarez 5dd797f154 Back out changeset b683bb3f22a1 (Bug 1447483) for not landing with all the files. r=me on a CLOSED TREE
This reverts commit 1808914126bb9f9e4a82d2c3d7ac961885fe7d62.

MozReview-Commit-ID: 5skESBseEvo
2018-03-22 20:05:22 +01:00
Emilio Cobos Álvarez ca5ac79cca Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt
MozReview-Commit-ID: JPopq0LudD
2018-03-22 19:48:42 +01:00
Emilio Cobos Álvarez c03ffd9c62 Bug 1425759: Simplify the style backend type setup. r=bholley
Now that what we use to decide whether a document is styled by Servo are only
prefs and the doc principal, we don't need to inherit the style backend type,
since unless the pref has changed, the result will be the same.

MozReview-Commit-ID: KBmeBn1cRne
2018-02-27 12:39:20 +01:00
Andrea Marchesini c6da271117 Bug 1425458 - Resource timing entries Workers - part 0 - NS_NewChannel, r=smaug
* * *
Bug 1425458 - Resource timing entries Workers - part 10 - Correct parameters in NS_NewChannel in nsDataObj.cpp, r=me
2018-01-24 17:17:31 +01:00
Brindusan Cristian 368c3d5b6b Backed out 12 changesets (bug 1425458) for mochitest failures on WorkerPrivate.cpp on a CLOSED TREE
Backed out changeset 11997de13778 (bug 1425458)
Backed out changeset 100b9d4f36bc (bug 1425458)
Backed out changeset a29e9dbb8c42 (bug 1425458)
Backed out changeset b96d58fd945c (bug 1425458)
Backed out changeset f140da44ba68 (bug 1425458)
Backed out changeset af56400233d9 (bug 1425458)
Backed out changeset 7034af4332e4 (bug 1425458)
Backed out changeset f70500179140 (bug 1425458)
Backed out changeset 793bbfc23257 (bug 1425458)
Backed out changeset 2efb375a8ffc (bug 1425458)
Backed out changeset 07e781e37451 (bug 1425458)
Backed out changeset e875f3702a5f (bug 1425458)
2018-01-24 20:47:48 +02:00
Andrea Marchesini 6480b95ba3 Bug 1425458 - Resource timing entries Workers - part 0 - NS_NewChannel, r=smaug 2018-01-24 17:17:31 +01:00
Emilio Cobos Álvarez 74b31155f7 Bug 1423167: Move most attribute-related methods from nsIContent to Element. r=bz
MozReview-Commit-ID: 6WXqNiODttD
2017-12-06 16:05:59 +01:00
Emilio Cobos Álvarez f14389a065 Bug 1422654: stylo: Avoid restyling XBL-bound element if the binding doesn't have stylesheets. r=heycam
MozReview-Commit-ID: An2McUbpCLk

--HG--
extra : rebase_source : 1c869057d032773fbfd426d6f392cc936c81029c
2017-12-04 02:47:54 +01:00
Brindusan Cristian 9f3bd430c2 Merge inbound to mozilla-central a=merge r=merge 2017-11-28 11:50:57 +02:00
Dave Townsend 27380b996e Bug 1404420: Add custom element support to XUL. r=edgar, r=smaug
MozReview-Commit-ID: BietEX2gOoG

--HG--
extra : rebase_source : 6fd9a732a21f2c048d37c3f7139cd18503148767
2017-10-10 15:25:10 -07:00
Emilio Cobos Álvarez 0b063ef01a Bug 1420496: Bring back the optimization to avoid traversing XBL subtrees that will likely change. r=heycam
We need to get rid of BindingHolder to handle properly the case of an invalid
binding URL.

MozReview-Commit-ID: 3sIGtcVOt0r

--HG--
extra : rebase_source : a56cebc74ff5f3102ee8ef6d048ad05056fbef41
2017-11-24 15:15:38 +01:00
Emilio Cobos Álvarez 2d847bd8de Bug 1418456: followup: undo last-minute cleanup that busts the build. r=me
MozReview-Commit-ID: LmIeW4SMz7B
2017-11-20 13:07:53 +01:00
Emilio Cobos Álvarez 6de5cb4bf8 Bug 1418456: Get rid of unstyled children only traversals. r=heycam
They're useless now, provided we remove the hack to not traverse XBL-bound
elements on initial styling.

This also allows us to get rid of the fallback case.

MozReview-Commit-ID: AvBVdyF1wb6
2017-11-20 13:05:35 +01:00
Emilio Cobos Álvarez 3d003a48ea Bug 1418456: Clear subtree element data when applying an XBL binding. r=heycam
We not only need to care about children getting inserted in the flat tree, but
also about children moving _out_ of the flat tree.

In particular, as of right now we may leave stale data on elements when they
disappear from the flattened tree.

We're lucky enough that in 99% of the situations we enter in[1] and that clears
all the stuff, including servo data. But my assertions for bug 1414999 caught
the template / observes case.

Thus, just clear the whole bound element subtree data, and restyle it in the
end, no need for StyleNewChildren. This matches what we do for shadow DOM
(though in the shadow DOM case we do it async in DestroyFramesForAndRestyle).

[1]: https://searchfox.org/mozilla-central/rev/9bab9dc5a9472e3c163ab279847d2249322c206e/dom/xbl/nsXBLBinding.cpp#368

MozReview-Commit-ID: 69A0aR0AFfU
2017-11-20 13:02:24 +01:00
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
Andrea Marchesini 6626e900f9 Bug 1409327 - NS_NewBufferedInputStream should take the ownership of the inputStream, r=smaug 2017-10-19 11:39:30 +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
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
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
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
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
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
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 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
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
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
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
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
Andrea Marchesini 5994c71158 Bug 1301251 - Handle GetSpec() failure in nsContentUtils::GetWrapperSafeScriptFilename(), r=smaug 2016-09-19 15:50:22 +02: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
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
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
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
Jonathan Watt 9480920b04 Bug 1263785 - Kill off the deprecated nsINode::GetCurrentDoc. r=baku 2016-03-31 12:46:32 +01: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
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