Closed Bug 1570759 Opened 4 years ago Closed 4 years ago

Consider enabling the optimization to not flush when getting fixed margins from getComputedStyle().

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(2 files)

Attached file Testcase

This would align (dubiously) our behavior with other engines, but it's not 100% clear whether that's right, see https://github.com/w3c/csswg-drafts/issues/2328.

See the following test-case for a bit of surprising behavior. If you have fixed margins, we return the "wrong" used margin, but as soon as you have a percentage margin, presumably we store the UsedMarginProperty on the frame, and return the "proper" margin.

Our behavior is inconsistent, so it's unclear what to do here...

The priority flag is not set for this bug.
:jwatt, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jwatt)
Flags: needinfo?(jwatt) → needinfo?(emil.ghitta)
Flags: needinfo?(emil.ghitta) → needinfo?(emilio)

Yeah, I guess we should do this.

Assignee: nobody → emilio
Flags: needinfo?(emilio)
Priority: -- → P3

As noted this changes behavior, but it's unclear per
https://github.com/w3c/csswg-drafts/issues/2328 what behavior is correct, and
our behavior is inconsistent depending on whether there's any percentage
involved.

This matches other browsers so it's pretty low risk I'd say.

The test starts passing without changes to the test, but given the CSSWG issue I
made the test not rely on the optimization.

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7fa833ff0b1c
Enable the optimization to not flush for fixed margin values. r=jwatt
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/18771 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/c1311fe97e4d
followup: Actually use the style value if we determine we don't need the layout one. r=bustage
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/ce4121497815
Don't expect assertions since they all came from margin computation.
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.