Bug 250946

Summary: Reduce calls to LayoutUnit(int) in RenderBox.h
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bfulgham, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Ahmad Saleem 2023-01-21 15:08:10 PST
Hi Team,

It is split off from bug 250884 because when I tried to merge RenderBox.h changes, it let to build failure since these are used in RenderSVG

Blink Commit - https://chromium.googlesource.com/chromium/blink/+/e3d125383e6023dccb9f052237751f1c9a8098ec

Missing WebKit Source Changes - https://searchfox.org/wubkat/source/Source/WebCore/rendering/RenderBox.h#382

Adding:

ComputedMarginValues() { }

and

LogicalExtentComputedValues() { }

accordingly.

the build failures are here:

https://searchfox.org/wubkat/source/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp#93

Just wanted to raise it so we can track it separately and fix and land this as well.

Thanks!
Comment 1 Radar WebKit Bug Importer 2023-01-28 15:09:28 PST
<rdar://problem/104786029>
Comment 2 Ahmad Saleem 2024-03-04 14:51:35 PST
This does not compile:

    struct ComputedMarginValues {
 +      ComputedMarginValues() { }

        LayoutUnit m_before;
        LayoutUnit m_after;
        LayoutUnit m_start;
        LayoutUnit m_end;
    };
    struct LogicalExtentComputedValues {
 +      LogicalExtentComputedValues() { }

        LayoutUnit m_extent;
        LayoutUnit m_position;
        ComputedMarginValues m_margins;
    };

___

no matching constructor for initialization of
      'RenderBox::LogicalExtentComputedValues'
  ...{ static_cast<int>(roundf(m_viewport.height())), logicalTop, ComputedMarginValues() };
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

___

Looking into 'LogicalExtentComputedValues()' - I don't see any calls, while I do see for 'ComputedMarginValues()'.

@Alan - do we need this or we can close this bug?

__

With this change, it does compile:

struct ComputedMarginValues {
+       ComputedMarginValues() { }


        LayoutUnit m_before;
        LayoutUnit m_after;
        LayoutUnit m_start;
        LayoutUnit m_end;
    };

___