Closed Bug 1631941 Opened 5 years ago Closed 5 years ago

LogicalSides should have a DEBUG-only mWritingMode for assertions

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: dbaron, Assigned: dbaron)

Details

Attachments

(3 files)

While reviewing bug 1626129 I noticed that:

  • it's not particularly clear what writing mode GetLogicalSkipSides() is in -- is it the frame's writing mode, or its parent's / containing block's?
  • nsIFrame::ContentSize(mozilla::WritingMode) appears to produce incorrect results if its aWritingMode argument is not the writing mode that GetLogicalSkipSides() is in, because it applies the skip sides to a LogicalMargin in aWritingMode. Most, but not all, of the callers appear to pass the frame's writing mode to this method.
  • LogicalSides itself doesn't carry an mWritingMode so that methods like LogicalMargin::ApplySkipSides can have CHECK_WRITING_MODE assertions to verify that the correct conversions (if needed) have been done.

Yes, this sounds like something we should have, to help catch any incorrect usage.

Priority: -- → P3
Assignee: nobody → dbaron
Status: NEW → ASSIGNED

Further evidence for bug 1631947 - this has a bug that showed up in exactly one test in our test suite:
REFTEST TEST-UNEXPECTED-FAIL | layout/base/crashtests/365909-2.xhtml | assertion count 2 is more than expected 0 assertions

Pushed by dbaron@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f4c1d7dcca50 Make nsIFrame::ContentSize and nsIFrame::SynthesizeBaselineBOffsetFromContentBox apply skip sides correctly for orthogonal writing modes. r=jfkthame https://hg.mozilla.org/integration/autoland/rev/b0b425ffb6e9 Add DEBUG-only mWritingMode to mozilla::LogicalSides. r=jfkthame https://hg.mozilla.org/integration/autoland/rev/17391a8c2a05 Add writing mode assertions for mozilla::LogicalSides. r=jfkthame

That said, I believe this patch should have made the behavior consistent with the behavior we had for almost all things -- but according to the spec that behavior is wrong, for which I filed bug 1632228.

I thought I queued this for relanding this morning, but apparently it didn't work, so I did so again just now.

Flags: needinfo?(dbaron)
Pushed by dbaron@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/91ac0b7e571b Make nsIFrame::ContentSize and nsIFrame::SynthesizeBaselineBOffsetFromContentBox apply skip sides correctly for orthogonal writing modes. r=jfkthame https://hg.mozilla.org/integration/autoland/rev/6a53d6f1ec95 Add DEBUG-only mWritingMode to mozilla::LogicalSides. r=jfkthame https://hg.mozilla.org/integration/autoland/rev/8a7e21f2b5f9 Add writing mode assertions for mozilla::LogicalSides. r=jfkthame

For the record, this was the bustage fix so that it would compile correctly on non-DEBUG builds.

Pushed by dbaron@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6120b8d2df59 Make nsIFrame::ContentSize and nsIFrame::SynthesizeBaselineBOffsetFromContentBox apply skip sides correctly for orthogonal writing modes. r=jfkthame https://hg.mozilla.org/integration/autoland/rev/ff5ce5fd70ee Add DEBUG-only mWritingMode to mozilla::LogicalSides. r=jfkthame https://hg.mozilla.org/integration/autoland/rev/03e0159cd77f Add writing mode assertions for mozilla::LogicalSides. r=jfkthame
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
Regressions: 1632481
No longer regressions: 1632481
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: