Commit Graph

327 Commits

Author SHA1 Message Date
rahul0379
a074d3d299 Bug 1458580 - Rename GetSMILStyleOverride since it can't return null. r=emilio
MozReview-Commit-ID: JzV5hQBvlpJ
2018-05-25 12:12:37 +02:00
Chris Peterson
71422dcaa9 Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L

--HG--
extra : source : c14655ab3df2c9b1465dd8102b9d25683359a37b
2018-04-28 12:50:58 -07:00
Emilio Cobos Álvarez
27ca8b58c8 Bug 1458814: Remove code that is no longer called. r=hiro
Au revoir!

MozReview-Commit-ID: DjqszUSIzXs
2018-05-05 16:31:20 +02:00
Emilio Cobos Álvarez
ceca84ff64 Bug 1458814: Remove a bit of trivially dead code. r=hiro
MozReview-Commit-ID: GG41v4TejBU
2018-05-05 16:31:19 +02:00
Emilio Cobos Álvarez
d7f92df0f2 Bug 1458814: Make SMIL values not roundtrip through strings. r=hiro
MozReview-Commit-ID: DpbFSutIv3t
2018-05-05 16:31:17 +02:00
Emilio Cobos Álvarez
e7d5158b29 Bug 1458458: Move setting SMIL override values into nsDOMCSSAttrDeclaration. r=hiro
MozReview-Commit-ID: KkXGtl6vz2L
2018-05-02 18:09:05 +02:00
Boris Zbarsky
25aa42d9a4 Bug 1455674 part 16. Remove most use of nsIDOMElement in dom. r=qdot 2018-04-26 23:37:34 -04:00
Emilio Cobos Álvarez
46c5356b75 Bug 1454883: Fix animation tests to account for font-stretch animating as percentage. r=hiro
MozReview-Commit-ID: KPXUJSI930X
2018-04-23 18:22:14 +02:00
Boris Zbarsky
4643230674 Bug 1455055 part 6. Clean up HandleEvent implementations in dom. r=masayuki
MozReview-Commit-ID: Ht7HQEhVS8E
2018-04-20 00:49:30 -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
7b41eaf443 Bug 1454596: Update font-weight property and descriptor to css-fonts-4. r=xidorn
Need to change the tests still, but that should be trivial.

MozReview-Commit-ID: 27aS2UrgXjs
2018-04-19 12:49:37 +02:00
Nathan Froyd
fcd4d69f20 Bug 1454040 - part 2 - remove nsAutoPtr entirely from nsSMILTimedElement; r=dholbert
This patch handles the other use of nsAutoPtr in nsSMILTimedElement: the
storing of nsSMILTimeValueSpecs.
2018-04-16 11:15:56 -04:00
Nathan Froyd
d032671b97 Bug 1454040 - part 1 - make time intervals in nsSMILTimedElement UniquePtrs; r=dholbert
UniquePtr is nicer than nsAutoPtr.
2018-04-16 11:15:56 -04:00
Sebastian Hengst
0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon
a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
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
Robert Longson
307a272379 Bug 1450643 part 2 - remove SVGAnimationElement wrappers around GetAttr/HasAttr in favour of directly using the Element versions. r=dholbert 2018-04-04 08:16:56 +01: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
efc0cdde02 Bug 1447828 part 8 - Remove remaining uses of StyleBackendType as well as the type itself. r=emilio
MozReview-Commit-ID: 6sh4eKvDpRF

--HG--
extra : rebase_source : 7d83f2b2d4e2739333016ed82754bf3a4a700de4
extra : source : 147ca562a24652c3f30add793213db70aff65e9e
2018-03-29 02:34:34 +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
Jonathan Watt
82ebebe276 Bug 1448714 - Fix up comments referring to 'style context' after the rename of nsStyleContext. r=emilio 2018-03-23 13:49:21 +00: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
2265ef0801 Bug 1448688: Remove RestyleTracker, ComputedStyle::AsServo, old style system element bits. r=xidorn
MozReview-Commit-ID: ALiOngGqozN
2018-03-26 09:38:07 +02:00
Jonathan Watt
384c345f21 Bug 1448294 - Clean up naming of 'styleContext' variables after the big nsStyleContext rename. r=emilio
Reviewers: emilio

Bug #: 1448294

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

MozReview-Commit-ID: KJq2i9nrg7y
2018-03-25 20:49:58 +02:00
Narcis Beleuzu
47581f78e2 Backed out 2 changesets (bug 1448294, bug 1448337) for wpt and reftest failures on /mathml
Backed out changeset 180051cfe357 (bug 1448294)
Backed out changeset c188176f3289 (bug 1448337)
2018-03-25 21:31:08 +03:00
Emilio Cobos Álvarez
dff4e17b14 Bug 1448413: Do a bit of misc cleanup. r=jwatt
Summary: Mostly removing unneeded AsServo() and such.

Reviewers: jwatt

Bug #: 1448413

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

MozReview-Commit-ID: 8muHF7uMA53
2018-03-25 18:14:36 +02:00
Jonathan Watt
21bff4e120 Summary: Bug 1448294 - Clean up naming of 'styleContext' variables after the big nsStyleContext rename. r=emilio
Reviewers: emilio

Bug #: 1448294

Differential Revision: https://phabricator.services.mozilla.com/D796
2018-03-22 13:49:21 +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
Robert Longson
202cc35695 Bug 1446584 - Make SVG use the same definition of whitespace as HTML/CSS r=jwatt 2018-03-18 07:14:32 +00:00
Emilio Cobos Álvarez
d5f66d9925 Bug 1446668: Remove setUserData crashtests. r=smaug
Reviewers: smaug

Bug #: 1446668

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

MozReview-Commit-ID: wyAvCCWbrS
2018-03-18 01:53:13 +01:00
Emilio Cobos Álvarez
7dffe29d8f Bug 1432490: Make nsComputedDOMStyle::GetStyleContext / GetStyleContextNoFlush not take a presShell. r=bz
Everyone calls them with the shell of the current composed document, and this
allows the multi-presShell stuff to just be in UpdateCurrentStyleSources /
DoGetStyleContextNoFlush.

The only reason we need to use OwnerDoc()->GetShell() instead of the composed
doc in GetStyleContext / GetStyleContextNoFlush is Element::GetBindingURL, which
does expect to get the binding URL for stuff outside of the composed doc (and
changing that gave me a useless browser).

That's technically a behavior change on the cases that used to pass nullptr, but
I think all callers are fine with that. I could also just add a special function
for that particular case, it may be worth it.

MozReview-Commit-ID: 2XlnkgdgDCK
2018-02-25 02:23:59 +01:00
Hiroyuki Ikezoe
1b0cba9367 Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
It would be convenient to get nsPresContext from nsIDocument.

MozReview-Commit-ID: Ei6V3UE8XGr

--HG--
extra : rebase_source : 8d2a917eb62cf341e4e1810451fd01c01dbc3bad
2018-02-21 07:00:10 +09:00
Tom Ritter
aa82f54ab6 Bug 1435296 Address test failures caused by bumping timer precision to 2 ms r=baku
There are a few different reasons why tests needed updating (not an exhaustive list):

- Tests assume that successive operations take place at different times.
- Tests assume that an operation took a minimum amount of time.
- Tests hardcodes a specific delay.

In most cases we hardcode the preference off. In some cases this is the best approach,
in others, we would like to improve. The bug for tracking those improvements is Bug 1429648

An improvement that is present in some tests is to hardcode a specific precision reduction
that is acceptable based on the confides of the test. (Obviously this needs to be a fix for
the test framework and not a requirement on the feature being tested.)

In a few places, the test itself can be fixed, for example to no longer require the end
time of an operation to be strictly greater than the start time, and allows it to be equal
to it.

MozReview-Commit-ID: J59c7xQtZZJ

--HG--
extra : rebase_source : df8a03e76eaf9cdc9524dbb3eb9035af237e534b
2018-02-12 11:39:41 -06:00
Boris Zbarsky
034e47c66b Bug 1436508 part 12. Remove nsIDOMKeyEvent. r=masayuki
MozReview-Commit-ID: 8giqG5iHiIf
2018-02-09 11:17:10 -05:00
Cameron McCormack
70af884bbd Bug 1435666 - Part 2: Remove nsIDOMTimeEvent. r=bz
MozReview-Commit-ID: F2fYWhUKzyp

--HG--
extra : rebase_source : 4dc8397fe050262463d37a9829130c0af707f4ba
2018-02-05 10:31:43 +08:00
Robert Longson
7be5dd985e Bug 1435372 - pass nsSMILMilestone into the constructor of MilestoneEntry by const reference to avoid an unnecessary object copy r=birtles 2018-02-03 10:15:20 +00:00
Cameron McCormack
2cea1ba7c1 Bug 1430014 - Part 6: #ifdef out a bit more animation-related code. r=hiro
MozReview-Commit-ID: B9TaVJFak26

--HG--
extra : source : 820eed2682b6a6cda892d091ee037ff1eeacd69f
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
Boris Zbarsky
7c83759ad4 Bug 1428610 part 2. Change Element::GetSMILOverrideStyle to return nsDOMCSSAttributeDeclaration. r=emilio
MozReview-Commit-ID: 9R6ywUEKagK
2018-01-30 14:48:26 -05:00
Brian Birtles
f5dff74bc2 Bug 1423098 - Drop support for SMIL accessKey; r=dholbert
MozReview-Commit-ID: Evrl4St3QSD

--HG--
extra : rebase_source : b5fc6574efe9e48f70c2d3affa0ed782e1909031
2017-12-14 09:58:32 -06:00
Brian Birtles
0279523bb7 Bug 1423098 - Ignore invalid time value specifications rather than failing; r=dholbert
This matches the behavior of Chrome at least, and should reduce compatibility
risk when we remove accessKey support in the next patch in this series by
ensuring that specifications such as begin="3s; accessKey(s)" will continue to
run the animation.

MozReview-Commit-ID: E6sh48yrYSm

--HG--
extra : rebase_source : 1ad85b55acfd226c660386ff579811ed2e70f260
2017-12-14 09:58:24 -06:00
Boris Chiou
570057e075 Bug 1408303 - Part 3: Move several Servo parsers into ServoCSSParser helper class. r=heycam
We have ServoCSSParser class, and I think it's better to move those
Servo FFI into this class to avoid including ServoBindings.h everywhere.

MozReview-Commit-ID: 6orXtddp9ZU

--HG--
extra : rebase_source : 6da4158c4fec606aaee49fddee3192f94d6c85a3
2017-12-01 17:35:47 +08:00
Kris Maglione
bd57fba62b Bug 1415352: Part 2 - Exempt inline CSS from extension principals from CSP. r=bz
MozReview-Commit-ID: D0dofgOaLXZ

--HG--
extra : rebase_source : ee649c83191e64f5f0370e61a54b506f4767ac71
2017-11-05 12:19:34 -08:00
Nika Layzell
c223b9ff2d Bug 1414974 - Part 6: Change WebIDL bindings to refer to nsGlobalWindowInner rather than nsGlobalWindow, r=bz
MozReview-Commit-ID: KbCpDFoWyTe
2017-11-09 10:44:49 -05:00
Brian Birtles
c0aa9c7ed3 Bug 1411963 - Drop assertion about GetBaseValue not returning null in nsSMILCompositor::ComposeAttribute; r=dholbert
This assertion was originally added in bug 1353208 because in that bug we
changed the type of nsSMILCompositor::mCachedBaseValue from
nsAutoPtr<nsSMILValue> to just nsSMILValue. When using nsAutoPtr,
mCachedBaseValue had two null states: one where the pointer is null, and one
where the pointed-to nsSMILValue is null. Coalescing these two states simplifies
the code but there is one case where the difference is significant as described
in the commit message for that changeset (mozilla-central changeset
ad7060dae117):

  "There's a subtle difference in behavior with regards to the first sample.
  Previously we would compare the (initially) null mCachedBaseValue pointer with
  the passed-in nsSMILValue and set mForceCompositing to true. With this patch,
  however, we will only set mForceCompositing to true if the passed-in
  mCachedBaseValue is not null."

That is, if the base value we get back is a null nsSMILValue, previously we
would set mForceCompositing to true unconditionally, but with the changes in bug
1353208 we would only set that to true if the passed-in nsSMILValue was not
null.

We believed that would never matter since the passed-in nsSMILValue would never
be null if we called GetBaseValue. Quoting from that same commit message:

  "... if we do call GetBaseValue the result should not be a null nsSMILValue
  (except in some OOM cases where we don't really care if we miss a sample).
  This patch adds an assertion to check that GetBaseValue does, in fact, return
  a non-null value. (I checked the code and this appears to be the case. Even in
  error cases we typically return an empty nsSMILValue of a non-null type. For
  example, the early return in nsSMILCSSProperty::GetBaseValue() does this.)"

We added an assertion to validate that assumption but the crashtest included in
this patch demonstrates a case where it does not hold (specifically, when
nsStyleUtil::CSPAllowsInlineStyle returns false, nsCSSProperty::GetBaseValue
will return a null nsSMILValue).

That would seem to suggest that there is at least one case where we might fail
to set mForceIsCompositing to true and hence fail to update style on this first
sample (and presumably thereonwards too since future comparisons of
mCachedBaseValue will compare equal). However, for the case of an initial sample
mForceCompositing should already be set to true since set we update
mForceCompositing in nsSMILCompositor::GetFirstFuncToAffectSandwich() and will
make it true if *anything* in the animation function has changed and at this
point, the initial sample, *everything* will have changed. Hence, I believe
dropping this assertion is acceptable.

I have confirmed that in the crashtest in this patch, during the first sample
mForceCompositing is set to true.

I would create a reftest to test the behavior on the first sample but, at least
for the specific case where inline style is disabled due to CSP, not updating
style *is* the expected behavior so there will be no difference in behavior
regardless of whether or not the mForceCompositing flag is set.



MozReview-Commit-ID: Li0pZEH2PNl

--HG--
extra : rebase_source : a1c12a019b8481600afa4295447dc1e6fb281b22
2017-10-31 16:22:04 +09:00
Brian Birtles
ebedef2a25 Bug 849593 - Skip samples of active SMIL timed elements when the sample time precedes the current interval; r=dholbert
In some circumstances it is possible to sample a timed element in the active
state with a time that precedes is current interval.

One possible sequence of steps leading to this situation is as follows:

1. A timed element (e.g. <set>, <animate>) with a non-zero begin time is the
   child of <svg> element A (its "time container") but has yet to be sampled.

2. In order to resolve its initial interval, the timed element registers a
   startup milestone with its time container at time 0.

3. However, before the sample is performed where the timed element's initial
   current interval is resolved, <svg> element A is detached from the document
   tree.

4. The timed element is then attached to a different <svg> element B that has
   a current time greater than the begin time of the timed element and less than
   that of <svg> element A.

5. Since the timed element is still in its startup state it registers its
   startup milestone again, this time with its new time container, i.e. <svg>
   element B.

6. A tick occurs or the document has its style flushed such that a sample is
   performed.

   This includes running the milestone sample which causes the timed element to
   resolve its initial current interval. Furthermore the subsequent regular
   sample of the timed element causes it to transition into its active state
   because the current time of <svg> element B is greater than the begin time of
   the timed element.

7. <svg> element A is re-attached to the document.

8. When we go to run the next sample, we iterate through all time containers
   associated with the document's animation controller which includes both <svg>
   element A, and <svg> element B.

9. <svg> element A renders up its 0 milestone from step (2) since it has yet to
   run it. It converts this to parent time, i.e. the time space of the animation
   controller, which will be zero or less depending on the current time of <svg>
   element A when it was re-attached.

10. Since the milestone from <svg> element A will be the earliest milestone
    time, it will be used as the next milestone sample time.

11. The timed element is then sampled using this time, but first it is converted
    to a time in the time space of the timed element's time container, which is
    now <svg> element B.

    As a result of this conversion, the sample time may end up being *before*
    the beginning of the timed element's current interval. Since timed elements
    never expect the time to go backwards an assertion fails when it detects
    that it is active, but is being sampled before its current interval.

For this particular case, ignoring the "early" sample seems to be the most
appropriate action.

More generally, however, we can anticipate other cases similar to this where
milestones are registered that cause the sample time to temporarily go
backwards. A quick audit of nsSMILTimedElement::DoSampleAt suggests that, with
the code changes from this patch, that is probably ok.

As an alternative we could, perhaps, try to drop and re-create all milestones
when time containers are re-attached to the document tree but that would add
more complexity and would not necessarily cover other similar cases of this
situation.

I have verified that the crashtest included in this changeset fails without the
code changes also in this changeset.

MozReview-Commit-ID: KKGYRayNkpo

--HG--
extra : rebase_source : 832d4b357a2a2fe07abf9eab3a6046599aff3ef5
2017-10-24 13:06:04 +09:00