Closed Bug 1437625 Opened 2 years ago Closed 2 years ago

nsCSSRenderingBorders.cpp calls two static functions from nsCSSRendering.cpp (and depends on fragile unified build grouping to call them)

Categories

(Core :: Web Painting, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 file)

nsCSSRenderingBorders.cpp has calls to two functions that are actually static functions from nsCSSRendering.cpp.

Specifically, it calls IsBoxDecorationSlice and BoxDecorationRectForBorder:
>  if (::IsBoxDecorationSlice(aStyleBorder) && !aSkipSides.IsEmpty()) {
>    mArea = ::BoxDecorationRectForBorder(aForFrame, aBorderArea,
>                                         aSkipSides, &aStyleBorder);
https://dxr.mozilla.org/mozilla-central/rev/9a0655ea8ae02f4d96bf23a607a94641f1c57f1b/layout/painting/nsCSSRenderingBorders.cpp#3839-3840

...which are defined as static (.cpp-file-local) functions here:
https://dxr.mozilla.org/mozilla-central/rev/9a0655ea8ae02f4d96bf23a607a94641f1c57f1b/layout/painting/nsCSSRendering.cpp#567-586

This only compiles by virtue of the fact that these two .cpp files happen to get unified together into one .cpp file, by virtue of unified builds + luck on the exact grouping.

To avoid this fragile dependency, we should probably make these calls legitimate by making IsBoxDecorationSlice() and BoxDecorationRectForBorder() into public APIs that are legitimately callable from other .cpp files.
Comment on attachment 8950333 [details]
Bug 1437625: Promote a few nsCSSRendering.cpp static functions into exposed static methods, since another .cpp file is already using them.

https://reviewboard.mozilla.org/r/219570/#review225386
Attachment #8950333 - Flags: review?(matt.woodrow) → review+
Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4ef11ae5666a
Promote a few nsCSSRendering.cpp static functions into exposed static methods, since another .cpp file is already using them. r=mattwoodrow
https://hg.mozilla.org/mozilla-central/rev/4ef11ae5666a
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.