Closed Bug 1562257 Opened 5 years ago Closed 5 years ago

Fix our broken uses of ParseIntWithBounds(value, 0)

Categories

(Core :: DOM: Core & HTML, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(5 files)

Some of these should be ParseHTMLDimension and some should be parsing as unsigned ints (which behaves differently for negative values).

"charoff" isn't parsed specially in the spec, and nothing in our code uses the
parsed value.

The various margin attributes on <body> are "pixel length attributes" in the
spec, which should get parsed as non-negative integers. That said, Chrome and
Safari implement marginwidth, marginheight, marginleft, and margintop as
"dimension attributes" instead, and don't implement marginright and marginbottom
at all.

Per spec, "hspace" and "vspace" are parsed as dimension attributes and are
supported on the following elements: embed, iframe, img, object,
<input type="image">, marquee. Except no one implements this for iframe.
https://github.com/whatwg/html/issues/4742 tracks the spec changing accordingly.

As far as hspace/vpace on <table> go, Safari supports them in both quirks and
standards mode, while Chrome doesn't support them in either mode. The HTML spec
doesn't have them supported at all, and neither does the quirks mode spec, so
I'm removing the quirks-only support we had to align with the specs and Chrome.

Per spec, "border" is parsed as a non-negative integer, only mapped if nonzero
(though this is not observably different from mapping even if 0, except if user
or UA stylesheets style the border), and supported on img, object,
<input type="image">, but NOT embed, iframe, or marquee.

This matches the Chrome and Safari behavior, as far as I can tell. The
substantive change here is that we are removing mapping for the <embed border>
case.

Pushed by bzbarsky@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5f320b55434e part 1. Remove pointless parsing of "charoff" attributes. r=mccr8 https://hg.mozilla.org/integration/autoland/rev/399e8e089eda part 2. Fix parsing of margin attributes on <body> match the spec. r=mccr8 https://hg.mozilla.org/integration/autoland/rev/651433227fdb part 3. Change the dimension attribute reflection test to handle the attribute name and CSS property name not matching. r=mccr8 https://hg.mozilla.org/integration/autoland/rev/bd2a2e91e9ee part 4. Fix style mapping of hspace and vspace attributes to match the spec. r=mccr8 https://hg.mozilla.org/integration/autoland/rev/b8938b6afa9c part 5. Fix style mapping of border attribues to more closely match the spec. r=mccr8
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/17758 for changes under testing/web-platform/tests
Pushed by james@hoppipolla.co.uk: https://hg.mozilla.org/integration/mozilla-inbound/rev/d58f0c588227 [wpt PR 17758] - [Gecko Bug 1562257] part 2. Fix parsing of margin attributes on <body> match the spec., a=testonly
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: