Bug 128262

Summary: Update aspect-ratio property to have constraining keywords
Product: WebKit Reporter: Dean Jackson <dino>
Component: CSSAssignee: Dean Jackson <dino>
Status: RESOLVED FIXED    
Severity: Normal CC: allan.jensen, commit-queue, eoconnor, esprehn+autocc, glenn, gyuyoung.kim, kondapallykalyan, macpherson, menard, syoichi, webkit-bug-importer
Priority: P2 Keywords: InRadar, WebExposed
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch simon.fraser: review+

Description Dean Jackson 2014-02-05 11:04:11 PST
Add a new prefixed property which will suggest to the layout engine whether they should respect the intrinsic size of an image, or the specified size, when sizing its object box. The default is "auto" which is the current behaviour.
Comment 1 Radar WebKit Bug Importer 2014-02-05 11:04:48 PST
<rdar://problem/15991746>
Comment 2 Dean Jackson 2014-02-05 11:24:12 PST
"Spec" and discussion at http://www.w3.org/mid/m2r47n3h9i.fsf@eoconnor.apple.com
Comment 3 Dean Jackson 2014-02-05 11:33:26 PST
Created attachment 223251 [details]
Patch
Comment 4 Brent Fulgham 2014-02-05 16:11:49 PST
Comment on attachment 223251 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=223251&action=review

This looks good to me, but I noticed a textual difference between ObjectSizingPreserveSpecified and CSSValuePreferSpecified. Are these equivalent?

> Source/WebCore/rendering/style/RenderStyleConstants.h:218
> +    ObjectSizingAuto, ObjectSizingPreserveIntrinsic, ObjectSizingPreserveSpecified

Does CSSValuePreferSpecified === ObjectSizingPreserveSpecified?
Comment 5 Dean Jackson 2014-02-05 16:54:03 PST
Comment on attachment 223251 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=223251&action=review

>> Source/WebCore/rendering/style/RenderStyleConstants.h:218
>> +    ObjectSizingAuto, ObjectSizingPreserveIntrinsic, ObjectSizingPreserveSpecified
> 
> Does CSSValuePreferSpecified === ObjectSizingPreserveSpecified?

Oh, I totally screwed up here. I actually made this same mistake a number of times while developing - typing "Preserve" when I meant "Prefer"
Comment 6 Theresa O'Connor 2014-02-06 11:07:27 PST
Maybe that's an indication that "preserve" is a better name.
Comment 7 Dean Jackson 2014-02-07 10:06:29 PST
(In reply to comment #6)
> Maybe that's an indication that "preserve" is a better name.

If we change the property name to "aspect-ratio" then I guess "preserve" makes more sense. I really don't mind either way.
Comment 8 Dean Jackson 2014-02-07 10:06:53 PST
BTW - we're holding off on review until we have more of the implementation done.
Comment 9 Theresa O'Connor 2014-02-07 14:29:30 PST
Per discussion on www-style I think "aspect-ratio" will be the name.
Comment 10 Dean Jackson 2014-02-09 17:18:53 PST
Yes, updating title. We already have partial support for aspect-ratio, but it needs to understand keywords rather than just numbers.
Comment 11 Dean Jackson 2014-02-09 18:27:30 PST
Created attachment 223661 [details]
Patch
Comment 12 Dean Jackson 2014-02-10 17:17:16 PST
Committed r163840: <http://trac.webkit.org/changeset/163840>