[Webkit-unassigned] [Bug 76451] Ignoring padding-right of inline elements in containers with undefined width

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 17 07:33:36 PDT 2012


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


Arpita Bahuguna <arpitabahuguna at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arpitabahuguna at gmail.com




--- Comment #1 from Arpita Bahuguna <arpitabahuguna at gmail.com>  2012-07-17 07:33:36 PST ---
The problem is not that WebKit doesn't draw the right padding but rather that it takes into account the space between the nested inline span tags i.e. between the inner </span> and the outer </span> in the test page.
These space characters are treated as a valid text object and thus while rendering, we consider the width of one space character (since we collapse whitespace) which at the time of calculating the positioned container block's width is ignored.
In computeInlinePreferredLogicalWidths(), the width of the text is computed as 120 to which we add the 20px of padding. Thus our containing block has a width of 140px. But for the spaces between the nested inline end tags, we consider 4px width (for one space) which too is added to this 140px and we now get a width of 144px.
At the end of the function we remove this 4px (width of one space character) from the final width of 144px (since we collapse whitespace) and thus get 140px.
So ultimately we assign a width of 140px to our positioned containing block.

Now, when we are laying out the objects RenderBlock::layoutRunsAndFloatsInRange() -> which calls on the RenderBlock::lineBreaker::nextLineBreak() for calculating the end position of the line; we consider the 4px of the space character (and are not ignoring it as was done while computing the width of the containing block) because of which our length (144px) is not able to fit in the given width (140px) and so our end position is calculated incorrectly (i.e. up to the end of the line) which leaves no space for the right padding.

In the case when no position is specified for our containing block, the full width of the view is considered (instead of calculating the specific value) and since 144px can fit within that, there is no discrepancy in the display.

-- 
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