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

91 Коммитов

Автор SHA1 Сообщение Дата
Andrew Osmond 95ee2e55dc Bug 1404422 - Part 4. Remove imgIOnloadBlocker and related from tree as redundant. r=tnikkel 2017-11-01 06:59:10 -04:00
Yoshi Huang 26c9043304 Bug 1407498 - Don't query loadingprincipal in common case. r=baku
We queried 'loadingprincipal' attribute on the common call path, however
this should be queried if it's loaded by System Principal.

Also rename loadingprincipal to triggeringprincipal
2017-10-24 10:13:31 +08:00
Kris Maglione d72aa193c4 Bug 1406278: Part 2b - Use subject principal as triggering principal in <img> "src" attribute. r=bz
MozReview-Commit-ID: DrblTjP99WJ

--HG--
extra : rebase_source : 649cf6757266c9e08a3f5a621c3e9451a7ccef67
2017-10-02 20:28:32 -07:00
Kris Maglione 1e39590f6d Bug 1406278: Part 2a - Rename LoadingPrincipal to TriggeringPrincipal in imgLoader. r=bz
The imgLoader code consistently uses the term 'loadingPrincipal' for the
principal that is called the triggeringPrincipal everywhere else it's used.
This is confusing, and since we need to make changes to how those values are
determined, it should be fixed beforehand.

MozReview-Commit-ID: 8CTHwayzcaD

--HG--
extra : rebase_source : d4405b0ecfe1c8dfb9bfdf61fe6ed6cfb180ba83
2017-10-02 20:38:30 -07:00
Yoshi Huang a59d7bb86f Bug 1376971 - Part 3: Query loadingprincipal attribute in image. r=baku
For image loading, we try to query if the node has 'loadingprincipal'
attribute. If it does, we use the deserialized value of
'loadingprincipal', and change the contentPolicyType to favicon, as we
will set the origin attribute on the loadInfo of the channel if the
contentType is favicon in [1].

[1]: http://searchfox.org/mozilla-central/rev/d08b24e613cac8c9c5a4131452459241010701e0/image/imgLoader.cpp#782
2017-09-26 12:41:23 +08:00
Kershaw Chang 53cf0a2a8e Bug 1247843 - Part 3: Set request context ID to the http channel created in imgLoader::LoadImage. r=baku
In order to let necko postpone the load of favicon, we have to set request context ID to the http channel that is created to load favicon.
This patch starts with passing a request context ID to nsContentUtils::LoadImage and makes other necessary changes to set the request context ID to the channel.
2017-09-20 20:09:00 -04:00
Jonathan Watt 341ea5e4f1 Bug 1401356, part 2 - Rename nsSVGEffects to SVGObserverUtils. r=longsonr 2017-08-30 15:58:31 +01:00
Jonathan Watt 0e4feb75d3 Bug 1401356, part 1 - Rename nsSVGEffects.h/.cpp to SVGObserverUtils.h/.cpp. r=longsonr
--HG--
rename : layout/svg/nsSVGEffects.cpp => layout/svg/SVGObserverUtils.cpp
rename : layout/svg/nsSVGEffects.h => layout/svg/SVGObserverUtils.h
2017-08-30 14:14:46 +01:00
Yoshi Huang d8fec521e0 Bug 1371545 - Remove NS_ERROR_IMAGE_SRC_CHANGED and NS_ERROR_IMAGE_BLOCKED. r=smaug 2017-08-22 19:02:09 +08:00
Andrew Osmond a0321e7db6 Bug 1359833 - Part 6. nsImageLoadingContent should not associate scripted and XPCOM observers with the same document. r=tnikkel 2017-07-19 14:15:11 -04:00
Andrew Osmond 02e515fc18 Bug 1359833 - Part 5. Callers pass the loading document to imgRequestProxy::SyncClone and GetStaticRequest. r=tnikkel 2017-07-19 14:15:11 -04:00
Timothy Nikkel f5f492a80c Bug 1376087. r=bz 2017-06-28 18:45:55 -04:00
Masatoshi Kimura b515c9c804 Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen
MozReview-Commit-ID: GF0YXDwfA14

--HG--
extra : rebase_source : fdae0046f882d47fb539a7f882364e5c5caafdcd
extra : source : 49249788c0dee331ac2989dc39f0505d965a7bd8
2017-06-18 20:37:50 +09:00
Sebastian Hengst dfc1ad2562 Backed out changeset 7235d05662b0 (bug 1373984) for Android bustage. r=backout on a CLOSED TREE 2017-06-25 18:30:13 +02:00
Masatoshi Kimura 2e04751921 Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen
MozReview-Commit-ID: GF0YXDwfA14

--HG--
extra : rebase_source : a84ab644f52e68676b45f112ff69f868d89f6177
extra : source : 49249788c0dee331ac2989dc39f0505d965a7bd8
2017-06-18 20:37:50 +09:00
Wes Kocher e02435a31e Backed out changeset 77af189b5c49 (bug 1373984) for build bustage in nsHtml5Parser.cpp a=backout CLOSED TREE
MozReview-Commit-ID: 6kBmU71j2To
2017-06-25 05:10:14 -07:00
Masatoshi Kimura 241039fd97 Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen
MozReview-Commit-ID: GF0YXDwfA14

--HG--
extra : rebase_source : 09da1685795583513bf019d61c58230c2c4d298d
extra : source : 49249788c0dee331ac2989dc39f0505d965a7bd8
2017-06-18 20:37:50 +09:00
Nicholas Nethercote fe9268c4cd Bug 1374580 (part 2) - Remove nsAFlat{,C}String typedefs. r=froydnj.
All the instances are converted as follows.

- nsAFlatString  --> nsString
- nsAFlatCString --> nsCString

--HG--
extra : rebase_source : b37350642c58a85a08363df2e7c610873faa6e41
2017-06-20 19:19:05 +10:00
Yoshi Huang 8af20dccc4 Bug 1267075 - Part 4: add a boolean to prevent calling asynchronously. r=bz
Use a boolean to prevent calling SetBlockedRequest asynchronously.
Also use the same boolean to prevent some evil code reenters LoadImage.

Then we should redesign the correct bahavior in those follow-up bugs,
Bug 1353685 - Should ServiceWorker call SetBlockedRequest
Bug 1353683 - consider calling SetBlockedRequest in nsCORSListenerProxy::UpdateChannel
Bug 1371237 - consider calling SetBlockedRequest in nsContentSecurityManager::CheckChannel
2017-06-16 10:12:09 +08:00
Yoshi Huang 83ef929df9 Bug 1267075 - Part 2: bail out early if it's for data document. r=bz
Check the document earlier before calling into imageLoader, this could
save us tons of time if in the end the document isn't allowed to load images.
2017-06-16 10:12:09 +08:00
Yoshi Huang 5dcdd16255 Bug 1267075 - Part 1: call SetBlockedRequest when CSP check failed. r=bz
As a follow-up from bug 1206961, we will remove calling CanLoadImage in
this bug. Also in the case of CSP check failed, we will call
SetBlockedRequest in those cases.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1267075#c30 for the
analysis between the old and new setup.
2017-06-16 10:12:08 +08:00
Timothy Nikkel c8ba76db41 Bug 1366875. Apply the same sync decoding heuristic to SVG <image> as we do to HTML <img>. r=mats
--HG--
rename : layout/svg/nsSVGImageFrame.cpp => layout/svg/nsSVGImageFrame.h
2017-05-23 14:11:13 -05:00
Tom Tung 0e308b0c4f 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

--HG--
extra : rebase_source : 715352317b4b600f8a7f78b7bc22b894bb272d27
2017-04-25 09:17:38 +08:00
Nicholas Nethercote bc1d6a21a2 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 1a3e66f9b9 Bug 1348972. nsImageLoadingContent::MakePendingRequestCurrent should transfer mPendingRequestRegistered flag to mCurrentRequestRegistered. r=mats 2017-04-01 00:35:32 -05:00
Timothy Nikkel b23763af59 Bug 1346501. Remove mFrameCreateCalled from nsImageLoadingContent, it is now unused. r=mats 2017-03-22 00:32:50 -05:00
Timothy Nikkel ca076ee1dd 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 2c3a8eee0b 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 9a3ff09f1a Bug 1338086 - Remove useless else blocks in order to reduce complexity in dom/base/ r=Ehsan
MozReview-Commit-ID: 5sCNbqC4ew3

--HG--
extra : rebase_source : ca9b4b02d3f438cf7e907bf0c32623d7ab9e6bc9
2017-02-09 15:44:02 +01:00
Edgar Chen bc56617eab 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 3428a70b8d 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 02491ce187 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

--HG--
extra : rebase_source : 9ffdafb1f6654a90ab5e93594ffcb11e987f2b5e
2016-12-14 16:28:57 -08:00
Sebastian Hengst 22179cd574 Backed out changeset 491237dbcb5d (bug 1323207) 2016-12-16 20:06:43 +01:00
Andrew McCreight d8103c4981 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

--HG--
extra : rebase_source : 1a7eda2a711f079978b54012d9c7466bbd6de36f
2016-12-14 16:28:57 -08:00
Edgar Chen 64cc70e197 Bug 1308069 - Clear pending error event fired by src="" case if src changed before it fired. r=bz
MozReview-Commit-ID: B8f975mZNN9

--HG--
extra : rebase_source : b44b969c733160a9e96139b6b55ac60fb140e478
2016-10-06 12:30:35 +08:00
Cameron McCormack c1f0ee12ba Bug 1309082 - Part 2: Rename some ImageTracker members. r=bholley
MozReview-Commit-ID: 6yOIKKl8npT

--HG--
extra : rebase_source : 247787a0e18640c878e461c4b600bc36a40bad6d
2016-10-13 15:04:19 +08:00
Cameron McCormack 58c32a9088 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

--HG--
extra : rebase_source : 2d50059e51b42251c89a92a954cef7b49720ceba
2016-10-13 15:04:15 +08:00
Ben Tian e2f03e4b07 Bug 1264769 - Patch 2: Dispatch loadstart event for image loading, r=hsivonen
--HG--
extra : rebase_source : 8d10beb495f631364a95c4247e31cae2b04c6f63
2016-10-05 10:06:27 +08:00
Boris Zbarsky 99faedc1aa Bug 1304515. Remove the unused WebIDL version of ImageLoadingContent.loadImageWithChannel. r=ehsan 2016-09-22 16:58:35 +01:00
Timothy Nikkel 0b6fd97ae9 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 cb67cca872 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 88bb36312b 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 b255460f26 Bug 599975 - Fire error event for images with empty string src value; r=bz
MozReview-Commit-ID: AhXiTpgG9q3

--HG--
extra : rebase_source : fe03d94a08232e90a475529746b38b27c2591ec9
2016-09-08 16:27:03 +08:00
Iris Hsiao 0e573bbb04 Backed out changeset ee163e1d915a (bug 1264769) for fixing regression of bug 1298725
CLOSED TREE
2016-08-31 10:46:27 +08:00
Ben Tian 232f8ad41b Bug 1264769 - Part 2: Dispatch loadstart event for image loading. r=hsivonen
--HG--
extra : rebase_source : b64b9f2dfe8d112bd0cde5ad2fe9f11aa5807c9d
2016-07-12 10:56:42 +08:00
Ben Tian 7d5abfc007 Bug 1264769 - Part 1: Dispatch loadend event for image loading. r=hsivonen
--HG--
extra : rebase_source : 8843a2a3c56c74dc1838f2da3c8251783e20f295
2016-08-16 12:01:12 +08:00
Wes Kocher e386a2bc9e 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 1dec47a521 Bug 1264769 - Part 2: Dispatch loadstart event for image loading. r=hsivonen
--HG--
extra : rebase_source : 35df083492f43de8179c4ac50d82d20666ab9bf3
2016-07-12 10:56:42 +08:00
Ben Tian 5c79574178 Bug 1264769 - Part 1: Dispatch loadend event for image loading. r=hsivonen
--HG--
extra : rebase_source : efa121de9a8b3b8bcd9639b59780d7b2340bdfef
2016-07-20 11:01:46 +08:00
bentian 33cf3aca7f Bug 1264768 - Dispatch error event when image loads for URLs that fail to resolve, r=hsivonen
--HG--
extra : rebase_source : 109914a4204a4dcf2f21e861da269e5bb476acf0
2016-06-10 15:35:51 +08:00