[webkit-dev] Confusion over over-constrained case in RenderBox::computePositionedLogicalWidthUsing
fsamuel at chromium.org
Sun Nov 20 21:28:36 PST 2011
I'm currently studying layout code in RenderBox very carefully as I work on
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) +
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?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev