Commit Graph

356 Commits

Author SHA1 Message Date
Nathan Froyd
e7b3b3140d Bug 1415980 - make hash keys movable and not copyable; r=erahm
Everything that goes in a PLDHashtable (and its derivatives, like
nsTHashtable) needs to inherit from PLDHashEntryHdr. But through a lack
of enforcement, copy constructors for these derived classes didn't
explicitly invoke the copy constructor for PLDHashEntryHdr (and the
compiler didn't invoke the copy constructor for us). Instead,
PLDHashTable explicitly copied around the bits that the copy constructor
would have.

The current setup has two problems:

1) Derived classes should be using move construction, not copy
   construction, since anything that's shuffling hash table keys/entries
   around will be using move construction.

2) Derived classes should take responsibility for transferring bits of
   superclass state around, and not rely on something else to handle that.

The second point is not a huge problem for PLDHashTable (PLDHashTable
only has to copy PLDHashEntryHdr's bits in a single place), but future
hash table implementations that might move entries around more
aggressively would have to insert compensation code all over the
place. Additionally, if moving entries is implemented via memcpy (which
is quite common), PLDHashTable copying around bits *again* is
inefficient.

Let's fix all these problems in one go, by:

1) Explicitly declaring the set of constructors that PLDHashEntryHdr
   implements (and does not implement). In particular, the copy
   constructor is deleted, so any derived classes that attempt to make
   themselves copyable will be detected at compile time: the compiler
   will complain that the superclass type is not copyable.

This change on its own will result in many compiler errors, so...

2) Change any derived classes to implement move constructors instead of
   copy constructors. Note that some of these move constructors are,
   strictly speaking, unnecessary, since the relevant classes are moved
   via memcpy in nsTHashtable and its derivatives.
2018-09-20 11:20:36 -04:00
Sylvestre Ledru
aa37bde79b Bug 1489454 - Remove all trailing whitespaces (again) r=Ehsan
This also includes moving some files to the regular format.

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

--HG--
extra : moz-landing-system : lando
2018-09-07 14:47:51 +00:00
Robert Longson
5050624201 Bug 1486115 - use mozilla::IsAsciiDigit and mozilla::AsciiAlphanumericToNumber r=dholbert 2018-08-31 16:55:04 +01:00
Emilio Cobos Álvarez
a1f03332c2 Bug 1486488 - Don't assume that SVGAnimationElement has a parent on bind. r=dholbert
This is a regression from bug 1450250, which removed a if (!GetCx()) early
return in this function.

That early return was wrong, both because it prevented elements that were in
shadow trees from targeting other elements, but also because that check was not
present in AfterSetAttr, which means that dynamic updates to the attribute would
work.

Pass the SVGAnimationElement itself to resolve references. That's what we do for
attribute mutations, and also it's the same behavior we have, since the ID
lookup IDTracker does only depends on containing shadow root and containing
document, and that's invariant between a kid and it's DOM parent.

Some other code has been updated to take references instead of pointers so the
null-safety of those methods is explicit.

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

--HG--
extra : moz-landing-system : lando
2018-08-28 09:06:08 +00:00
Emilio Cobos Álvarez
66b986e252 Bug 1483882 - Teach IDTracker about Shadow DOM. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D3533
2018-08-17 22:01:52 +02:00
Narcis Beleuzu
b001ac17eb Backed out changeset 9c08d6d5d6f2 (bug 1483882) for reftest failures on svg/fragid-shadow. CLOSED TREE 2018-08-17 21:27:14 +03:00
Emilio Cobos Álvarez
aabc4bed97 Bug 1483882 - Teach IDTracker about Shadow DOM. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D3533
2018-08-17 19:14:47 +02:00
Noemi Erli
5788eb8190 Backed out 2 changesets (bug 1483882) for reftest failures in uilds/worker/workspace/build/tests/reftest/tests/layout/reftests/svg/fragid-shadow-3.html
Backed out changeset 4656d3bf8e9c (bug 1483882)
Backed out changeset 4105f56578d4 (bug 1483882)
2018-08-17 18:13:14 +03:00
Emilio Cobos Álvarez
9d77ba352b Bug 1483882 - Teach IDTracker about Shadow DOM. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D3533

--HG--
extra : moz-landing-system : lando
2018-08-17 11:35:15 +00:00
Noemi Erli
c6f79a6d0e Backed out 1 changesets (bug 1483882) for reftest failures in builds/worker/workspace/build/tests/reftest/tests/layout/reftests/svg/fragid-shadow-3.html on a CLOSED TREE
Backed out changeset d25d4da4aad2 (bug 1483882)
2018-08-17 13:37:55 +03:00
Emilio Cobos Álvarez
b57fa69bb3 Bug 1483882 - Teach IDTracker about Shadow DOM. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D3533

--HG--
extra : moz-landing-system : lando
2018-08-17 09:19:47 +00:00
Emilio Cobos Álvarez
2996813963 Bug 1479450: Implement nsCSSProps::LookupProperty using Rust. r=xidorn
Always assume allowed-for-all-content. There are a couple callers which weren't
doing that:

 * A unit test -> removed.

 * ComputeAnimationDistance: Used for testing (in transitions_per_property), and
   for the animation inspector. The animation inspector shouldn't show
   non-enabled properties. The transitions_per_property test already relies on
   getComputedStyle stuff which only uses eForAllContent.

 * GetCSSImageURLs: I added this API for the context menu page and such. It
   doesn't rely on non-enabled-everywhere properties, it was only using
   eInChrome because it was a ChromeOnly API, but it doesn't really need this.

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

MozReview-Commit-ID: 4VOi5Su3Bos
2018-07-31 12:00:15 +02:00
Cosmin Sabou
bfc1e72e01 Backed out changeset 9035ff3757ac (bug 1415980) at request from froydnj on the suspicion that it's going to break MSVC builds when it gets merged to central. 2018-07-31 01:19:49 +03:00
Nathan Froyd
017b016850 Bug 1415980 - make hash keys movable and not copyable; r=erahm
Everything that goes in a PLDHashtable (and its derivatives, like
nsTHashtable) needs to inherit from PLDHashEntryHdr.  But through a lack
of enforcement, copy constructors for these derived classes didn't
explicitly invoke the copy constructor for PLDHashEntryHdr (and the
compiler didn't invoke the copy constructor for us).  Instead,
PLDHashTable explicitly copied around the bits that the copy constructor
would have.

The current setup has two problems:

1) Derived classes should be using move construction, not copy
   construction, since anything that's shuffling hash table keys/entries
   around will be using move construction.

2) Derived classes should take responsibility for transferring bits of
   superclass state around, and not rely on something else to handle
   that.

The second point is not a huge problem for PLDHashTable (PLDHashTable
only has to copy PLDHashEntryHdr's bits in a single place), but future
hash table implementations that might move entries around more
aggressively would have to insert compensation code all over the place.
Additionally, if moving entries is implemented via memcpy (which is
quite common), PLDHashTable copying around bits *again* is inefficient.

Let's fix all these problems in one go, by:

1) Explicitly declaring the set of constructors that PLDHashEntryHdr
   implements (and does not implement).  In particular, the copy
   constructor is deleted, so any derived classes that attempt to make
   themselves copyable will be detected at compile time: the compiler
   will complain that the superclass type is not copyable.

   This change on its own will result in many compiler errors, so...

2) Change any derived classes to implement move constructors instead
   of copy constructors.  Note that some of these move constructors are,
   strictly speaking, unnecessary, since the relevant classes are moved
   via memcpy in nsTHashtable and its derivatives.
2018-07-30 17:15:11 -04:00
Emilio Cobos Álvarez
add2e33db0 Bug 1450250: SMIL document-related fixes. r=heycam
This is a prerequisite to make some SMIL-in-use tests pass.

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

MozReview-Commit-ID: 8fM0fb9dayd
2018-07-20 14:44:47 +02:00
Brian Birtles
8ab6ee61ba Bug 1471814 - Add a preference for {Document,Element}.getAnimations(); r=bz,hiro
This is probably the last thing we will ship since it needs the most spec work.

MozReview-Commit-ID: LLmDBLCsCBJ

--HG--
extra : rebase_source : c06752c9201a9ede87e1ac200ab12577bf784ce6
2018-07-14 09:23:03 +09:00
Dan Glastonbury
2351341f1f Bug 1467622 - P2: Change SMIL paced tests to represent new distance calc. r=birtles
Changing to Stylo for animation of color with currentColor. Stylo uses
a different distance metric for numeric colors to currentColor. The
result is that a different pacing is used in the fill case.

MozReview-Commit-ID: 5x8c3IF5owV

--HG--
extra : rebase_source : fd1656237fd5df03481e410bae29167df2317536
2018-06-28 11:58:34 +10:00
Brindusan Cristian
232d35f4b9 Backed out 5 changesets (bug 1467622) for reftest failures on layout/reftests/svg/smil/style/anim-css-fill-1-from-by-curcol-hex.svg. CLOSED TREE
Backed out changeset 8694fe928b04 (bug 1467622)
Backed out changeset 74533cad9479 (bug 1467622)
Backed out changeset e1dbee410e98 (bug 1467622)
Backed out changeset 56142038cc7f (bug 1467622)
Backed out changeset 90cede21bad1 (bug 1467622)
2018-07-11 09:37:26 +03:00
Dan Glastonbury
a63f482185 Bug 1467622 - P2: Change SMIL paced tests to represent new distance calc. r=birtles
Changing to Stylo for animation of color with currentColor. Stylo uses
a different distance metric for numeric colors to currentColor. The
result is that a different pacing is used in the fill case.

MozReview-Commit-ID: 5x8c3IF5owV

--HG--
extra : rebase_source : 422dfa69644052a4c9cbfb2355a105c8e5c2b50c
2018-06-28 11:58:34 +10:00
Andrea Marchesini
14d462eeb3 Bug 1418246 - Return valid columnNumber value in CSP violation events, r=ckerschb 2018-07-05 08:21:04 +02:00
Jeff Gilbert
5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Chris Peterson
2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Andi-Bogdan Postelnicu
09ec36a025 Bug 1453795 - SVG - Initialize member fields in classes/ structures. r=jwatt
--HG--
extra : rebase_source : 244f0513af145c53fbc0177d2652cf68e20b64af
2018-06-16 13:54:44 +03:00
Dan Glastonbury
367e64f0d4 Bug 1465307 - P4: Enable disabled dom/smil lighting_color tests. r=xidorn
Enable tests disabled in Bug 1457353.

MozReview-Commit-ID: Ctx9bgt9tlK

--HG--
extra : rebase_source : c319f91f4db7c4f0f5146c00760b015802be9e32
2018-06-05 14:36:20 +10:00
Emilio Cobos Álvarez
fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Nazım Can Altınova
361380987c Bug 1464496 - Part 1: Merge ServoDeclarationBlock and DeclarationBlock r=emilio
MozReview-Commit-ID: By9fV70Oq0K

--HG--
extra : rebase_source : 837afe9c33b21d7db41ff19d3aaf6cf3e9eedbdf
2018-05-30 18:15:25 +02:00
Dan Glastonbury
5fe6ffd64b Bug 1457353 - P3: Disable failing SMIL tests. r=hiro,xidorn
Disable failing SMIL tests for lighting-color with currentcolor until
StyleComplexColor is extended to support addition.

MozReview-Commit-ID: 6tbDYPFI9ey

--HG--
extra : rebase_source : a8f1e363bd37c40ae2e48ef682a005aafaa27fe5
2018-05-30 14:12:08 +10:00
Emilio Cobos Álvarez
aa934dea20 Bug 1465107: Remove isStyledByServo. r=xidorn
MozReview-Commit-ID: 8HWBH9kWyxV
2018-05-30 10:04:18 +02:00
Emilio Cobos Álvarez
dd5f25c2f6 Bug 1465107: Cleanup remaining mochitest / reftest / crashtests stylo expectations. r=xidorn
MozReview-Commit-ID: 1IeURcnoESX
2018-05-30 10:03:50 +02:00
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