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

18900 Коммитов

Автор SHA1 Сообщение Дата
Kris Maglione 8d585408dc Bug 1473631: Part 0b - Add helper for registering instance methods as pref callbacks. r=njn
I also tried to avoid this change but, again, given the number of times I was
repeating the same pattern of defining a static method just to forward a
callback to an instance method, decided it was probably necessary. Without an
easy way to do this, people are more likely to register observers rather than
callbacks, for which we'll wind up paying a continued memory and performance
penalty.

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

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

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

MozReview-Commit-ID: 10N3R2SRtPc

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

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

MozReview-Commit-ID: 9tLKBe10ddP

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

--HG--
extra : rebase_source : 0c742f6ca29456928f2027dcb70ee6dbb130d1f9
2018-07-04 19:06:57 -07:00
Emilio Cobos Álvarez 8805f43898 Bug 1473813: Don't make pseudo-elements replaced by content: url(..). r=bz
Differential Revision: https://phabricator.services.mozilla.com/D1996
2018-07-16 18:06:39 +02:00
Emilio Cobos Álvarez 0da3dae9c9 Bug 1472403: Simplify generated image content. r=bz,dholbert
This way we reuse the same machinery everywhere for the content property.

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

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

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

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

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

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

MozReview-Commit-ID: 1pAzIvRRVnL
2018-07-16 18:06:38 +02:00
shindli ba72001f71 Backed out 2 changesets (bug 1473813, bug 1472403) for bustages in /builds/worker/workspace/build/src/dom/base/MessageSender.cpp:24:19 on a CLOSED TREE
Backed out changeset 93e4dff7e346 (bug 1473813)
Backed out changeset 365a0841117a (bug 1472403)
2018-07-16 18:45:33 +03:00
Emilio Cobos Álvarez 7d861904c9 Bug 1473813: Don't make pseudo-elements replaced by content: url(..). r=bz
Differential Revision: https://phabricator.services.mozilla.com/D1996
2018-07-16 17:30:15 +02:00
Emilio Cobos Álvarez 966f1a9206 Bug 1472403: Simplify generated image content. r=bz,dholbert
This way we reuse the same machinery everywhere for the content property.

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

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

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

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

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

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

MozReview-Commit-ID: 1pAzIvRRVnL
2018-07-16 17:30:14 +02:00
Daniel Holbert 76f667e72e Bug 1462983: Check for redundant "loaded" messages from opened window, in test_bug607529.html. r=bz
Such messages happen intermittently on Android, presumably from bfcache being
purged due to memory pressure (which would then cause the back() operation
behave like a fresh load).  So on Android, we'll now treat these redundant
messages as a "todo()" failure, to indicate that something went wrong but avoid
turning the testsuite orange.

MozReview-Commit-ID: GkaxB06vL7q

--HG--
extra : rebase_source : 64c0c0a41452d573062774b2300a26aad179b309
2018-07-13 08:38:52 -07:00
Hiroyuki Ikezoe 9f85c749a3 Bug 1475769 - Bail out from nsRefreshDriver::Tick before updating mMostRecentRefresh when the refresh driver is waiting for paint. r=mattwoodrow
Before this patch, there is a race condition that the refresh driver updates
the most recent refresh time but animations corresponding to the refresh driver
don't update their internal state, that causes the inconsistency that such
animations are regarded as finished on the most recent time whereas their
internal states represent the animations are still in active.  This is the one
of the cause of bug 1466010, i.e. the display item corresponding to the
animation is going to be rebuilt without calling MarkNeedsDisplayItemRebuild.

MozReview-Commit-ID: 9adzDV9E3ka

--HG--
extra : rebase_source : 7120e9f462309d1c4efe995ef64aeead9e29ff8f
2018-07-15 20:19:29 +09:00
Andreea Pavel 10d4df5aa9 Backed out 3 changesets (bug 1459937) for failing crashtest with Assertion failure: (IndexInFlow(aOldParent) < IndexInFlow(aNewParent)) on a CLOSED TREE
Backed out changeset 2cff5c67d000 (bug 1459937)
Backed out changeset fb3fba19e615 (bug 1459937)
Backed out changeset bd4bd8ac335c (bug 1459937)
2018-07-15 10:06:23 +03:00
Gerald Squelart 51058bcdb8 Bug 1459937 - Mark pulled lines (from n-i-f or overflow) dirty - r=dbaron
Lines pulled from next-in-flow or overflow frames have probably not been marked
dirty (as ReflowInput hasn't dealt with them when it was constructed), so we
need to mark them dirty for proper reflow.

If we don't do that, and they don't fit in the current column, the next column
will only mark its current children dirty, so when pulling back its first lines
from the previous column they will not be reflowed as needed, which causes this
bug.

MozReview-Commit-ID: 8GFO1ZWuZ1b

--HG--
extra : rebase_source : 0198b291a1b50441188e050dd5bcb2c06694df81
2018-07-09 11:42:47 +10:00
Ting-Yu Lin 5f1b665033 Bug 1286882 - Make SVG basic shape elements unselectable. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D2038

--HG--
extra : moz-landing-system : lando
2018-07-13 18:01:48 +00:00
Mike Conley 8fa1ee6473 Bug 1471107 - Get rid of assertion and handle the already-unsuppressed displayport case in PresShell. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D2130

--HG--
extra : moz-landing-system : lando
2018-07-13 17:31:00 +00:00
Tanushree Podder e8cc1dc6df Bug 1470267 - Store the visual viewport offset in nsIPresShell. r=botond
Added a data member to nsIPresShell to store the visual viewport offset. APZ
will update the visual viewport offset in the presShell for root scroll frames
on every repaint request.

MozReview-Commit-ID: Ksou43hrE6H

--HG--
extra : rebase_source : 812c88efc7556c4bff2a62834cfaaec6e6945093
2018-07-11 17:24:56 -04:00
Daniel Holbert 754824a1ae Bug 1462983 diagnostic: when test_bug607529.html fails JSON.parse operation, print the string that it choked on. r=bz
MozReview-Commit-ID: G8O0GP7VpFQ

--HG--
extra : rebase_source : c078e34862b3b21abd91fc8cb66b2ad4aefcc97c
2018-07-12 09:48:22 -07:00
Margareta Eliza Balazs 88a3947938 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-07-12 12:33:01 +03:00
Bogdan Tara ccc435c216 Backed out changeset 2de43bdd92a8 (bug 1286882) for failures on test_text_selection.html CLOSED TREE 2018-07-12 05:23:44 +03:00
Ting-Yu Lin 5cb4683f78 Bug 1286882 - Make SVG basic shape elements unselectable. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D2038

--HG--
extra : moz-landing-system : lando
2018-07-12 00:42:51 +00:00
Andi-Bogdan Postelnicu 5e3e0d4498 Bug 1453795 - Layout - Initialize member fields in classes/ structures. r=dbaron 2018-07-12 09:42:14 +03:00
Gurzau Raul fff6ccd0b0 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-07-12 01:08:09 +03:00
Jan de Mooij 4f7b2378dc Bug 1474273 - Add xpc::CurrentNativeGlobal and use it instead of NativeGlobal(JS::CurrentGlobalOrNull(cx)). r=bz 2018-07-11 14:07:02 +02:00
Cameron McCormack 8d5efb0c93 Bug 1473450 - Remove angle values from image-orientation. r=emilio
MozReview-Commit-ID: FB74ILJM6Fm

--HG--
extra : rebase_source : 0902aff63e0db070d2fdda3568453975f752b988
2018-07-05 12:04:58 +10:00
Kashav Madan ext:(%2C%20Tanushree%20Podder%20%3Ctpodder%40mozilla.com%3E) 557bb0376f Bug 1423011 - Part 1: Allow APZ to async-scroll the layout viewport. r=botond
There are 3 main components to this change:

  a) Store the origin of the layout viewport in APZ (until now we only stored
     it's size). This required updating the offset stored in mViewport, which
     was previously (0, 0).
  b) Adjust the layout viewport in APZ each time the visual viewport exceeds
     the bounds of the layout viewport.
  c) Update the main thread to store the layout viewport offset for the
     RCD-RSF (currently it uses the layout viewport offset for overflow:hidden
     pages, and the visual viewport offset otherwise).

MozReview-Commit-ID: 7AD8wvthh2m

--HG--
extra : rebase_source : df8704146740f4b2522c80b20b603617993b6c83
2018-06-07 17:01:36 -04:00
Kartikaya Gupta 38ef244612 Bug 1475022 - Make aRelativeTo argument const. r=mattwoodrow
MozReview-Commit-ID: HIe5ShwTvqQ

--HG--
extra : rebase_source : 732745c5ca4ed6f252b7f5acc531c3946b9ff5fb
2018-07-11 16:12:50 -04:00
Hiroyuki Ikezoe 95a7be33f5 Bug 1474721 - Drop epoch times in nsRefreshDriver. r=bz
These epoch times were introduced for beforepaint event in bug 569520, and
haven't used since we dropped mozRequestAnimationFrame in bug 909154.

MozReview-Commit-ID: CGOGeH0rrdi

--HG--
extra : rebase_source : 43905538a39c9618d95cc0513f3ffa2cf813a970
2018-07-11 06:15:00 +09:00
Andreea Pavel 721e84c658 Backed out changeset 641b02da5961 (bug 1473450) for failing xpchsell and mochitest on a CLOSED TREE 2018-07-10 09:28:59 +03:00
Matt Woodrow 1d8fbc442e Bug 1456111 - Make sure an empty pixel rectangle gets converted to an empty app unit rectangle, regardless of scale factor. r=tnikkel
MozReview-Commit-ID: GGl7ul6aka1

--HG--
extra : rebase_source : 07b620feaa3362b7fb610ba56dbf26d2d1f9c47a
2018-07-10 17:53:22 +12:00
Cameron McCormack e2ce31efc1 Bug 1473450 - Remove angle values from image-orientation. r=emilio
MozReview-Commit-ID: FB74ILJM6Fm

--HG--
extra : rebase_source : 8c13a67086aedad73a642b5125bbb44f48068f5d
2018-07-05 12:04:58 +10:00
Matt Woodrow c1d6c26906 Bug 1466638 - Implement support for ContainerLayerParameters::mOffset in nsDisplayImageContainer. r=mstange
This gets set to a non-zero value when we have an inactive ContainerLayer ancestor (filter in this case).
The current code assumes we'd never call BuildLayer on an image when that happen, but we force the pseudo-active
state here because background-position is animated (all properties have a transition).

MozReview-Commit-ID: 6pL8EJTNgWy

--HG--
extra : rebase_source : 6370fc79d5f47f0b5c4bbe86c0b605b90256b653
2018-07-09 16:11:08 +12:00
Matt Woodrow f06b4bd62c Bug 1458121 - Don't try to layerize when we have a clip-path mask as well as rounded rect clipping. r=mstange
MozReview-Commit-ID: GhOay2a6z9t

--HG--
extra : rebase_source : 2c3dcf4fe05046da1790a46fb96d7acdf7caf86c
2018-06-21 12:43:22 +12:00
Bas Schouten a15c335a75 Bug 1473376: Ensure hit test regions never grow excessively complex. r=kats 2018-07-04 18:52:10 +00:00
Brendan Dahl cba4aa7f3a Bug 1466897 - Rename nsIRootBox to nsIPopupContainer. r=mats
MozReview-Commit-ID: D4GgReAEelG

--HG--
rename : layout/xul/nsIRootBox.h => layout/xul/nsIPopupContainer.h
extra : rebase_source : 6670156e9958d6fb51860fe92bbb4ffbf5789267
2018-06-26 17:29:55 -07:00
Kris Maglione 3e400a8f72 Bug 1472523: Part 2 - Avoid unnecessary string copies in preference caches. r=njn
MozReview-Commit-ID: 74svGlwMVF1

--HG--
extra : rebase_source : ee25a335773b9afba9125c9092ed95eecc702cd9
2018-06-30 23:07:30 -07:00
Florian Quèze 3c68ddcf79 Bug 962528 - Update the UI resolution synchronously to avoid painting the UI once at the wrong resolution when moving a window across screens of different resolutions, r=mstange. 2018-07-04 16:31:03 +02:00
Gerald Squelart c601e3df86 Bug 1211330 - Removed CSS pref layout.css.unset-value.enabled - r=heycam
Feature is mature and doesn't need pref.
In fact, it was not used in code anymore, only in tests.

MozReview-Commit-ID: AbH8OCiksDa

--HG--
extra : rebase_source : b9a7d18b3c1b948f213632a16d2152f80d676068
2018-06-28 16:10:56 +10:00
Hiroyuki Ikezoe 5b05fdd61a Bug 1472076 - Introduce nsATimerAdjustmentObserver in nsRefreshDriver. r=birtles
mMostRecentRefresh is changed not only in Tick() but also in
EnsureTimerStarted().  In the case where it happens in Tick() refresh observers
can know it through WillRefresh(), but there is no way in the case of
EnsureTimerStarted().  This patch introduces a new abstract class to be notified
when mMostRecentRefresh was changed in EnsureTimerStarted() so that animations
can use the *real* most recent refresh time until the next tick happens.

The reason why we have another observer array in parallel with existing array
(mObservers) is that the refresh driver should stop the timer if there is no
normal observes but there are still any timer adjustment observes.

MozReview-Commit-ID: FaDcl5GrvI3

--HG--
extra : rebase_source : a6a362366f4eda9fb51003ef4cff5bea886836f0
2018-07-03 10:57:12 +09:00
Ciure Andrei 177ceadc18 Backed out 3 changesets (bug 1466897) for xpcshell failures test_ext_schemas_interactive.js and test_ext_contentscript_create_iframe.js CLOSED TREE
Backed out changeset 87bb8b686a7e (bug 1466897)
Backed out changeset 4443f1f6e8f3 (bug 1466897)
Backed out changeset 067ee6342782 (bug 1466897)

--HG--
rename : layout/xul/nsIPopupContainer.h => layout/xul/nsIRootBox.h
2018-07-03 06:03:15 +03:00
Matt Woodrow 7391f4b580 Bug 1467688 - Make sure we invalidate for perspective changes even if the frame isn't otherwise transformed. r=dbaron
MozReview-Commit-ID: JQGb41kp76P

--HG--
extra : rebase_source : f9105e949f8fa02697a94718ea69742ac115f8e6
2018-07-02 21:35:14 -04:00
Brendan Dahl 79c6912c4e Bug 1466897 - Rename nsIRootBox to nsIPopupContainer. r=mats
MozReview-Commit-ID: D4GgReAEelG

--HG--
rename : layout/xul/nsIRootBox.h => layout/xul/nsIPopupContainer.h
extra : rebase_source : 5f4c2f2da75bac4f499a23cecc368e996991c6fe
2018-06-26 17:29:55 -07:00
Ciure Andrei a43e1b09ad Backed out 1 changesets (bug 1467688) for reftest failures crashtests/1467688.html CLOSED TREE
Backed out changeset b976829f826a (bug 1467688)
2018-07-03 01:55:17 +03:00
Matt Woodrow dc37a6b69c Bug 1467688 - Make sure we invalidate for perspective changes even if the frame isn't otherwise transformed. r=dbaron
MozReview-Commit-ID: DpND8Jwr226

--HG--
extra : rebase_source : c6f51b9e8f91978a1783eb27de5ca89f75a3f2a5
2018-07-02 17:46:10 -04:00
Olli Pettay f3c69361dc Bug 1472430, PresShell::RenderNode should work with elements in Shadow DOM, r=emilio 2018-07-01 22:29:42 +03:00
Simon Montagu a16336fd91 Bug 827192 - Add a crashtest. r=mats 2013-01-30 01:13:02 -08:00
Simon Montagu af9a205460 Bug 989994 - Add tests. r=mats 2014-04-25 00:03:49 -07:00
Emilio Cobos Álvarez fac54cd7df Bug 1472443: Make StyleContentType an enum class. r=xidorn
Most of it is automated by:

  %s/eStyleContentType_/StyleContentType::/g
  %s/nsStyleContentType/StyleContentType/g

But I removed some parentheses by hand.

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

MozReview-Commit-ID: 3IcirjIYX5p
2018-06-30 17:13:07 +02:00
Andreea Pavel 91a9c110e2 Merge mozilla-inbound to mozilla-central. a=merge 2018-06-30 12:49:32 +03:00
Emilio Cobos Álvarez c4900d4847 Bug 215083: Fix CreateContinuingFrame to account for non-nsImageLoadingContent image frames. r=heycam
MozReview-Commit-ID: CLx3siPe4Cx
2018-06-30 03:45:12 +02:00
Emilio Cobos Álvarez 6d73d28803 Bug 215083: Implement content: url(..) for elements. r=tnikkel,dholbert
Dynamic changes are handled correctly because content property changes already
cause a reframe.

This implements the same bits as Blink / WebKit do (single content item which is
an image, otherwise gets ignored), except for the edge cases where you use this
on an image.

In order to handle the edge cases right, we completely isolate the
nsImageLoadingContent usage based on `mKind`.

Blink's and WebKit's behavior there makes no sense and it's erratic, what I
implemented is consistent (we apply to images as long as they don't generate a
box, and we don't look at alt text or broken icons), though I'll update to
whatever the WG decides in https://github.com/w3c/csswg-drafts/issues/2831 /
https://github.com/w3c/csswg-drafts/issues/2832.

I don't think it matters in terms of web compat in any case.

MozReview-Commit-ID: JUurhC60hWr
2018-06-30 03:45:13 +02:00
Mats Palmgren e9805c3053 Bug 1470260 part 2 - Make RefreshDriverTimer ref-counted and hold a strong ref on it on the stack when nsRefreshDriver::Tick can be reached. r=emilio 2018-06-30 01:08:54 +02:00