Commit Graph

54 Commits

Author SHA1 Message Date
Kirk Steuber
7fdb378650 Bug 1359556 - Optimize cloneNode by preinitializing attribute and child arrays r=bz
Currently, attribute and child arrays (implemented in dom/base/nsAttrAndChildArray.h) start out empty. When cloning, the array ends up being resized multiple times in order to add the attributes and children that are being cloned from the original node. This would be quicker if the array was initialized to the correct size in the first place so that resizes are not necessary.

However, preallocating space for children is only necessary when performing a deep clone. Therefore, an additional parameter is being added to the Clone, CopyInnerTo, and CloneDocHelper methods to indicate whether preallocation of children should happen. Attributes are copied either way, so that part of the array is preallocated in both cases.

MozReview-Commit-ID: 3iVezeAKXnI

--HG--
extra : rebase_source : 9c3deec6d7aafd6411044d623d4863637b45fd58
2017-04-20 12:57:48 -07:00
Manish Goregaokar
7a6a00898d Bug 1329093 - Part 4: stylo: Delay SVG mapped attr resolution till later; r=bz
MozReview-Commit-ID: 2GvHPg1egjS
2017-03-09 17:46:26 -08:00
Tobias Schneider
6bd84bf9d8 Bug 1326194 - Properly unlink observed targets. m=mrbkap r=mrbkap
MozReview-Commit-ID: EWk3kcoIteE

--HG--
extra : rebase_source : e1b68aaa8278b514c8b008db34a2519076313f7e
2017-01-19 14:51:09 -08:00
Tobias Schneider
7bf1d2ce13 Bug 1326194 - Unlink observed targets as soon as DOMSlots gets unlinked. r=mrbkap
MozReview-Commit-ID: 4OnDvyc98S8

--HG--
extra : rebase_source : ff6336a0af81babf37f5a89a2809a515eb8430cc
2017-01-06 13:47:06 -08:00
Tobias Schneider
eef5af1c91 Bug 1322717 - Disconnect/Unlink in the proper order to avoid crashes in mozilla::dom::DOMIntersectionObserver::UnlinkTarget. r=mrbkap 2016-12-08 18:54:07 -08:00
Olli Pettay
0afb59fbfd Bug 1317409, handle failing node adoption properly, r=peterv
--HG--
extra : rebase_source : 3ce4ba7c0406d6f96edd7e4da8687fcc55295980
2016-11-17 15:54:12 +02:00
Tobias Schneider
bff9de0c6e Bug 1315837 - Crash in mozilla::dom::Element::UpdateIntersectionObservation. r=mrbkap 2016-11-15 15:49:00 +01:00
Andrew McCreight
12eaf5ca37 Backed out changeset 63cafb0c2f0f (bug 1315837) for causing bug 1317415. 2016-11-15 07:59:24 -08:00
Tobias Schneider
0cb90d5992 Bug 1315837 - Fix crash in mozilla::dom::Element::UpdateIntersectionObservation. r=mrbkap
--HG--
extra : rebase_source : 77edac309414e61dd103bc60668351d6e3548890
2016-11-09 09:10:00 -05:00
Brian Birtles
48f29038db Bug 1300045 part 2 - Split KeyframeEffect.cpp into KeyframeEffect{ReadOnly}.cpp r=hiro,smaug
MozReview-Commit-ID: DdBEicunApv

--HG--
rename : dom/animation/KeyframeEffect.cpp => dom/animation/KeyframeEffectReadOnly.cpp
rename : dom/animation/KeyframeEffect.h => dom/animation/KeyframeEffectReadOnly.h
extra : rebase_source : 70063d8ba09c9c457f22771e9b514ddc9fee1612
2016-09-04 16:34:21 +09:00
Edgar Chen
67946850ab Bug 1275835 - Part 1: Move custom element codes from nsDocument to CustomElementsRegistry; r=wchen
MozReview-Commit-ID: 9gTSFrYW7o3

--HG--
extra : rebase_source : f123f21aadaa18641ddd7fa7fa67eb27a4152f83
2016-08-30 11:48:53 +08:00
Boris Chiou
623caf07af Bug 1049975 - Part 4: Merge two Animation::SetEffect()s. r=birtles
This is a pre-patch for part 5, which is trying to make our code closer to the
spec. Some methods in KeyframeEffectReadOnly belong to AnimationEffectReadOnly,
so first, use AsKeyframeEffect() to access those keyframe-related methods, and
then add virtual methods for timing-related methods to AnimationEffectReadOnly.

MozReview-Commit-ID: 1srA1f8JYeN

--HG--
extra : rebase_source : 99a06e20a63b9c8b179fa8501690abf01271aaf4
2016-07-25 16:56:34 +08:00
Andrew McCreight
0d2ed01bc4 Bug 1287204 - Fix typo in nsNodeUtils::CloneAndAdopt(). r=bz 2016-08-04 16:28:15 +02: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
Andrew McCreight
2f88762913 Bug 1287146 - Remove unused argument from NodeInfoChanged(). r=bkelly 2016-07-20 15:18:59 -07:00
Boris Zbarsky
9737ec3dbd Bug 1275945. Move the AutoJSContext use in nsNodeUtils::CloneAndAdopt to where it's really needed. r=mrbkap
This prevents us from pushing stuff on the JSContext stack unnecessarily when
we're just cloning, not adopting.  It's OK that we're doing it in a narrow scope
that doesn't include our recursion into children, because in practice when
aReparentScope is non-null we came from nsIDocument::AdoptNode which already
does AutoJSContext.  So we're not going to continuously push/pop the JSContext
stack in that situation, since something already got pushed on it.
2016-05-26 19:43:42 -04:00
Boris Chiou
22e871661b Bug 1067769 - Part 6: Rename NonOwningAnimationTarget.h to AnimationTarget.h. r=birtles
MozReview-Commit-ID: ErAaPe6ttjc

--HG--
rename : dom/animation/NonOwningAnimationTarget.h => dom/animation/AnimationTarget.h
extra : rebase_source : 79b52ece67f16bd32ac8c07d698a9aae076fe5fe
2016-04-28 23:22:43 +08:00
Boris Chiou
956b429475 Bug 1249219 - Part 6: Support pseudo elements in Animation Mutation Observer. r=heycam
We use the parent element of a pseudo element as the subject to be notified.

Usage:
We record animations targeting to pseudo elements by setting subtree attribute
to true.

MutationObserver(Node, { subtree: ture });

So all the animations targeting to the pseudo elements whose parentElement is
the first argument will be recorded.

--HG--
extra : rebase_source : 3dc87802b65c74c3e5f2ed4504652ba14465fc02
2016-03-21 16:49:50 +08:00
Boris Chiou
b32a962055 Bug 1249219 - Part 5: Add a wrapper of AnimationAdded/Changed/Removed. r=birtles
Remove the duplicated code in nsNodeUtils.

--HG--
extra : rebase_source : 8e56af9adcfefbe015d62dcf6937ca6d941bc438
2016-03-21 16:49:50 +08:00
Boris Chiou
0fab3e5678 Bug 1249219 - Part 4: Use NonOwningAnimationTarget as the returned value of some animation target getters. r=birtles
Use NonOwningAnimationTarget as the returned type of
1. KeyframeEffectReadOnly::GetTarget()
2. nsNodeUtils::GetTargetForAnimation(...)

--HG--
extra : rebase_source : 3b0e117528035329fdf4bdbee127f095b710805a
2016-03-21 16:49:50 +08:00
Olli Pettay
3af8f71a7e Bug 1249428 - Unlink binding properly from element , r=mccr8
--HG--
extra : rebase_source : e549e1f2722173d2829c61a0c98c0d3c338379a5
2016-02-19 21:13:42 +02:00
Boris Chiou
e436478f26 Bug 1244049 - Part 2: Replace nsCSSPseudoElements::Type with CSSPseudoElementType. r=dbaron
Also, try to use forward declaraions for CSSPseudoElementType;

--HG--
extra : rebase_source : c00eb9753e8f618a33aa711538ac45c0132b353c
2016-02-17 21:37:00 +01:00
Boris Chiou
185a769719 Bug 1244049 - Part 1: Define scoped enum for CSSPseudoElement type. r=dbaron
--HG--
extra : rebase_source : e53dd269e47fa97eb259ebd9295d012eacbdb612
2016-02-16 23:07:00 +01:00
Boris Chiou
2f694d7e1e Bug 1174575 - Part 2: Replace Element in KeyframeEffectReadOnly WebIDL. r=birtles, r=smaug
Use (Element or CSSPseudoElement)? as the first arguement of constructor and
the type of target.
2016-02-05 19:01:00 +01:00
Kyle Huey
91efc5a86c Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
Brian Birtles
5d800ef88f Bug 1194639 part 1 - Add AutoMutationBatchForAnimation; r=heycam 2015-10-22 15:16:18 +09:00
Nathan Froyd
01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Brian Grinstead
d23fa8b95a Bug 1034110 - Provide a way to observe mutations for ::before/::after pseudo elements;r=smaug
Adds a new chrome-only MutationObserverInit option called nativeAnonymousChildList
that will cause a mutation to fire when a native anonymous root is bound or unbound
2015-09-24 08:23:32 -07:00
Nicholas Nethercote
647b520991 Bug 1201135 - Rename pldhash.{h,cpp} to PLDHashTable.{h,cpp}. r=mccr8.
--HG--
rename : xpcom/glue/pldhash.cpp => xpcom/glue/PLDHashTable.cpp
rename : xpcom/glue/pldhash.h => xpcom/glue/PLDHashTable.h
extra : rebase_source : 06b9d30db96ed78500fd44d9c0b51609103508a3
2015-09-15 20:49:53 -07:00
Robert O'Callahan
efd3df82d6 Bug 1184842. Add aNewValue to nsIMutationObserver::AttributeWillChange. r=peterv
--HG--
extra : commitid : 8C2GnpowyCS
extra : rebase_source : 3f2948df48fe13f65425345f7b674e4e4869c861
2015-07-25 18:05:19 +12:00
Robert O'Callahan
a1da6d11df Bug 1184842. Pass preparsed attribute values to nsNodeUtils::AttributeWillChange. r=peterv
--HG--
extra : commitid : DTJHf8BqlZS
extra : rebase_source : 36b264f69be235b9095bf95634bd263f6124a711
2015-07-22 15:53:35 +12:00
Robert O'Callahan
1e49288224 Bug 1184842. Pass aOldValue to all mutation observers. r=peterv
--HG--
extra : commitid : CYjyQn3BAqb
extra : rebase_source : ef153c7cf1e08a058d8de6a76dbe7dc343a299fb
2015-07-25 18:01:19 +12:00
Robert O'Callahan
4339caede4 Bug 1184842. Add aOldValue parameter to nsNodeUtils::AttributeChanged. r=peterv
--HG--
extra : commitid : KqRNGrLrGkl
extra : rebase_source : 232a10b649b7c580a0ad3afa0a11a09cdb8b907d
2015-07-21 16:13:53 +12:00
Andrew McCreight
9e8f4b219e Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Brian Birtles
a606228cd8 Bug 1159082 - Rename *Readonly animation interfaces to *ReadOnly. r=smaug 2015-04-30 09:06:43 -04:00
Carsten "Tomcat" Book
b05d97c166 Backed out changeset 1b5fc672f0d4 (bug 1159082) for B2G ICS Emulator opt R6 test failures on a CLOSED TREE
--HG--
rename : dom/animation/AnimationEffectReadOnly.cpp => dom/animation/AnimationEffectReadonly.cpp
rename : dom/animation/AnimationEffectReadOnly.h => dom/animation/AnimationEffectReadonly.h
rename : dom/webidl/AnimationEffectReadOnly.webidl => dom/webidl/AnimationEffectReadonly.webidl
2015-04-30 13:15:04 +02:00
Brian Birtles
4fb166f6b2 Bug 1159082 - Rename *Readonly animation interfaces to *ReadOnly; r=smaug
--HG--
rename : dom/animation/AnimationEffectReadonly.cpp => dom/animation/AnimationEffectReadOnly.cpp
rename : dom/animation/AnimationEffectReadonly.h => dom/animation/AnimationEffectReadOnly.h
rename : dom/webidl/AnimationEffectReadonly.webidl => dom/webidl/AnimationEffectReadOnly.webidl
extra : rebase_source : 5fb31684bf494a57e208d0cfbbc76f65b502fc0e
2015-04-28 10:16:45 +09:00
Brian Birtles
c04588b2f3 Bug 1154615 part 8 - Rename references to players in animation observers; r=jwatt 2015-04-21 10:22:10 +09:00
Brian Birtles
5c7929fd2a Bug 1154615 part 1 - Rename AnimationPlayer to Animation in WebIDL; r=smaug
This patch is a fairly minimal rename of the AnimationPlayer interface. It
leaves a bunch of local variables and helper classes still using the word
"player". These will be addressed in subsequent patches that don't require DOM
peer review.

--HG--
rename : dom/animation/AnimationPlayer.cpp => dom/animation/Animation.cpp
rename : dom/animation/AnimationPlayer.h => dom/animation/Animation.h
rename : dom/webidl/AnimationPlayer.webidl => dom/webidl/Animation.webidl
2015-04-21 10:22:09 +09:00
Brian Birtles
2d26fd38cb Bug 1153734 part 3 - Rename AnimationPlayer.source to AnimationPlayer.effect; r=smaug
There are still some other references to "source" in AnimationPlayer such as
HasInPlayerSource and UpdateSourceContent. These are renamed in a subsequent
patch (that doesn't require DOM peer review).
2015-04-15 08:48:21 +09:00
Brian Birtles
63e2382338 Bug 1153734 part 2 - Rename Animation to KeyframeEffectReadonly; r=smaug
We define KeyframeEffectReadonly in KeyframeEffect.cpp since Web Animations also
defines KeyframeEffect and when we come to implement that I expect we'll define
it in the same class, maybe even using the same object.

This patch also adds a few missing includes in places where
KeyframeEffectReadonly is used so that we're not just cargo-culting it in.

--HG--
rename : dom/animation/Animation.cpp => dom/animation/KeyframeEffect.cpp
rename : dom/animation/Animation.h => dom/animation/KeyframeEffect.h
rename : dom/animation/test/css-animations/test_animation-name.html => dom/animation/test/css-animations/test_effect-name.html
rename : dom/animation/test/css-animations/test_animation-target.html => dom/animation/test/css-animations/test_effect-target.html
rename : dom/animation/test/css-transitions/test_animation-name.html => dom/animation/test/css-transitions/test_effect-name.html
rename : dom/animation/test/css-transitions/test_animation-target.html => dom/animation/test/css-transitions/test_effect-target.html
rename : dom/webidl/Animation.webidl => dom/webidl/KeyframeEffect.webidl
2015-04-15 08:48:21 +09:00
Kartikaya Gupta
3e7ff0d160 Bug 1146843 - Revert part of cset 33c30e283fa8 because the code is used in Fennec. r=snorp 2015-04-02 20:45:50 -04:00
Kartikaya Gupta
fdaed2c4d6 Bug 1144324 - Remove the codepaths that conditionally enable touch events based on touch the presence of touch listeners. r=smaug,jimm 2015-03-19 06:37:39 -04:00
Cameron McCormack
89fb2d451f Bug 1123523 - Part 7: Add utility functions to notify registered nsIAnimationObservers. r=smaug 2015-03-14 16:34:40 +11:00
Cameron McCormack
3496ca27f3 Bug 1123523 - Part 5: Record on a document whether it might have any nsIAnimationObservers registered. r=smaug 2015-03-14 16:34:40 +11:00
Kartikaya Gupta
c6da1df376 Bug 1137267 - Remove unneeded flags to track touch listeners and touch caret. r=smaug,dvander,botond 2015-03-10 09:29:25 -04:00
Andrea Marchesini
2c4f63331f Bug 1134280 - Get rid of Tag() - patch 1 - Is{HTML,XUL,MathML,SVG}Element and IsAnyOf{HTML,XUL,MathML,SVG}Elements, r=smaug 2015-03-03 11:08:59 +00:00
Boris Zbarsky
6decbb1e93 Bug 1131887 part 1. nsNodeUtils::CloneAndAdopt can assume that all nodes are Web IDL objects. r=peterv 2015-02-13 14:34:53 -05:00
Wes Kocher
37a8ad1785 Backed out changeset 763a234926ca (bug 1131887) 2015-02-13 13:25:43 -08:00
Boris Zbarsky
b8a6eed8e5 Bug 1131887 part 1. nsNodeUtils::CloneAndAdopt can assume that all nodes are Web IDL objects. r=peterv 2015-02-13 14:34:53 -05:00