[Webkit-unassigned] [Bug 91517] New: Prevent the box model from being affected by zooming

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 17 10:24:47 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=91517

           Summary: Prevent the box model from being affected by zooming
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Enhancement
          Priority: P4
         Component: Layout and Rendering
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: herr.pilsner at yahoo.de


Created an attachment (id=152779)
 --> (https://bugs.webkit.org/attachment.cgi?id=152779&action=review)
Illustration of the gap

Imagine a div element 100px wide and 10px high, containing 10 inline-block div elements with each being 10px wide and 10px high.

None of the div elements has margin, border or padding.

The child div elements should exactly fit into the parent div element.

Now when zooming is applied, the layout gets corrupted:

Imagine the zoom being set to 144%.

The parent div element is then rendered with a physical width of 100px * 1.44 = 144px.

The child div elements are rendered with physical widths of 10px * 1.44 = 14.4px each, which become 14px.

The 10 child div elements sum up to a total width of 14px * 10 = 140px.

They do not fit into the parent div element any more, producing an unwanted 4px gap, which could also become much bigger, e.g. 38px when filling a 960px div with 48 20px divs at a zoom factor of 144%.

The solution would be to not change width, height, padding, border and margin when zooming, but instead, calculate the box model as if the window would not have been zoomed, and then zooming the coordinates at which elements would be placed on the screen.

For example, the parent div element's top-left-coordinate would be 0/0 when placed at the top-left corner of the whole website. Its bottom-right-coordinate would be 100/10 (excluding).

Now these coordinates should be altered in relation to the zoom level when rendering the element. The top-left-coordinate remains 0/0, the bottom-right-coordinate becomes 144/14, because 100*1.44=144 and 10*1.44=14.4 becoming 14.

The coordinates of the child elements are altered in the same way. The last child element's bottom-right-coordinate will be 144/14, which is the same as the one of the parent div element, as these coordinates also were the same when unzoomed.

The edges between the 10 child div elements would then be evenly distributed within the area of the parent div.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list