Commit Graph

70 Commits

Author SHA1 Message Date
Timothy Nikkel
0063a0e701 Bug 1366875. Apply the same sync decoding heuristic to SVG <image> as we do to HTML <img>. r=mats 2017-05-23 14:11:13 -05:00
Tom Tung
dc2648e8f2 Bug 1348050 - Part 3: Mark channel as urgent-start for loading image. r=baku,mayhemer
This part is mainly to mark the channel as urgent-start if src related
attributes in HTMLImageElement and HTMLInputElement is set and the channel is
open due to user interaction. Unfortunately, we cannot just check the event
state just after creating channel since some loading image tasks will be queue
and execute in stable state. Thus, I store the event state in elements and
pass it to the place where create the channel.

MozReview-Commit-ID: GBdAkPfVzsn
2017-04-25 09:17:38 +08:00
Nicholas Nethercote
c768a954ae Bug 1358320 - Make TimeStamp::ProcessCreation()'s outparam optional. r=gsvelto.
TimeStamp::ProcessCreations()'s aIsInconsistent outparam is ignored by the
majority of its caller. This patch makes it optional. Notably, this makes
ProcessCreation() easier to use in a constructor's initializer list.
2017-04-26 14:55:54 +10:00
Timothy Nikkel
1f38cc946b Bug 1348972. nsImageLoadingContent::MakePendingRequestCurrent should transfer mPendingRequestRegistered flag to mCurrentRequestRegistered. r=mats 2017-04-01 00:35:32 -05:00
Timothy Nikkel
f049521b53 Bug 1346501. Remove mFrameCreateCalled from nsImageLoadingContent, it is now unused. r=mats 2017-03-22 00:32:50 -05:00
Timothy Nikkel
3d9218756c Bug 1346501. Don't mark every image as visible when a frame is created for it. r=mats
This is a bug from https://hg.mozilla.org/mozilla-central/rev/2d171d75b746 (bug 1157546). It took a shortcut in trying to get around one of the downsides of tracking visibility on frames instead of content nodes.

We cannot get our primary frame during FrameCreate calls because FrameCreate is called during the frame's Init() function, which happens before the primary frame pointer is set.

So when TrackImage is called from FrameCreate |frame| will be null but mFrameCreateCalled will be true. So we won't hit the early return that tries to detect nonvisible images.

The comment being removed is just wrong. We can obtain a frame for <feImage> just as well as any other image type.

The thing that is different about <feImage> is that it calls IncApproximateVisibleCount() followed by FrameCreated() in the frame's Init() function. This means that the frame is marked visible at the time of the FrameCreated, and there will be no further calls to TrackImage (because there are no further changes). So the FrameCreated call is the last chance to mark this image visible. The regressing changeset tries to get around this by just considering the image visible whenever we know a frame exists (because of mFrameCreateCalled) but can't access it. This ends up affecting all types of images, not just <feImage>.

The above paragraph is also true for SVG <image> that are non-display.
2017-03-22 00:32:48 -05:00
Boris Zbarsky
26af9e4884 Bug 1347639. Add nsImageLoadingContent::AsContent to make getting the relevant nsIContent* faster. r=qdot
MozReview-Commit-ID: 9sE3pbHwYbV
2017-03-16 17:43:34 -04:00
Sylvestre Ledru
e3d60e5b2e Bug 1338086 - Remove useless else blocks in order to reduce complexity in dom/base/ r=Ehsan
MozReview-Commit-ID: 5sCNbqC4ew3
2017-02-09 15:44:02 +01:00
Edgar Chen
d2e195aa40 Bug 1321300 - Back out bug 1264768 and add test; r=hsivonen
MozReview-Commit-ID: KsN18tG0Ptb
2017-01-09 11:50:55 +08:00
Timothy Nikkel
7b03c0d788 Bug 1324642. Move assert from bug 1323207 from nsImageLoadingContent::Notify to ScriptedNotificationObserver. r=continuation
nsImageLoadingContent::Notify is where all image notifications for things like <img> elements go through. The vast majority being implemented in C++. Any image observers implemented in JS must go through ScriptedNotificationObserver.

We only use ScriptedNotificationObserver in tests. The addon repository only has six hits, and four of them seem to be different versions of the same addon. And they don't seem to be among the more popular addons.

The original location of the assert only caught some images anyway. Things like CSS background images don't go through nsImageLoadingContent. ProgressTracker is the origin of all image notifications.
2016-12-20 13:49:31 -06:00
Andrew McCreight
96e89c4b4a Bug 1323207, part 2 - Assert early if we're painting at various points we enter JS. r=billm
nsContentUtils::IsPatternMatching is the most common by far, but the
other is a generic location that may cover a number of issues.

MozReview-Commit-ID: Kli39btsqdd
2016-12-14 16:28:57 -08:00
Sebastian Hengst
8cc04411fc Backed out changeset 491237dbcb5d (bug 1323207) 2016-12-16 20:06:43 +01:00
Andrew McCreight
044305c3cd Bug 1323207, part 2 - Assert early if we're painting at various points we enter JS. r=billm
nsContentUtils::IsPatternMatching is the most common by far, but the
other two are generic locations that may cover a number of issues.

MozReview-Commit-ID: Kli39btsqdd
2016-12-14 16:28:57 -08:00
Edgar Chen
f1406505a9 Bug 1308069 - Clear pending error event fired by src="" case if src changed before it fired. r=bz
MozReview-Commit-ID: B8f975mZNN9
2016-10-06 12:30:35 +08:00
Cameron McCormack
92e70f0cf6 Bug 1309082 - Part 2: Rename some ImageTracker members. r=bholley
MozReview-Commit-ID: 6yOIKKl8npT
2016-10-13 15:04:19 +08:00
Cameron McCormack
a8ce0e16c4 Bug 1309082 - Part 1: Extract image tracking from nsDocument into a separate, refcounted object. r=bholley
This is refcounted as we'll need to hold strong references to the ImageTracker
from style structs that load images.

MozReview-Commit-ID: 994gE9tOjAn
2016-10-13 15:04:15 +08:00
Ben Tian
bf7bc48edb Bug 1264769 - Patch 2: Dispatch loadstart event for image loading, r=hsivonen 2016-10-05 10:06:27 +08:00
Boris Zbarsky
ea2a869fda Bug 1304515. Remove the unused WebIDL version of ImageLoadingContent.loadImageWithChannel. r=ehsan 2016-09-22 16:58:35 +01:00
Timothy Nikkel
1df76568d8 Bug 1284350. Backed out changeset 69abdc731a99 (Bug 1261554 (Part 1) - Prepare for implementing in-displayport visibility tracking. r=mstange) 2016-09-12 00:19:08 -05:00
Timothy Nikkel
b41427ff1e Bug 1284350. Backed out changeset d6a286242f2d (Bug 1268348 - Pass the previous visibility state to OnVisibilityChange(). r=mstange) 2016-09-12 00:19:07 -05:00
Timothy Nikkel
94f662b139 Bug 1284350. Backed out changeset 4517cddd204e (Bug 1269934 - Handle visible frame sets more generically in PresShell. r=mstange) 2016-09-12 00:19:07 -05:00
Edgar Chen
20e5d43181 Bug 599975 - Fire error event for images with empty string src value; r=bz
MozReview-Commit-ID: AhXiTpgG9q3
2016-09-08 16:27:03 +08:00
Iris Hsiao
9904feaf40 Backed out changeset ee163e1d915a (bug 1264769) for fixing regression of bug 1298725
CLOSED TREE
2016-08-31 10:46:27 +08:00
Ben Tian
aadbae7903 Bug 1264769 - Part 2: Dispatch loadstart event for image loading. r=hsivonen 2016-07-12 10:56:42 +08:00
Ben Tian
e93649f7b1 Bug 1264769 - Part 1: Dispatch loadend event for image loading. r=hsivonen 2016-08-16 12:01:12 +08:00
Wes Kocher
035bf451ff Backed out 2 changesets (bug 1264769) for invalid-src.html wpt failures a=backout
Backed out changeset 7b9d3d0c09f5 (bug 1264769)
Backed out changeset 780f7036c084 (bug 1264769)
2016-08-15 13:35:46 -07:00
Ben Tian
8b8d8e14ab Bug 1264769 - Part 2: Dispatch loadstart event for image loading. r=hsivonen 2016-07-12 10:56:42 +08:00
Ben Tian
6e58bfa7cd Bug 1264769 - Part 1: Dispatch loadend event for image loading. r=hsivonen 2016-07-20 11:01:46 +08:00
bentian
2ece4ec480 Bug 1264768 - Dispatch error event when image loads for URLs that fail to resolve, r=hsivonen 2016-06-10 15:35:51 +08:00
Jonathan Watt
9c5b8de022 Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
Seth Fowler
69cb11364d Bug 1269934 - Handle visible frame sets more generically in PresShell. r=mstange 2016-05-11 19:27:27 -07:00
Seth Fowler
a897d09931 Bug 1268348 - Pass the previous visibility state to OnVisibilityChange(). r=mstange 2016-05-11 19:27:27 -07:00
Seth Fowler
40ecfeebae Bug 1261554 (Part 1) - Prepare for implementing in-displayport visibility tracking. r=mstange 2016-04-21 01:21:58 -07:00
Christoph Kerschbaumer
8ffee19dd7 Bug 1256999 - Pass the right context to new channels for image loads. r=bz r=seth 2016-04-11 10:58:03 +02:00
Seth Fowler
0f24c44100 Bug 1157546 - Replace the image visibility API with a more general API that tracks visibility for any kind of frame. r=mstange 2016-03-25 14:49:43 -07:00
Birunthan Mohanathas
6129a0880a Bug 1217307 - Remove some unnecessary null checks in dom/base/. r=njn 2015-11-19 09:13:49 +02:00
Seth Fowler
44cc0db006 Bug 1207355 (Part 2) - Stop requesting decodes in nsImageLoadingContent. r=tn 2015-10-29 16:37:42 -07:00
Phil Ringnalda
f09341276b Back out 8 changesets (bug 1207355) for OS X 10.10 reftest failures in generated-content/
CLOSED TREE

Backed out changeset aafd6db2fbb4 (bug 1207355)
Backed out changeset 9dd950b837fb (bug 1207355)
Backed out changeset e941e0e106a1 (bug 1207355)
Backed out changeset ecebca101fcb (bug 1207355)
Backed out changeset 08f2017137e1 (bug 1207355)
Backed out changeset 3dc69e37c9b4 (bug 1207355)
Backed out changeset bcdf51edb121 (bug 1207355)
Backed out changeset 1d4c00dbf49a (bug 1207355)
2015-10-28 22:57:43 -07:00
Seth Fowler
36866e2138 Bug 1207355 (Part 2) - Stop requesting decodes in nsImageLoadingContent. r=tn 2015-10-28 16:40:43 -07:00
Nathan Froyd
4e6d8f6705 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
2015-10-18 01:24:48 -04:00
Christoph Kerschbaumer
0e075876c3 Bug 1048048 - add preload content policy types for images (r=seth) 2015-09-20 14:55:59 -07:00
Wes Kocher
7e27875d2c Backed out 7 changesets (bug 1048048) for android crashes in various chunks CLOSED TREE
Backed out changeset b5abe23a4ea5 (bug 1048048)
Backed out changeset 4f91b10e8be0 (bug 1048048)
Backed out changeset 450d4a13c90e (bug 1048048)
Backed out changeset 6a727c40eb68 (bug 1048048)
Backed out changeset 88c2333ff745 (bug 1048048)
Backed out changeset 740ab1ecd079 (bug 1048048)
Backed out changeset 02c6d6aef163 (bug 1048048)
2015-09-21 09:08:34 -07:00
Christoph Kerschbaumer
46f476eda8 Bug 1048048 - add preload content policy types for images (r=seth) 2015-09-20 14:55:59 -07:00
Cameron McCormack
e13f913db1 Bug 968923 - part 3b - propagating use counters from SVG images into owning/parent documents; r=seth 2015-06-03 13:42:07 -04:00
Franziskus Kiefer
7be01504dd Bug 1174913 - remove unnecessary attribute parsing. r=bz 2015-07-13 18:04:42 -07:00
Seth Fowler
d8ebf7a220 Bug 1151359 (Part 1) - Predict the size of nsImageFrame images before drawing. r=tn 2015-07-19 19:30:35 -07:00
Botond Ballo
b57e8ac71f Bug 1181832 - Include gfxPrefs.h from nsImageLoadingContet.cpp to fix bustage on a CLOSED TREE. r=bustage 2015-07-13 14:25:13 -04:00
Birunthan Mohanathas
a29151dc87 Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Seth Fowler
e043206210 Bug 1177587 - Detect use of <img> elements for animation and use sync decoding to reduce flicker. r=tn 2015-07-07 14:00:08 -07:00
Franziskus Kiefer
7a586a418e Bug 1166910 - Referrer attribute for img tag. r=ckerschb, r=hsivonen, r=bz 2015-06-05 15:25:24 -07:00