mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-09-29 17:54:09 +03:00
Fix CSS auto margins for inline HTML images
Resolve auto margins according to the element's formatting context instead of applying native block centering to every HTML child. Inline-level replaced elements, inline-blocks, floats, and out-of-flow boxes now use zero-valued auto margins in rich-text measurement and positioning, while normal-flow blocks retain horizontal auto-margin resolution. This prevents asynchronously loaded images from feeding stale calculated margins back into their inline ancestors and producing unbounded document widths, as observed on the Asahi Linux site. Add synchronous and threaded WebView regression coverage using the Asahi fixture, including its weighted host layout and asynchronous SVG loading. Document the follow-up plan for explicit formatting-role margin resolution, shared image-content composition, and rebasing UIHTMLImage on UIHTMLWidget.
This commit is contained in:
@@ -100,6 +100,11 @@ class EE_API UIHTMLWidget : public UILayout {
|
||||
|
||||
Rectf getNormalFlowLayoutPixelsMargin() const;
|
||||
|
||||
/** Returns the used CSS margin for a child participating in a block formatting context.
|
||||
* Horizontal auto margins are resolved only for normal-flow block-level boxes. For
|
||||
* inline-level, floated, and out-of-flow boxes every auto margin has a used value of zero. */
|
||||
static Rectf getFormattingContextLayoutPixelsMargin( UIWidget* widget );
|
||||
|
||||
const CSSBaselineAlignValue& getBaselineAlign() const { return mBaselineAlign; }
|
||||
|
||||
void setBaselineAlign( const CSSBaselineAlignValue& baselineAlign );
|
||||
|
||||
Reference in New Issue
Block a user