[webkit-dev] Confusion over over-constrained case in RenderBox::computePositionedLogicalWidthUsing

Fady Samuel fsamuel at chromium.org
Sun Nov 20 21:28:36 PST 2011


Hi all,

I'm currently studying layout code in RenderBox very carefully as I work on
this:
https://bugs.webkit.org/show_bug.cgi?id=47738

I'm a bit confused about something fairly subtle. In the overconstrained
case where logical left, logical width, and logical right are all
specified, we should ignore right (in ltr and left in rtl), correct?

First a clarification please: is the logical left actually the right side
of the box in rtl mode?
Secondly, I'm confused about the availableSpace calculation (at line 2706
in my local branch):

const LayoutUnit availableSpace = containerLogicalWidth - (logicalLeftValue
> + logicalWidthValue + logicalRight.calcValue(containerLogicalWidth) +
> bordersPlusPadding);


Why is logicalRight.calcValue(containerLogicalWidth) in that computation at
all? It seems to me that the available space for left/right margin (in ltr)
is where the box is positioned relative to the left edge of the container
box plus its content width + bordersPlusPadding. I can't figure out how
logicalRight plays a role here. Could someone please clarify?
In fact, a couple of lines above I see the following comment:

// NOTE: It is not necessary to solve for 'right' in the over constrained
> // case because the value is not used for any further calculations.


This seems to contradict the availableSpace line. Is this a stale comment
or is this a bug, or am I just misunderstanding something?

Thanks,
Fady
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20111121/5d2e8df2/attachment.html>


More information about the webkit-dev mailing list