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

120 Коммитов

Автор SHA1 Сообщение Дата
Andrew Osmond 51d273388c Bug 1416328 - Part 2. Expose decoding attribute for img elements. r=bz,tnikkel
This adds support for HTMLImageElement's decoding attribute, as
described by:

https://github.com/whatwg/html/pull/3221
https://whatpr.org/html/3221/images.html#decoding-images

It also exposes the same attribute on SVGImageElement, just as Blink has
chosen to do so.
2018-08-08 07:56:01 -04:00
Andrew Osmond 4392634285 Bug 1416328 - Part 1. Add configurable synchronous decoding hint to nsImageLoadingContent. r=tnikkel
The next part in this series depends on this to implement the
HTMLImageElement's decoding attribute. This functionality allows the
caller to force an nsImageLoadingContent and its associated nsImageFrame
and nsSVGImageFrame objects to synchronously decode an image at draw
time. It will only synchronously decode if it has completed metadata
decoding (i.e. knows its size) and has received all of the encoded data;
this mirrors the load event criteria for an image.
2018-08-08 07:56:01 -04:00
Emilio Cobos Álvarez 8f34c12e14 Bug 1479860: Remove unused aCompileEventHandlers argument from BindToTree. r=bz
Mostly automatic via sed. Only parts which I touched manually (apart from a
couple ones where I fixed indentation or which had mispelled arguments) are the
callers. I may have removed a couple redundant `virtual` keywords as well when
I started to do it manually, I can revert those if wanted.

Most of them are just removing the argument, but in Element.cpp I also added an
assertion for GetBindingParent when binding the ShadowRoot's kids (the binding
parent is set from the ShadowRoot constructor, and I don't think we bind a
shadow tree during unlink or what not which could cause a behavior difference).

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

MozReview-Commit-ID: 2oIgatty2HU
2018-08-01 10:42:54 +02:00
Robert Bartlensky d0daa20803 Bug 1476565: Fix DEAD_STORE errors in dom/base/*. r=baku
MozReview-Commit-ID: IjsOrpz9VF3

--HG--
extra : rebase_source : 0ac09534b0d129564bf986d45145e0967e8182d2
2018-07-18 16:17:22 +01:00
Margareta Eliza Balazs d476711024 Backed out changeset f4f24738dbf7 (bug 1476565) for bustage in /builds/worker/workspace/build/src/dom/base/nsGlobalWindowOuter.cpp on a CLOSED TREE 2018-07-19 16:55:16 +03:00
Robert Bartlensky 3a2bf15b12 Bug 1476565: Fix DEAD_STORE errors in dom/base/*. r=baku
MozReview-Commit-ID: IjsOrpz9VF3

--HG--
extra : rebase_source : 7a7e1f796f24f623afe614297e2f779c916c64e6
2018-07-18 16:17:22 +01:00
Emilio Cobos Álvarez 0da3dae9c9 Bug 1472403: Simplify generated image content. r=bz,dholbert
This way we reuse the same machinery everywhere for the content property.

The only difference is that we need to look at the parent style for content
instead of just our style, and at a given index.

Again, this is fine because changing content reframes, so no chance to mess up.

This allows the generated content stuff to not implement nsImageLoadingContent
and all that stuff, nor deal with events, which makes it much simpler IMO.

Now it just tracks an index. We may not even need for it to be an HTML element,
but I've kept that for now.

I added a crashtest that used to crash because of the bogus
nsCSSFrameConstructor code which trusted the node name without checking it was
native anonymous.

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

MozReview-Commit-ID: 1pAzIvRRVnL
2018-07-16 18:06:38 +02:00
shindli ba72001f71 Backed out 2 changesets (bug 1473813, bug 1472403) for bustages in /builds/worker/workspace/build/src/dom/base/MessageSender.cpp:24:19 on a CLOSED TREE
Backed out changeset 93e4dff7e346 (bug 1473813)
Backed out changeset 365a0841117a (bug 1472403)
2018-07-16 18:45:33 +03:00
Emilio Cobos Álvarez 966f1a9206 Bug 1472403: Simplify generated image content. r=bz,dholbert
This way we reuse the same machinery everywhere for the content property.

The only difference is that we need to look at the parent style for content
instead of just our style, and at a given index.

Again, this is fine because changing content reframes, so no chance to mess up.

This allows the generated content stuff to not implement nsImageLoadingContent
and all that stuff, nor deal with events, which makes it much simpler IMO.

Now it just tracks an index. We may not even need for it to be an HTML element,
but I've kept that for now.

I added a crashtest that used to crash because of the bogus
nsCSSFrameConstructor code which trusted the node name without checking it was
native anonymous.

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

MozReview-Commit-ID: 1pAzIvRRVnL
2018-07-16 17:30:14 +02:00
Olli Pettay 34620de771 bug 1472427, <img usemap> should work in shadow DOM, r=baku 2018-07-04 20:26:09 +03:00
Emilio Cobos Álvarez c7d35aa526 Bug 1470930: Use enums for passing arguments for event dispatch. r=smaug
MozReview-Commit-ID: DsNuF7GAflJ
2018-06-26 18:22:06 +02: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
Boris Zbarsky bea3100e53 Bug 1455676 part 14. Remove most use of nsIDOMNode in dom/. r=qdot 2018-05-29 22:58:49 -04:00
Emilio Cobos Álvarez ac48d4a2a8 Bug 1462272: Remove handling for an impossible condition. r=asuth
The frame is notified via its mListener, which is an observer of the
nsImageLoadingContent (mContent).

This last one only notifies for the current and pending requests, otherwise it's
a bug we need to fix there, not wallpaper here, since that'd mean that we forgot
to cancel the previous request. Added assertions to that effect.

Notify() is only called with the this object as a first argument from
imgRequestProxy, so it'd better be non-null, too.

MozReview-Commit-ID: DHaOLph2EAo
2018-05-25 12:09:23 +02:00
Emilio Cobos Álvarez f981370133 Bug 1462272: Introduce nsImageFrame::GetCurrentRequest. r=dholbert
MozReview-Commit-ID: IXXtYClyY2z
2018-05-25 12:09:42 +02:00
Valentin Gosu bd4365d7e7 Bug 1448058 - Remove nsIMutable from URI implementations r=mayhemer
* Also removes NS_TryToMakeImmutable, NS_TryToSetImmutable, URIIsImmutable
* NS_EnsureSafeToReturn, nsINetUtil.toImmutableURI

MozReview-Commit-ID: 5eFtFm2CQt7

--HG--
extra : rebase_source : 1f3d23ec646883e76844d42113bc1c71c01a1ad7
2018-05-09 18:21:24 +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
Boris Zbarsky c6d492b79e Bug 1445670. Make sure to clear out the pending request when our image gets blocked by the data document policy. r=jdm 2018-04-04 14:40:01 -04:00
Brad Werth 9805f317cb Bug 1418930 Part 1: Define and use a method nsContentUtils::CORSModeToLoadImageFlags to standardize conversion of CORS modes to load image flags. r=bz
MozReview-Commit-ID: AqsEUhFYxH6

--HG--
extra : rebase_source : 94ab4f3b1e5729cce8a2572c949b174fc74fd878
2018-01-31 11:10:01 -05:00
Andreea Pavel 9cd5dfd3a9 Backed out 5 changesets (bug 1418930) for failing web platform tests at /service-workers/service-worker/fetch-request-css-images.https.html on a CLOSED TREE
Backed out changeset c0f673033e66 (bug 1418930)
Backed out changeset b39948ba905b (bug 1418930)
Backed out changeset 8008a54aba9a (bug 1418930)
Backed out changeset 105c81284dba (bug 1418930)
Backed out changeset 27eb8c7f8025 (bug 1418930)
2018-02-03 00:18:27 +02:00
Brad Werth e7b31713ef Bug 1418930 Part 1: Define and use a method nsContentUtils::CORSModeToLoadImageFlags to standardize conversion of CORS modes to load image flags. r=bz
MozReview-Commit-ID: AqsEUhFYxH6

--HG--
extra : rebase_source : 60a367491f4e1d80f434a1f2afe3b09b773fc8d1
2018-01-31 11:10:01 -05:00
Boris Zbarsky 3acfd47047 Bug 1431774 part 7. de-COM the image loading content forceImageState API. r=mystor
MozReview-Commit-ID: LKlo36VHKP5
2018-01-19 14:19:39 -05:00
Boris Zbarsky d4e9c1bbea Bug 1431774 part 6. de-COM the image loading content forceReload API. r=mystor
MozReview-Commit-ID: 4n5BFQcHopU
2018-01-19 14:19:39 -05:00
Boris Zbarsky 0840bfb13a Bug 1431774 part 5. de-COM the image loading content setBlockedRequest API. r=mystor
MozReview-Commit-ID: 1hm4WzQK93U
2018-01-19 14:19:39 -05:00
Boris Zbarsky bd87915168 Bug 1431774 part 4. de-COM the image loading content observer APIs. r=mystor
MozReview-Commit-ID: KwWBFXNzWVx
2018-01-19 14:19:39 -05:00
Boris Zbarsky 985bac7189 Bug 1431774 part 3. de-COM the image loading content loadingEnabled API. r=mystor
MozReview-Commit-ID: 3JpN3ZZVNg3
2018-01-19 14:19:39 -05:00
Samael Wang 9d2c8ac38e Bug 1406253 - Part 2: Implement nsIImageLoadingContent.currentRequestFinalURI. r=bz
ImageLoadingContent.currentURI returns the "URI" of currentRequest, which is
the URI used to start that request.  Some consumers need to know the final URI
of that request instead.

If the image request gets redirected on loading (e.g. an add-on intercepts the
request), currentRequestFinalURI will be the redirected URI, while currentURI
would be the original URI before redirect.

MozReview-Commit-ID: 9lX063uAIp1

--HG--
extra : rebase_source : 91451128abc5c3f29c11d3cabfc98cde6c440ea6
2017-11-14 18:20:03 +08:00
Noemi Erli e90c67896c Backed out 3 changesets (bug 1406253)for build bustage in dom/base/nsCopySupport.cpp r=backout on a CLOSED TREE
Backed out changeset 284f3cc2880c (bug 1406253)
Backed out changeset aecb3d509a39 (bug 1406253)
Backed out changeset 9ce01198e8a1 (bug 1406253)
2017-11-20 13:34:29 +02:00
Samael Wang 9a66d9924f Bug 1406253 - Part 2: Implement nsIImageLoadingContent.currentRequestFinalURI. r=bz
ImageLoadingContent.currentURI returns the "URI" of currentRequest, which is
the URI used to start that request.  Some consumers need to know the final URI
of that request instead.

If the image request gets redirected on loading (e.g. an add-on intercepts the
request), currentRequestFinalURI will be the redirected URI, while currentURI
would be the original URI before redirect.

MozReview-Commit-ID: 9lX063uAIp1

--HG--
extra : rebase_source : 6e9752b4df52e3874815557fe727c3fe94af2902
2017-11-14 18:20:03 +08:00
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