Support aspect-ratio on positioned elements
Created attachment 415872 [details] Patch
Created attachment 415893 [details] Patch
Created attachment 415994 [details] Patch
Created attachment 416024 [details] Patch
Created attachment 416038 [details] Patch
<rdar://problem/72425425>
Comment on attachment 416038 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=416038&action=review > Source/WebCore/rendering/RenderBox.cpp:5011 > + if (style().width().isAuto() && style().height().isAuto() && !style().top().isAuto() && !style().bottom().isAuto() && (style().left().isAuto() || style().right().isAuto())) Maybe all these could become a helper on RenderStyle. > Source/WebCore/rendering/RenderBox.cpp:5024 > + LayoutUnit containerWidthIninlineDirection = std::max<LayoutUnit>(0, containingBlockLogicalWidthForContentInFragment(fragment)); containerWidthInIInlineDirection
Created attachment 416678 [details] Patch
Committed r271061: <https://trac.webkit.org/changeset/271061> All reviewed patches have been landed. Closing bug and clearing flags on attachment 416678 [details].
Comment on attachment 416678 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=416678&action=review > Source/WebCore/rendering/RenderBox.cpp:5013 > +bool RenderBox::shouldComputeLogicalWidthFromAspectRatio() const What does inset mean in this context and how would a caller know if shouldComputeLogicalHeightFromAspectRatio() or shouldComputeLogicalWidthFromAspectRatioAndInsets() is the right function to call.
Comment on attachment 416678 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=416678&action=review >> Source/WebCore/rendering/RenderBox.cpp:5013 >> +bool RenderBox::shouldComputeLogicalWidthFromAspectRatio() const > > What does inset mean in this context and how would a caller know if shouldComputeLogicalHeightFromAspectRatio() or shouldComputeLogicalWidthFromAspectRatioAndInsets() is the right function to call. Inset as defined here https://drafts.csswg.org/css-logical/#inset-properties. shouldComputeLogicalWidthFromAspectRatioAndInsets is more an implementation detail of shouldComputeLogicalWidthFromAspectRatio/shouldComputeLogicalHeightFromAspectRatio, so maybe it would have been better to keep it private.
(In reply to Rob Buis from comment #11) > Comment on attachment 416678 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=416678&action=review > > >> Source/WebCore/rendering/RenderBox.cpp:5013 > >> +bool RenderBox::shouldComputeLogicalWidthFromAspectRatio() const > > > > What does inset mean in this context and how would a caller know if shouldComputeLogicalHeightFromAspectRatio() or shouldComputeLogicalWidthFromAspectRatioAndInsets() is the right function to call. > > Inset as defined here https://drafts.csswg.org/css-logical/#inset-properties. Awesome! Thanks, apparently I am super behind on css-logical. :(