Closed Bug 1352002 Opened 3 years ago Closed 2 years ago

Investigate if other browsers have the frame margin size quirk

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: manishearth, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

In quirks mode, if the parent frame of a <body> element (which itself has no margin-affecting attributes) has marginwidth but not marginheight, we force marginheight to be zero. (and vice versa)

This isn't specced anywhere -- we should investigate what other browsers do and update the spec or remove this behavior.
Testcase:

  <!DOCTYPE html>
  <iframe marginwidth=100 src="data:text/html,test"></iframe>
  <iframe marginwidth=100 marginheight=0 src="data:text/html,test"></iframe>
  <hr>
  <iframe marginwidth=100 src="data:text/html,<!DOCTYPE html>test"></iframe>
  <iframe marginwidth=100 marginheight=0 src="data:text/html,<!DOCTYPE html>test"></iframe>
  <hr>
  <iframe marginheight=100 src="data:text/html,test"></iframe>
  <iframe marginheight=100 marginwidth=0 src="data:text/html,test"></iframe>
  <hr>
  <iframe marginheight=100 src="data:text/html,<!DOCTYPE html>test"></iframe>
  <iframe marginheight=100 marginwidth=0 src="data:text/html,<!DOCTYPE html>test"></iframe>

Looks at first glance like Safari and Chrome don't have the quirk: they have our standards mode behavior in both modes.  Edge, on the other hand, has our quirks mode behavior in both modes as far as I can tell.

I filed https://github.com/whatwg/html/issues/2486 on the spec, but I suspect what we should do is leave the spec as-is and just remove our quirk.  David, opinions?
Flags: needinfo?(dbaron)
(In reply to Boris Zbarsky [:bz] (still a bit busy) (if a patch has no decent message, automatic r-) from comment #1)
> Looks at first glance like Safari and Chrome don't have the quirk: they have
> our standards mode behavior in both modes.  Edge, on the other hand, has our
> quirks mode behavior in both modes as far as I can tell.

That sounds like a good basis for removing the quirk.
Flags: needinfo?(dbaron)
(but try to do it in a release that's not 57)
This can wait until 58, sure.
Flags: needinfo?(bzbarsky)
None of the spec, Chrome, or Safari have this quirk.  Edge has our quirks behavior in both modes.

MozReview-Commit-ID: ADyGxeIm3B4
Attachment #8922419 - Flags: review?(dholbert)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Flags: needinfo?(bzbarsky)
Comment on attachment 8922419 [details] [diff] [review]
Remove the iframe margin size quirk

Review of attachment 8922419 [details] [diff] [review]:
-----------------------------------------------------------------

r=me

Thanks for the comprehensive tests!
Attachment #8922419 - Flags: review?(dholbert) → review+
Oh, they aren't comprehensive.  I got tired of writing them before I added tests for another 3-4 things that might be worth testing here...  :(
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/02106e29e4b6
Remove the iframe margin size quirk.  r=dholbert
https://hg.mozilla.org/mozilla-central/rev/02106e29e4b6
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.