Ticket #2910 (closed bug: fixed)

Opened 3 years ago

Last modified 2 years ago

Fix sizing of the Box handler's box

Reported by: ahocevar Owned by: sbrunner
Priority: minor Milestone: 2.11 Release
Component: Handler.Box Version: 2.10
Keywords: Cc:
State:

Description

This should already have been fixed in #1593, which only fixed the issue visually because the 2 pixel box border and the 1 pixel offset due to the map border in our examples (fixed with #2247) make it appear correctly with both the w3c and the traditional box model.

The patch proposed here determines the border width of all box edges (instead of just the left+right and top+bottom sums), calculates the correct width and height offsets depending on the box model, and does not rely on browser detection any more to determine the box model.

Two manual tests are added (tests/manual/box-quirks.html and tests/manual/box-strict.html), which appear correctly in FF3.6, IE8 and Safari 5. Unit tests for Handler.Box were missing, so I also created some. All pass in the mentioned browsers.

Thanks for any review.

Attachments

openlayers-2910.patch Download (14.2 KB) - added by ahocevar 3 years ago.
openlayers-2910.2.patch Download (13.1 KB) - added by ahocevar 2 years ago.
applies to current trunk
openlayers-2910.2.2.patch Download (13.1 KB) - added by ahocevar 2 years ago.
applies to current trunk

Change History

Changed 3 years ago by ahocevar

Changed 2 years ago by crschmidt

  • state changed from Review to Needs More Work

My recent patch to this eventsDiv stuff breaks this patch

Changed 2 years ago by ahocevar

applies to current trunk

Changed 2 years ago by ahocevar

applies to current trunk

Changed 2 years ago by ahocevar

  • state changed from Needs More Work to Review

Changed 2 years ago by erilem

  • owner set to sbrunner

Changed 2 years ago by sbrunner

  • state changed from Review to Commit

There is a little mistake in the boxOffsets comment (referance to boxCharacteristics) all other is OK for me, than commit.

Changed 2 years ago by ahocevar

  • status changed from new to closed
  • resolution set to fixed

(In [11749]) fixed box sizing and positioning. r=sbrunner (closes #2910)

Changed 2 years ago by fredj

  • status changed from closed to reopened
  • state Commit deleted
  • resolution fixed deleted

This breaks the Handler/Box tests with FF4. works with Chrome. Manual tests works with FF4

Changed 2 years ago by ahocevar

  • status changed from reopened to closed
  • resolution set to fixed

(In [11753]) omit some tests in browsers that don't give us getComputedStyle for elements inside hidden frames (closes #2910)

Note: See TracTickets for help on using tickets.