[Gecko Bug 1340715] Change SVG max-content size for webcompat. #35755
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goal of this patch is to change the SVG max-content size to match blink and
webkit to fix the webcompat issues in bug 1521882 and bug 1651754.
If a percentage width/height attribute on inline axis is explicitly set, we fall
back to the default replaced element size to avoid regressing bug 1162418.
Otherwise, we use 0 as SVG's max-content size in order to be compatible with
blink and webkit.
When computing replaced elements's max-content inline-size, its preferred
aspect-ratio and block-size can transfer to inline axis. The logic is the same
as if the element has an 'auto' inline-size. Hence the modification in
ComputeSizeWithIntrinsicDimensions().
This patch also removes the SVG's intrinsic size dependency on an arbitrary
container from the previous layout result in
SVGOuterSVGFrame::GetPrefISize()
.bug 1340715 comment 1 explains why the code is unsound.
Differential Revision: https://phabricator.services.mozilla.com/D155998
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1340715
gecko-commit: 76c1fb5130dcd9f4562826d42194ebf74ca268c8
gecko-reviewers: emilio