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

323 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 0bae88943a Bug 1590426 - Cleanup signatures in nsImageFrame / nsImageControlFrame. r=tnikkel
In particular, remove useless virtual keywords per our style guide, and remove
redundant argument names (argument names where the name is contained in the type
of the argument), since they're somewhat useless.

I think the result looks neater.

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

--HG--
extra : moz-landing-system : lando
2019-10-22 19:05:21 +00:00
Emilio Cobos Álvarez 2c65109365 Bug 1589955 - Sync-decode images when intrinsic ratio between the old and new source changes. r=tnikkel
This seems to fix it for me, and it's pretty straight-forward, but I _think_
we'd still paint the old image if the image is huge and it's loading, which
may be counter-productive. Maybe we should guard the whole "paint mOldImage"
with and if (!oldImageIsDifferent), wdyt?

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

--HG--
extra : moz-landing-system : lando
2019-10-23 12:22:06 +00:00
Boris Zbarsky 5062731c15 Bug 1565688. Remove unused IOService arg from NS_NewURI. r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D37968

--HG--
extra : moz-landing-system : lando
2019-07-15 13:39:51 +00:00
Emilio Cobos Álvarez fc7fce15f7 Bug 1547231 - Make mapped aspect-ratio get reflected in images. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D29039

--HG--
extra : moz-landing-system : lando
2019-06-26 22:10:08 +00:00
Emilio Cobos Álvarez b3863ed908 Bug 1547792 - AspectRatio should be a single ratio, not a size. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D29244

--HG--
extra : moz-landing-system : lando
2019-05-02 23:28:21 +00:00
Masayuki Nakano f5737567dd Bug 1544343 - part 3: Make layout use mozilla::PresShell instead of nsIPresShell as far as possible r=emilio
This patch changes remaining things under `layout/`.  However, there are some
places which still need to use `nsIPresShell`.  That will be fixed in a
follow up bug.

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

--HG--
extra : moz-landing-system : lando
2019-04-16 07:25:10 +00:00
Masayuki Nakano 2f9688c14e Bug 1544343 - part 2: Make factory methods take mozilla::PresShell instead of nsIPresShell r=emilio
Additionally, this patch makes `nsFrame.h` stop including `nsIPresShell.h`
and makes each users include `mozilla/PresShell.h` instead.  So, this improves
rebuild performance of `nsIPresShell.h` (and `mozilla/PresShell.h` in the
future).

Note that due to `nsIFrame::PresShell()`, `mozilla::` prefix is necessary for
`PresShell` in a lot of classes which are derived from `nsIFrame` even in
`.cpp` files.

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

--HG--
extra : moz-landing-system : lando
2019-04-16 07:24:49 +00:00
Will Hawkins b3e38bb341 Bug 1354913: Fix nsDeckFrame, nsImageBoxFrame and nsImageFrame so that nsDeckFrame does not tick the refresh driver when its child images are animated and hidden. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D24598

--HG--
extra : moz-landing-system : lando
2019-03-25 19:11:22 +00:00
Emilio Cobos Álvarez a5a514eff4 Bug 1534914 - Improve blocked cursor behavior to fall back to next image. r=smaug
Right now we just block the image returned from nsIFrame::GetCursor, which is
the first loading cursor image.

I think we should do the same we do when the image fails to load, which is to
fall back to the next image instead.

This patch moves all the custom cursor code selection logic to
EventStateManager, and lets the frame return a CursorKind and whether custom
images are allowed.

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

--HG--
extra : moz-landing-system : lando
2019-03-13 18:38:09 +00:00
Emilio Cobos Álvarez 12867b1a3f Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D18734
2019-02-07 11:15:36 +01:00
Doug Thayer a848222b53 Bug 1441308 - Split out document pieces of WebRenderLayerManager r=jrmuizel
Per our discussion, this patch splits out the state management bits of
WebRenderLayerManager, allowing for them to be maintained per-document.

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

--HG--
extra : moz-landing-system : lando
2019-01-07 21:33:10 +00:00
Kevin Chen 00e4495e5d Bug 1345388. Draw the alt feedback of an image with WedRender so we don't have to use fallback. r=aosmond
This is a fairly direct copy of nsImageFrame::DisplayAltFeedback changed to use WebRender.
2018-01-10 16:32:48 +08:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Emilio Cobos Álvarez 8e1f58b955 Bug 1506592 - Make sure to only display the broken image icon if there's a request at all. r=bzbarsky
This is enough to fix the devtools regression and matches what other browsers
do in the no-attribute case.

Also, I think this change over all makes sense: it doesn't make any sense to
display the broken image icon if there's no request, and we already assume in
EnsureIntrinsicSizeAndRatio() that we don't paint the icon for those (and make
the intrinsic size 0x0).

We still show the border, which matches other UAs (note that devtools
effectively masks the border away with mask-image).

This technically also can change behavior of <object> and <input>, but I think
it's better to be consistent, since EnsureIntrinsicSizeAndRatio also doesn't
special-case <img> either.

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

--HG--
extra : moz-landing-system : lando
2018-11-13 10:55:59 +00:00
Ting-Yu Lin 1d9848a22a Bug 916972 - Eliminate nsIFrame::GetSplittableType() completely. r=mats,dholbert
Currently, GetSplittableType() is called only in
nsCSSFrameConstructor::CreateContinuingFrame(). The splittable concrete frames
should inherit from nsSplittableFrame, and must explicitly create continuing
frame in CreateContinuingFrame(). Thus, no need to maintain GetSplittableType().

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

--HG--
extra : moz-landing-system : lando
2018-11-05 19:11:12 +00:00
Gerald Squelart b099eab802 Bug 1488684 - Made nsIFrame-derived classes and some others 'final' where possible - r=dbaron
All classes deriving from nsIFrame that did not have any subclasses themselves
(at the time of writing this patch) have been marked with `final`.
Some other Layout classes have also been made final, but this was opportunistic
while working on nsIFrame subclasses, and is definitely not exhaustive, further
patches welcome; refer to bug 1332680.

Advantages of marking a class final include:
- Allowing the compiler to devirtualize some method calls (i.e., calling
  virtual functions directly instead of going through the vtable),
- Indicating that the class is not currently subclassed,
- Preventing subclassing without being aware that this would remove the
  finalization benefits of the parent class.
`final` does not signify that these classes should *never* be subclassed, this
is left for developers to decide.

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

--HG--
extra : moz-landing-system : lando
2018-09-06 01:23:14 +00:00
Emilio Cobos Álvarez 26b508d03c Bug 1478069: Trivial frame constructor cleanup. r=TYLin
Using references helps to see when stuff can and cannot be null.

I removed useless aTag / aNamespaceId arguments which are useless now that XBL
can't override them (bug 1450617), so FindXULData is the only one that keeps
them alive.

Also, I took the liberty of renaming a few fooComputedStyle variables to just
fooStyle, and clarify naming in some pseudo-element-related functions to say
originating element (the spec term) and avoid confusing it with the generated
_moz_generated_content_before / _moz_generated_content_after element.

Note that this is a partial state, more stuff will come in the future.

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

MozReview-Commit-ID: 39B30doREUH
2018-07-25 11:31:18 +02:00
Emilio Cobos Álvarez 8805f43898 Bug 1473813: Don't make pseudo-elements replaced by content: url(..). r=bz
Differential Revision: https://phabricator.services.mozilla.com/D1996
2018-07-16 18:06:39 +02: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 7d861904c9 Bug 1473813: Don't make pseudo-elements replaced by content: url(..). r=bz
Differential Revision: https://phabricator.services.mozilla.com/D1996
2018-07-16 17:30:15 +02: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
Emilio Cobos Álvarez 141a5774ca Bug 1473651: Track animated image status for generated content and content: url(). r=tnikkel
I thought of just moving the tracking to nsImageFrame instead of
nsImageLoadingContent entirely, though that would mean I need to handle it also
in nsImageBoxFrame and nsSVGImageFrame, which was even more duplicated code.

Ideas for testing this welcome, though all our animated image test-cases are
borked (all reftests in image/test/reftest/apng are disabled, and all the ones
for gifs that have animations as well).

I'll cross-ref this bug and bug 1473651 so that we can write a test for this
once that's fixed.

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

--HG--
extra : moz-landing-system : lando
2018-07-06 10:22:09 +00:00
Emilio Cobos Álvarez c4900d4847 Bug 215083: Fix CreateContinuingFrame to account for non-nsImageLoadingContent image frames. r=heycam
MozReview-Commit-ID: CLx3siPe4Cx
2018-06-30 03:45:12 +02:00
Emilio Cobos Álvarez 6d73d28803 Bug 215083: Implement content: url(..) for elements. r=tnikkel,dholbert
Dynamic changes are handled correctly because content property changes already
cause a reframe.

This implements the same bits as Blink / WebKit do (single content item which is
an image, otherwise gets ignored), except for the edge cases where you use this
on an image.

In order to handle the edge cases right, we completely isolate the
nsImageLoadingContent usage based on `mKind`.

Blink's and WebKit's behavior there makes no sense and it's erratic, what I
implemented is consistent (we apply to images as long as they don't generate a
box, and we don't look at alt text or broken icons), though I'll update to
whatever the WG decides in https://github.com/w3c/csswg-drafts/issues/2831 /
https://github.com/w3c/csswg-drafts/issues/2832.

I don't think it matters in terms of web compat in any case.

MozReview-Commit-ID: JUurhC60hWr
2018-06-30 03:45:13 +02:00
Emilio Cobos Álvarez ea25d05826 Bug 1464363: Remove IMAGE_GOTINITIALREFLOW. r=dholbert
The methods where it's used don't run from reflow (they're image notifications
that run off runnables and such), so should be an idempotent change.

MozReview-Commit-ID: LdmSOcKDdw1

--HG--
extra : rebase_source : 273ed355a9bfb8aefdf92a85802a47ac39373d19
2018-05-25 12:23:06 +02:00
Emilio Cobos Álvarez 9520790e72 Bug 1462272: Remove an unneeded and ugly reinterpret_cast. r=dholbert
MozReview-Commit-ID: Evip43nwNii
2018-05-25 12:09:49 +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
Emilio Cobos Álvarez f09824aad6 Bug 1149357: Properly update responsive images for density changes. r=dholbert
Before that we were not notifying the image frame in any way if we ended up not
doing a load, and we were instead relying on the reflow the viewport resize
caused to get the new density in ComputeSize from the content node (but nowhere
else, since that's the bug part 1 fixes).

This was generally unsound, since you can stash random media in a sizes=
attribute, which don't necessarily needs to cause a reflow.

Now we need to notify necessarily because nsImageFrame stores the adjusted
intrinsic size.

mCurrentDensity could also get out of sync as well, when the selected image
density changed, but we ended up returning early because our source hadn't
change in the first early exit.

This patch moves us to a model where we don't re-trigger loads for density
changes if the source doesn't change (unless we pass aAlwaysLoad when we need
to, per spec).

This matches our previous behavior (without the bugginess of not updating the
intrinsic size), and also Chromium, at least.

This changes behavior in one case, which is when we don't load the same source
node, but we have the same source URL, and the density does change. This could
happen with <picture> and two <source>s with same source and different media and
sizes. This makes our behavior consistent with the behavior we have when both
the source and the density doesn't change.

Blink and WebKit do trigger a second image load both when the source changes
without changing density and when density changes. I'll file a spec issue, since
per:

  https://html.spec.whatwg.org/#reacting-to-environment-changes

We should be triggering the load when the density changes but the source
doesn't as well, but no UA does that.

I filed https://github.com/whatwg/html/issues/3709 with a little summary of the
situation and what I think the behavior should be (which is what this patch
implements). That being said, I'll update the impl if the spec people think
otherwise :).

MozReview-Commit-ID: Eqy16ygHRLo
2018-05-25 12:09:30 +02:00
Emilio Cobos Álvarez e341b20ec4 Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE
MozReview-Commit-ID: JPopq0LudD
2018-03-22 20:06:24 +01:00
Emilio Cobos Álvarez 5dd797f154 Back out changeset b683bb3f22a1 (Bug 1447483) for not landing with all the files. r=me on a CLOSED TREE
This reverts commit 1808914126bb9f9e4a82d2c3d7ac961885fe7d62.

MozReview-Commit-ID: 5skESBseEvo
2018-03-22 20:05:22 +01:00
Emilio Cobos Álvarez ca5ac79cca Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt
MozReview-Commit-ID: JPopq0LudD
2018-03-22 19:48:42 +01:00
Matt Woodrow c112686a2e Bug 1432348 - Make we sure call the right version of UpdateDrawResult for the display item geometry used. r=tnikkel
--HG--
extra : rebase_source : d5e1961a965374204116f5343c6922cb2593b12b
2018-01-29 17:16:51 -05:00
Daniel Holbert a6a50738be Bug 1430312: Use StaticRefPtr instead of raw pointer for nsImageFrame::gIconLoad. r=tnikkel
MozReview-Commit-ID: HvkQEaZS1OG

--HG--
extra : rebase_source : 2a0da7c49741224c9c4fb8bcb9da3e17d957b253
2018-01-12 16:49:48 -08:00
Samathy Barratt d8ba79a56b Bug 1351447 - Rename imagelib's DrawResult to ImgDrawResult r+tnikkel r=tnikkel
Renamed to imgDrawResult

MozReview-Commit-ID: 5ESSgIhhU41

--HG--
rename : image/DrawResult.h => image/ImgDrawResult.h
extra : rebase_source : dbf645574aff7eefe65fa81809d6c07cb5800ec6
2017-12-11 15:37:59 +00:00
Ciure Andrei b8d4330b53 Backed out changeset 8e33d0ce108c (bug 1351447) for failing /builds/worker/workspace/build/src/widget/cocoa/nsCocoaUtils on OS X r=backout a=backout on a CLOSED TREE
--HG--
rename : image/ImgDrawResult.h => image/DrawResult.h
2017-12-12 09:49:59 +02:00
Samathy Barratt 0749baf2d8 Bug 1351447 - Rename imagelib's DrawResult to ImgDrawResult r=tnikkel
Renamed to imgDrawResult

MozReview-Commit-ID: 5ESSgIhhU41

--HG--
rename : image/DrawResult.h => image/ImgDrawResult.h
extra : rebase_source : 4fba109b84ef456126d50e0d5e525f29f944a46d
2017-12-11 15:37:59 +00:00
Mats Palmgren 25cd0c37f7 Bug 1400618 part 1 - Collect NAC / generated content and call DestroyAnonymousContent / UnbindFromTree on those after the frames are destroyed. r=bz
MozReview-Commit-ID: 2trDgeJPw25
2017-11-07 01:20:33 +01:00
Daniel Holbert 680815cd6e Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py

For every file that is modified in this patch, the changes are as follows:
 (1) The patch changes the file to use the exact C++ mode lines from the
     Mozilla coding style guide, available here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

 (2) The patch deletes any blank lines between the mode line & the MPL
     boilerplate comment.

 (3) If the file previously had the mode lines and MPL boilerplate in a
     single contiguous C++ comment, then the patch splits them into
     separate C++ comments, to match the boilerplate in the coding style.

MozReview-Commit-ID: EuRsDue63tK

--HG--
extra : rebase_source : 3356d4b80ff6213935192e87cdbc9103fec6084c
2017-10-27 10:33:53 -07:00
Nicholas Nethercote d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Nicolas Silva 61546da339 Bug 1393031 - Remove unused nsTArray<WebRenderParentCommand>& parameter all over the place. r=jrmuizel 2017-09-20 13:36:53 +02:00
Sebastian Hengst d27b05e04e Backed out changeset f34a52244cf9 (bug 1393031) 2017-09-14 23:17:35 +02:00
Nicolas Silva 2d3eb6cef7 Bug 1393031 - Remove unused nsTArray<WebRenderParentCommand>& parameter all over the place. r=jrmuizel 2017-09-14 20:21:54 +02:00
Nicolas Silva 59e80c8f7e Bug 1393031 - Use shared memory to pass resource update data. r=jrmuizel 2017-09-14 18:48:55 +02:00
Miko Mynttinen 351756e478 Bug 1359584 - Part 3: Improve nsDisplayItem const correctness and fix surrounding whitespace r=mstange
MozReview-Commit-ID: 3GkWiu6C4Zo

--HG--
extra : rebase_source : 1423442cd723b8a052d183394dc5f5ef272a5272
2017-08-24 17:09:44 +02:00
Matt Woodrow 40f5b92e3b Bug 1388161 - Store the dirty rect on the display list builder rather than passing it as a parameter to BuildDisplayList. r=mstange 2017-08-07 14:23:35 +12:00
Sebastian Hengst 8257b2d113 Backed out changeset 8f2dd8f13b53 (bug 1388161) for failing chrome's test_animation_performance_warning.html | preserve-3d transform. r=backout 2017-08-10 14:40:21 +02:00
Matt Woodrow a3a130b6ff Bug 1388161 - Store the dirty rect on the display list builder rather than passing it as a parameter to BuildDisplayList. r=mstange 2017-08-07 14:23:35 +12:00
Sylvestre Ledru 4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Morris Tseng eb94eb3e03 Bug 1376855 - Support nsDisplayImage in layers free mode. r=kats
MozReview-Commit-ID: 5oCmmBXwfv2

--HG--
extra : rebase_source : a51aca897df386a5d3c1e5c9426609913162a99f
2017-06-28 15:12:36 -07:00