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

151 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez e128bf7b1a Bug 1447827: Remove ServoRestyleManager. r=xidorn
MozReview-Commit-ID: CFafQsb4rQn
2018-04-07 15:50:06 +02:00
Emilio Cobos Álvarez b508e66696 Bug 1447827: Move members from ServoRestyleManager to RestyleManager. r=xidorn
This leaves ServoRestyleManager as just a typedef.

MozReview-Commit-ID: 5wfTkiDc2Nr
2018-04-07 15:40:00 +02:00
Xidorn Quan 0401ef821e Bug 1447828 part 1 - Remove StyleBackendType uses from dom/animation. r=emilio
MozReview-Commit-ID: 3INWUuocNPm

--HG--
extra : rebase_source : 1e024084e325b075b3c1b534b544092d7f792e2e
extra : source : 1bcf22436ced3f5b2afd6a7db4250ff5b79f71c0
2018-03-29 02:29:42 +11:00
Jonathan Watt 68e78b291f Bug 1449321 - Remove the IsServo and IsGecko methods from the style system code. r=emilio
--HG--
extra : source : 763277b299e42d8ee7eafede027ee690b66a7a2a
2018-03-23 16:01:34 +00: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 f7522ae728 Bug 1447358: Unifdef the old style system code. r=jwatt
Summary:
This has been automatically generated using:

  http://dotat.at/prog/unifdef/

And:

find $OBJDIR -type f -name '*.h' |
while read FILE; do
  echo "$FILE"
  unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE";
done

find $OBJDIR -type f -name '*.cpp' |
while read FILE; do
  echo "$FILE"
  unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE";
done

MozReview-Commit-ID: I4NdKqbMXzJ

Reviewers: jwatt

Bug #: 1447358

Differential Revision: https://phabricator.services.mozilla.com/D779
2018-03-21 10:20:34 +01:00
Hiroyuki Ikezoe e6806e41d7 Bug 1444221 - #ifdef out some animation related stuff for MOZ_OLD_STYLE. r=xidorn
MozReview-Commit-ID: 9VC4qUbO6uK

--HG--
extra : rebase_source : 79113eb99cd784dc9a591bb9529381a932f07f97
2018-03-09 07:09:44 +09:00
Hiroyuki Ikezoe 0ca9f2c309 Bug 1417354 - Add a method to clear all pending restyle requests for a given element and its pseudos. r=birtles
MozReview-Commit-ID: DZkbwUPiPTd

--HG--
extra : rebase_source : b1993ea863a261841be1edfc3b2dee7655123fe8
2018-02-21 07:00:20 +09:00
Cameron McCormack d02e54b79b Bug 1430014 - Part 5: Stop building old style system classes when MOZ_OLD_STYLE is not defined. r=xidorn
MozReview-Commit-ID: CIHyPdF7Exl

--HG--
extra : source : 78a2fc781eead47af3923efcde58569c5d882ab1
2018-02-01 15:04:04 +11:00
Cameron McCormack cc7db5c40c Bug 1430014 - Part 4: #ifdef out unnecessary code when the old style system is not built. r=xidorn
MozReview-Commit-ID: 1FZ9VzjcPzN

--HG--
extra : source : de22d220635f8c059834b76f769d5215ab1a8b5b
2018-02-01 15:04:04 +11:00
Hiroyuki Ikezoe 4d9188d86d Bug 1433846 - Drop nsComputedDOMStyle::GetPresShellForContent(), use nsContentUtils::GetPresShellForContent(). r=xidorn
MozReview-Commit-ID: JcpEpqP32Yi

--HG--
extra : rebase_source : dc3649c882f7edd36f9dbc3463d186517b18bdc1
2018-01-29 14:19:25 +09:00
Jonathan Watt ab7efc9dbb Bug 1417365 - Unified build issues in dom/animation. r=baku 2017-10-26 11:55:28 +01:00
Emilio Cobos Álvarez f3053729c9 Bug 1406750: Fix detection of animations to avoid flushing. r=hiro,birtles
This fixes multiple things:

 * EffectCompositor was using the light tree instead of the flat tree.

 * When we insert an element inside the document, we may not style it right away
   (we mark it for lazy frame construction with the NODE_NEEDS_FRAME). Since we
   trigger animations and transitions from the traversal, we can't skip flushing
   if we call getComputedStyle on any of those.

MozReview-Commit-ID: DpAhmLH3uJ2
2017-10-25 19:02:01 +02:00
Nicholas Nethercote d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

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

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Wei-Cheng Pan f3f406f76b Bug 1363805 - Part 3: Do lazy flushing if possible. r=heycam
Skips flushing current document if the target of getComputedDOMStyle cannot be
affected by any pending restyles.

MozReview-Commit-ID: C87HDIDvOth

--HG--
extra : rebase_source : 064880493f9aac2599689cdd0749200bb579c60b
2017-05-23 12:02:11 +08:00
Hiroyuki Ikezoe 37c05393f5 Bug 1398661 - Convert target element to the parent if the target element is pseudo in EffectCompositor::PreTraverseInSubtree/PreTraverse. r=emilio
MozReview-Commit-ID: Dl2gvkLpo4k

--HG--
extra : rebase_source : a741b8d1e10e111ab8255e50a56ad11041fe39f9
2017-09-14 06:22:40 +09:00
Hiroyuki Ikezoe 84aff91995 Bug 1336772 - Request any restyles required by changes to the cascade result. r=birtles
When an animation is newly created while the same property transition is
running, the transition style rule persists until we call RequestRestyle() for
transitions level. That means if user calls getComputedStyle for the property
right after creating animation, the style obtained by getComputedStyle still
included the transitions level rule. As a result, the transitions level style
overrides newly created animation style until the next normal restyling process
happens (i.e. process transition level restyle request). Vice versa, in the
case where an animation is removed, transitions level style does not appear
until the next normal restyling.

This patch fixes this problem by trigerring a resyle of the transitions level
when an animation is created or removed.

MozReview-Commit-ID: HY6amLmDHTi

--HG--
extra : rebase_source : 67e58dc9a6c695299c3eef684bf7357153c5168b
2017-09-05 16:34:24 +09:00
Emilio Cobos Álvarez bf24bd8bc9 Bug 1395351: Use the style flattened tree in EffectCompositor::PreTraverseInSubtree. r=bholley
MozReview-Commit-ID: ATVxx8EXJWY

--HG--
extra : rebase_source : 8652e3f24335e5850ea7abae41e57a2397966d57
2017-09-01 19:28:01 +02:00
Hiroyuki Ikezoe fb03af5d7d Bug 1388031 - Process normal traversal for throttled animation flush as well. r=bholley
MozReview-Commit-ID: BirD8BDMifp
2017-08-11 20:34:06 -07:00
Manish Goregaokar f33beecc59 Bug 1367904 - Part 10: stylo: Switch Gecko over to ServoStyleContext; r=bholley
MozReview-Commit-ID: EmopKVjEzlz
2017-07-17 21:00:46 -07:00
Brian Birtles 4ec9d9a3c9 Bug 1370123 - Skip restyling elements in documents without a pres shell; r=heycam
The previous patch takes the approach that we should simply not add elements in
documents without a pres shell to EffectCompositor's set of elements to restyle.
However, there exists a case where we might have an element in a displayed
document, then we might tickle it so that it requests an animation restyle, and
then move it to a document without a browsing context. In that case we should
skip the element when we next do animation restyles.

However, even if we successfully skip the element in the document without a pres
shell, we need to make sure it eventually gets removed from the set of elements
to restyle rather than simply remaining there forever. For that reason this
patch makes us unconditionally clear the set of elements to restyle whenever we
do a full restyle from the root.

This patch also adds a test case to trigger the scenario outlined in the first
paragraph above. I have confirmed that without the code changes in this patch,
if we simply assert that target.mElement has an associated pres shell in
getNeededRestyleTarget, then that assertion will fail when running this test
case.

MozReview-Commit-ID: ED2X5g39hYZ

--HG--
extra : rebase_source : 06fecc98c25c739d26123bddf1fd0908cf4410e6
extra : source : 12c7a036215a901bf6804c0e9aacd2a9fc20f932
2017-06-21 14:45:24 +09:00
Brian Birtles 9696b59052 Bug 1370123 - Ignore animation restyle requests for elements in documents without a pres shell; r=heycam
This patch makes us ignore animation restyle requests for elements in documents
without a pres shell made by either:

* Calls to EffectCompositor::RequestRestyle (e.g. by calling Web Animations API
  methods on animations that target such elements)

* Calls to EffectCompostior::PreTraverse(dom::Element*, CSSPseudoElementType)
  (e.g. by calling getComputedStyle(elem).prop on such an element).

  The other overloads of PreTraverse should presumably be called during regular
  document restyling where the element is expected to be in a displayed document
  and hence we simply assert that that is the case for those methods.

MozReview-Commit-ID: FZD0hKAXYEf

--HG--
extra : rebase_source : 9b9ddf4648b49e0241054ffa51a02ae66f1c5009
2017-06-21 08:48:21 +09:00
Brian Birtles 48097ceb05 Bug 1376594 - Coalesce two hashmap lookups in EffectCompositor::RequestRestyle; r=mats+5168
MozReview-Commit-ID: 4TyFKwtcDEz

--HG--
extra : rebase_source : 59edb907e7179a296bb2f553f555f13157d54220
2017-07-05 10:30:44 +09:00
Mats Palmgren cddeb03b03 Bug 1374126 - Use LookupForAdd instead of Contains+Put to avoid unnecessary hashtable lookups. r=froydnj
MozReview-Commit-ID: EI6vKlMqG5i
2017-06-19 18:19:14 +02:00
Manish Goregaokar 3188b9bfd6 Bug 1373018 - Part 10: stylo: Remove StyleSource; r=bholley
MozReview-Commit-ID: 4IcROeDNoBA

--HG--
extra : rebase_source : e2f65c316be2c5640150eb5ff5628505ce446535
2017-06-10 22:27:45 -07:00
Manish Goregaokar 02ab46c24d Bug 1373018 - Part 8: stylo: Move nsStyleContext::SetStyle to GeckoStyleContext; r=bholley
MozReview-Commit-ID: ycXu95whnG

--HG--
extra : rebase_source : 852051aa074cc8ed8f11f0d68c26fe4f0a6962b6
2017-06-10 22:27:45 -07:00
Hiroyuki Ikezoe cdde6f6108 Bug 1368889 - Post animation restyle hint againt pseudo element instead of its parent. r=birtles
To traverse pseudo elements in animation-only restyle, the pseudo element
itself needs the animation-only dirty bit.

MozReview-Commit-ID: 11RfVqnPXfJ

--HG--
extra : rebase_source : d048c9a053c03bf3fef46fcbfd9cbd5f60204e1d
2017-06-08 10:22:25 +09:00
Hiroyuki Ikezoe 14e0273b91 Bug 1367293 - Don't get parent style for GetComputedKeyframeValuesFor. r=birtles
MozReview-Commit-ID: 7WjsO7P2QGz

--HG--
extra : rebase_source : b9d2d672dd670f54174a5811c7d28efe268c0c4d
2017-06-02 09:38:54 +09:00
Boris Chiou 9525862a92 Bug 1334036 - Part 12: Enable off-main thread animations. r=birtles
Remove the unconditional return from FindAnimationsForCompositor(), so
we can check if there is any property running on compositor.
Also, enable a reftest and fix the mochitest expectation:
1. The expectation numbers of test_animations_omta.html in e10s and non-e10s
   are different, so skip non-e10s.
2. We pass all tests in test_animations_omta_start.html with e10s;
   however, got 3 test failures with non-e10s, so skip this file with
   non-e10s.

MozReview-Commit-ID: IuOyAsUYguU

--HG--
extra : rebase_source : 8f8549063f2d1907e95d0bab450e1b6f851f8c84
2017-05-08 11:22:13 +08:00
Boris Chiou 38215cedea Bug 1334036 - Part 11: Trigger animation-only restyle when we handle an event with coordinates. r=birtles,heycam
We need to request an animation-only restyle to force flush all throttled
animations on main thread when we handle an event with coordinates
(e.g. mouse event).

MozReview-Commit-ID: KkjeQVsLgTl

--HG--
extra : rebase_source : 314408062e719e9f52df9a6726e2f3dad817bbef
2017-05-19 16:16:41 +08:00
Boris Chiou 5ab8026281 Bug 1334036 - Part 7: Merge two similiar MaybeUpdateCascadeResults functions. r=birtles
MozReview-Commit-ID: 2NDdQRF3DQ8

--HG--
extra : rebase_source : b6b002e19a459acd644024a78532ab7923e3fc82
2017-05-11 13:26:07 +08:00
Boris Chiou 1e2c865691 Bug 1334036 - Part 5: Implement FFI for finding properties overriding animations. r=birtles,emilio
We need to traverse rule tree to get the important rules, so we will not
override them if they have animations running on compositor.

MozReview-Commit-ID: 67NO2nIcUfq

--HG--
extra : rebase_source : 24a4ea4ca10e00f409d94c81acacb3db72248b3f
2017-05-19 15:58:47 +08:00
Boris Chiou c13897d8fe Bug 1334036 - Part 4: Remove unused UpdateCascadeResults function. r=birtles,hiro
We don't use the public UpdateCascadeResults method, so remove it.

MozReview-Commit-ID: A2lWZaHWHTZ

--HG--
extra : rebase_source : 35a1d77fdeba5a1db74d15f523dba78801b0b48e
2017-05-10 13:46:36 +08:00
Boris Chiou f1f6a5d9dc Bug 1334036 - Part 3: Add a flag to represent we are in pre-traversal. r=birtles
We need this flag to avoid assertion in PostRestyleForAnimation(), which
may be called from MaybeUpdateCascadeResults() in pre-traversal.

MozReview-Commit-ID: 46AfoIUb9o3

--HG--
extra : rebase_source : 3290d9954be43ffaeb94b501ac346622651c452a
2017-05-11 13:08:35 +08:00
Boris Chiou 5561a71847 Bug 1334036 - Part 2: Restyle all elements with animations if there are non-animation restyles. r=birtles
We restyle elements with non-animation restyles even if the animations
are throttled.

MozReview-Commit-ID: Exhd4qVx7su

--HG--
extra : rebase_source : 1632bf949bb60a894372a425fd9173e1b718452d
2017-05-17 11:41:43 +08:00
Boris Chiou 3f5f72a1eb Bug 1334036 - Part 1: Avoid mutating mElementsToRestyle during pre-traversal. r=birtles
During pre-traversal of EffectCompositor, we call MaybeUpdateCascadeResult(),
which may add new element into mElementsToRestyle, as a result, we may
iterate a mutated mElementsToRestyle. In this patch, we copy the element
which needs update cascade results into another set and traverse this new set
to call MaybeUpdateCascadeResult(). After that, do normal pre-traversal on
mElementsToRestyle.

MozReview-Commit-ID: 3uo6Ec5JNjp

--HG--
extra : rebase_source : 3cdc3c3147f011074a884d85da2655e0ed4a3730
2017-04-28 14:00:13 +08:00
Emilio Cobos Álvarez 8b2a66ab16 Bug 1364412: Convert pseudo-elements to an enum. r=hiro,xidorn
This allows us to access metadata using `match` instead of comparison with
atoms, which makes it doable to get the pseudo-element flags in the future.

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

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

--HG--
extra : rebase_source : 57614aed13d2c088fe129ecf3fabf9869d5a6d50
2017-05-14 18:39:22 +02:00
Hiroyuki Ikezoe d8fafebff7 Bug 1360776 - Pass AnimationValueMap raw pointer instead of Arc to Gecko_GetAnimationRule(). r=emilio
MozReview-Commit-ID: 5o8NuJolG2R

--HG--
extra : rebase_source : 13d732112dfe5614a83657c7bf7703944050c0f4
2017-05-01 18:45:41 +09:00
Brian Birtles ba8b99bbb7 Bug 1355348 - Move IsFlattenedTreeDescendantOf helper to nsContentUtils; r=heycam
In the next patch in this series we would like to use this functionality in
nsSMILController as well so this patch moves it to somewhere we can share it.

MozReview-Commit-ID: 1IzWoCCw4aD

--HG--
extra : rebase_source : 9f2b230f774135c0c5bf60ebdff358ce0a6bc087
2017-04-26 13:00:10 +09:00
Emilio Cobos Álvarez 6fe2b3e89d Bug 1355351: Simplify nsLayoutUtils callers, and make child iterators notice display: contents pseudos. r=heycam
This also happens to fix other bugs, like making display: contents pseudos
animatable, which weren't before.

MozReview-Commit-ID: LhwTPNbFvSZ

--HG--
extra : rebase_source : 785105b08d6bfa15ad257e61b769a263c6810ad0
2017-04-19 12:53:57 +02:00
Boris Chiou 600fb7770f Bug 1341372 - Part 1: Let animation-only restyle include css-transition. r=heycam,hiro
Animation-only restyle should include both Animation and Transition
cascade levels.

MozReview-Commit-ID: Jo1sb5fGUC0

--HG--
extra : rebase_source : ddd7d796b93f9e7ced912ec4fa2eb79e7ba58784
2017-04-17 14:22:28 +08:00
Boris Chiou 2317c8957e Bug 1343753 - Part 6: Move mAnimationGeneration into RestyleManager. r=birtles
So stylo can also use mAnimationGeneration.

MozReview-Commit-ID: KTc8vs2RKMm

--HG--
extra : rebase_source : 52aeb3bf91fa849cbddbedff28418736f96086bb
2017-03-09 17:15:08 +08:00
Cameron McCormack 73701ced74 Bug 1351535 - Part 5: Add EffectCompositor method to pre-traverse within a specific subtree. r=hiro
It's not great that we traverse up the tree looking for the subtree root for
each animating element that is in mElementsToRestyle.  An alternative could
be to traverse the entire subtree and build a hash set of the elements
within it, so that each test in the mElementsToRestyle loop can be done
quickly.  I suspect that most of the time looking up the tree for
each animation will be quicker, but it does have worse worst case behavior.

MozReview-Commit-ID: FWoQ7fD9YZC

--HG--
extra : rebase_source : 688a19f61e3eda9e84228b6f18913e1f4bb09f13
2017-04-04 19:12:54 +08:00
Hiroyuki Ikezoe 3183fa83ee Bug 1350754 - Templatize EffectCompositor::UpdateEffectProperties. r=birtles
We will use this function for stylo computed values as well.

MozReview-Commit-ID: IxDg4EZARi3

--HG--
extra : rebase_source : dc6445ab0c836393913d64313c8151f31cd7b523
2017-03-27 19:43:04 +09:00
Hiroyuki Ikezoe 0ec76c29e2 Bug 1344966 - Post eRestyle_CSSAnimations instead of eRestyle_Self and eRestyle_Subtree. r=heycam
MozReview-Commit-ID: 7azwzIPc45X

--HG--
extra : rebase_source : 5943ab5db1a0a7ca4e77f9373151a5d1387ab25f
2017-03-27 06:17:08 +09:00
Hiroyuki Ikezoe cb4ce7109c Bug 1340958 - Drop AnimationRule and ServoAnimationRule. r=boris
MozReview-Commit-ID: ClnvyShHpsN

--HG--
extra : rebase_source : c554550264bfedafbf91ed2ed754603fb5c3e4c6
2017-03-17 13:24:42 +09:00
Hiroyuki Ikezoe 3b9f585232 Bug 1340958 - Put computed values into AnimationValueMap instead of hashtable in gecko. r=heycam
Before this patch, we store each computed values in a hashtable,
nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>, for all
KeyframeEffectReadOnly on an element, and convert the ServoAnimationValues of
the hashtable into an nsTArray<ServoAnimationValue*> and then convert
the ServoAnimationValues of the nsTArray into PropertyDeclarationBlock
in rust.  This way was really inefficient.
In this patch, we store the computed values into AnimationValueMap and
convert all AnimationValue in the map into PropertyDeclarationBlock
after EffectCompositor::GetAnimationRule.

MozReview-Commit-ID: EJ2Kl65fVeF

--HG--
extra : rebase_source : e30a9d440dc9855e21b94501b07a3501d31bc345
2017-03-17 13:23:21 +09:00
Hiroyuki Ikezoe 2511ac5d4e Bug 1340958 - Templatize ComposeStyle. r=birtles
Later in this patch series we will replace ServoAnimationRule with a hashmap.
At that point, we would like to pass the hashmap to ComposeStyle. In order
to achieve that, this patch templatizes the 'animation rule' parameter of
ComposeStyle in both Animation and KeyframeEffectReadOnly so that it can
represent a hashmap instead.

MozReview-Commit-ID: H5bMxjN3W8n

--HG--
extra : rebase_source : 58cd9ee1cda51970d35c52b39d2cdab12055e24a
2017-03-17 13:22:13 +09:00