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

10 Коммитов

Автор SHA1 Сообщение Дата
Boris Chiou 181e91cf22 Bug 1690422 - Take box-sizing into account when computing the intrinsic size with the preferred aspect ratio. r=TYLin,mats
We resolve the auto value in IntrinsicForAxis by the ratio determining size
and the preferred aspect ratio. However, this should take
box-sizing into account when using aspect-ratio property.

Differential Revision: https://phabricator.services.mozilla.com/D104293
2021-02-17 02:41:24 +00:00
Boris Chiou 361f923f82 Bug 1683424 - Add UseBoxSizing for AspectRatio class, and fix non-replaced element usage. r=TYLin
Based on the spec, if the aspect-ratio property value is:
1) auto: we should always use content-box dimensions.
2) <ratio>: the aspect-ratio works with box sizing dimensions.
3) auto && <ratio>: we use content-box dimensions in all cases.

So we need an extra flag to address that we should use box-sizing or
always use content-box dimensions while computing the size in
ratio-dependent axis.

This also updates some wpts for non-replaced elements because we should
use content-box if aspect-ratio is 'auto && <ratio>'.

Differential Revision: https://phabricator.services.mozilla.com/D100072
2020-12-23 22:42:55 +00:00
Boris Chiou d494534798 Bug 1651776 - Move Compute{Inline|Block}SizeFromAspectRatio() into AspectRatio struct. r=TYLin
We add a new file, AspectRatio.cpp, to definte the method,
ComputeRatioDependentSize. So we don't have to move this function to
WritingModes.h

Besides, we miss the forward declaration of IPC::ParamTraits, so add it
into AspectRatio.h.

Differential Revision: https://phabricator.services.mozilla.com/D95822
2020-11-20 22:38:36 +00:00
Ting-Yu Lin 2f869ac046 Bug 1674863 Part 1 - Improve type safety for APIs computing video's intrinsic size and ratio. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D95577
2020-11-03 19:54:41 +00:00
Cameron McCormack a9b6211496 Bug 1658343 - Propagate intrinsic sizes from SVG documents in embed/object to parent using IPC. r=kmag,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D90055
2020-09-21 02:09:57 +00:00
Boris Chiou b425a6022b Bug 1639963 - Calculate inline size and block size based on aspect-ratio. r=emilio
We calculate the size of ratio-dependent axis by aspect-ratio while
initializing its ReflowInput, for most of the basic block cases.

This patch doesn't include "Automatic content-based minimum sizes",
which will be handled later. Besides, replaced elements will be handled
later as well.

We don't pass abspos-004.tentative.html because there is still a
spec issue: https://github.com/w3c/csswg-drafts/issues/5151.
For other tests we didn't pass (e.g. block-aspect-ratio-009.tentative.html,
or replaced-element-00x.tentative.html), we fix them later.

Besides, in this patch, we don't handle the case if the size of
ratio-determining axis uses intrinsic size keywords (which needs to be
calculated by its content size). We will fix this in the following bug
(Bug 1646100).

Differential Revision: https://phabricator.services.mozilla.com/D78964
2020-08-17 06:26:19 +00:00
Emilio Cobos Álvarez d3f45f6b31 Bug 1633434 - Ensure inverting a valid aspect ratio generates a valid aspect ratio. r=dholbert
It seems like a reasonable expectation, but it may not hold with massive
ratios. Make it hold by returning the floating point epsilon in that
case.

Differential Revision: https://phabricator.services.mozilla.com/D73029
2020-04-30 14:04:24 +00:00
Chris Peterson 4a9feda3ee Bug 1625855 - Replace MOZ_MUST_USE with [[nodiscard]] in layout. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D68751

--HG--
extra : moz-landing-system : lando
2020-04-08 01:59:36 +00:00
Emilio Cobos Álvarez ef914bd2f8 Bug 1559094 - Restore old behavior for background-size: cover + zero-sized background positioning area. r=dholbert
This restores our previous and per-spec behavior. Comparing only ratios was not
correct in the case one of the dimensions was zero and thus not scaled.

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

--HG--
extra : moz-landing-system : lando
2019-06-23 10:08:16 +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