Age | Commit message (Collapse) | Author |
|
See: https://lists.mailman3.com/hyperkitty/list/dillo-dev@mailman3.com/thread/L3FFAINJJMIOZQNID5HC2DHKJIIIHEYH/
|
|
The requisition box includes the margin, padding and border. To compute
the aspect ratio of the image we need to remove them to get the content
box. Once the adjustment is done, we add the borders again.
|
|
When CSS min-{width,height} > max-{width,height} set the
max-{width,heigh} to the maximum value min-{width,height}.
|
|
Images should preserve their own aspect ratio, which is determined by
the image buffer size, also known as the intrinsic size. Currently, when
a child requests a requisition to be corrected by correctRequisition(),
only the size was adjusted, ignoring the aspect ratio.
The new Widget ratio variable holds the desired aspect ratio for the
widget, and will only be taken into account when non-zero. In that case,
then correcting the requisition, a naive algorithm tries to first
increase the length of the small size to fill the preferred aspect
ratio. In the case that it is not enough, the larger size is then
decreased to fit the aspect ratio. And if that doesn't work either, the
aspect ratio is not enforced and the widget will be distorted.
There are special cases for correctRequisition() depending if the parent
exists or not. The same approach is taken for both cases, but using the
viewport size instead of the parent size.
|
|
For cases where the available height is being computed and the CSS
style has the height to auto, there available height is infinite. Don't
return the viewport unless forceValue is set.
|
|
When a widget calls the parent to correct its own requisition, let the
child widget perform adjustments on the requisition. This allows images
to control the height when the parent changes the width, so the image
can preserve its own aspect ratio.
|
|
|
|
When correcting a requisition, percent values were not being computed
which prevents the min-height or max-height values to be taken into
account.
|
|
When the initial width is -1, the contrainsts of min-width and max-width
are not applied. If we set the viewport width after calcFinalWidth() it
may exceed max-width. It is guaranteed to return a value different from
-1 when the initial width is positive.
|
|
Prevents reducing the available width of a body with width:auto and
min-width:100px to 100px.
The Widget::calcFinalWidth() method is also heavily documented, so we
can understand precisely what it does.
|
|
The currentColor special value for the fill and stroke attributes allows
an image to follow the same foreground color of the surounding text.
|
|
For cases where the parent widget has the width set to auto we need to
go to the above parent to compute the available width. This is required
to make tables with a width of 100% occupy the whole available width of
the parent.
In particular, fixes render/table-max-width.html test, which was relying
on a {-1,-1,-1} requisition to have a value different than -1 in the
width to consider that the CSS width is effective.
|
|
This reverts commit 24bcd67df29a5418d05600b038a9283a00e555d2.
Fixes: https://github.com/dillo-browser/dillo/issues/99
|
|
When the width is set to auto, a different branch is used to compute the
width via getAvailWidth(true). The returned witdh needs to be clamped to
be in the min/max-width CSS range if given, as otherwise it won't be
corrected.
Fixes: https://github.com/dillo-browser/dillo/issues/89
|
|
When a widget has width to auto and the initial finalWidth is -1, set it
by default to the max-width CSS value so it expands to the maximum
available size.
|
|
Then min-width or max-width is given in the CSS style for the current
widget, the returned width should be clamped by those values.
The condition *finalValue != 1 was used to clamp with min-width, but it
doesn't capture the situation when the finalValue was not yet set.
Similarly, for the max-width, the finalWidth was only set when
*finalValue == -1, which prevented the clamping when the width is set.
The change always perform the clamp when finalWidth is not set or when
the value exceeds the min or max value. When both min-width and
max-width are given but width is -1, the resulting width is the
min-witdh, as the max-width clamp rule won't trigger after setting the
*finalValue to the min-witdh.
|
|
When a widget has a parent, the calcFinalWidth() method was not being
called to compute the limits of min-width or max-width given by CSS
rules. The change makes the call to calcFinalWidth in all cases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
correction.
|
|
sequential) queueResize.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
references.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handling conflicts.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|