<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>70769</bug_id>
          
          <creation_ts>2011-10-24 15:41:14 -0700</creation_ts>
          <short_desc>display:inline-block elements don&apos;t correctly handle orthogonal writing-modes</short_desc>
          <delta_ts>2023-10-31 18:17:03 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>70829</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Ojan Vafai">ojan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>hyatt</cc>
    
    <cc>mihnea</cc>
    
    <cc>tony</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>489710</commentid>
    <comment_count>0</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-10-24 15:41:14 -0700</bug_when>
    <thetext>The fix in http://trac.webkit.org/changeset/97653 only works if the child doesn&apos;t have any children. Whoops! Specifically, computeLogicalHeight assumes the child has been laid out already.

I&apos;m not 100% sure what the right fix is. If we call child-&gt;layoutIfNeeded() before we call computeLogicalHeight(), everything works, but I don&apos;t know if calling layout earlier will cause other problems. Dave, what do you think?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>490240</commentid>
    <comment_count>1</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-10-25 12:31:49 -0700</bug_when>
    <thetext>TL;DR version: This bug is really unlikely to occur in the real world given that it requires orthogonal writing modes and auto-sizing inline-blocks. The current code works non-auto cases, which is good enough.

Condensed #webkit discussion:
dhyatt: min/max width stuff is just a heuristic basically
dhyatt: it can&apos;t do layouts
dhyatt: so it gets lots of things wrong
dhyatt: you just have to accept that it does 
tony^work: why can&apos;t you do layouts?
dhyatt: because you can be in layout when you ask the question
ojan: but you&apos;re laying out the child
ojan: you can&apos;t be in the child&apos;s layout, right?
ojan: oh...hm...i guess you could
dhyatt: it&apos;s also just specifically part of the design that it&apos;s a separate algorithm
ojan: so, vertical writing mode + inline-block is just forever broken?
dhyatt: with auto sizing (which you&apos;d never do when mixing writing modes anyway)
ojan: or alternately, vertical flexboxes in an inline-block
dhyatt: with non-auto sizing should work fine
ojan: i&apos;d imagine for the things you&apos;d use inline-block for, auto-sizing is not that uncommon
dhyatt: css is actually (i&apos;m hazy on this would have to check or consult dbaron) wanting the computation of preferred width to not involve layout
dhyatt: like it&apos;s supposed to be a simplified algorithm
dhyatt: since the preferred widths get used by layout algorithms
ojan: i agree that&apos;s a better design
dhyatt: but yeah the downside is that you can&apos;t handle many cases
dhyatt: your bug is nothing compared to some of the ones already filed 
ojan: but it seems like a problem if the spec has this bug
dhyatt: for nice normal horizontal-tb cases
dhyatt: well i don&apos;t know if it&apos;s made it into any spec
dhyatt: technically the way to get this kind of stuff right is to do a layout at an unconstrained size
dhyatt: rather than having a separate algorithm
dhyatt: but then you get into tough situations with cycles and stuff
ojan: do a layout of the child at an unconstrained size you mean?
dhyatt: and of course layout is way way way more expensive
dhyatt: than our current preferred width computations
dhyatt: well, layout of whoever&apos;s preferred width you need
dhyatt: typically a child
dhyatt: anyway, not saying the bug is invalid
dhyatt: just saying i&apos;d let it go for now and keep it filed
ojan: yeah...i know...
dhyatt: since we can&apos;t put a layout in that code
dhyatt: as long as non-auto works
dhyatt: i think having inline-block perpendicular flows is a pretty nonsensical thing to do
dhyatt: so i&apos;m not worried much about this edge case
dhyatt: i can&apos;t imagine anybody ever doing that
dhyatt: since it doesn&apos;t make any sense really
dhyatt: like you don&apos;t see anything like that in japanese books
dhyatt: you&apos;ll see orientation shifts at the block level
dhyatt: but not at the piece-of-a-line level like inline-block
dhyatt: height = borderAndPaddingHeight is basically setting it to 0 content height
dhyatt: which i think is ok
dhyatt: basically i think what&apos;s checked in is fine for now
dhyatt: i know it&apos;s annoying to feel like a case is being left broken on purpose
dhyatt: but i&apos;ve had to do that in many many places with perpendicular flows
dhyatt: often i just ask myself, &quot;is a book/web site really going to do this?&quot;
dhyatt: and usually the answer is no
dhyatt: remember that height in preferred width scenarios actually *is* supposed to resolve to 0 in many cases
dhyatt: auto is
dhyatt: e.g., percentage widths go to 0 for example</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1989048</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-10-31 18:17:03 -0700</bug_when>
    <thetext>Following bug is referred in this blink commit and with following test case (changed into JSFiddle): https://jsfiddle.net/g15nmcf3/show

Blink Commit: https://chromium.googlesource.com/chromium/blink/+/deee83808ed40a6c500c9e1b616b95477c7b2325

Blink Commit title: Fix shrink-to-fit when children&apos;s writing-mode is orthogonal

&quot;css3/flexbox/flex-flow-margins-auto-size.html that currently expects to
fail passes with this patch: http://wkb.ug/70769&quot;

^ mentioned in the commit message.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>