Bug 14395

Summary: When a <p> is inside <li> two <BR>s are rendered
Product: WebKit Reporter: Sridhar Gurivireddy <just1gb>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: hyatt, justin.garcia
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
<p> inside <li>
none
Check if the inline really generates line boxes
none
Check if the inline really generates line boxes hyatt: review+

Sridhar Gurivireddy
Reported 2007-06-25 13:40:42 PDT
When a webpage has a <p> inside a list element, two breaks are rendered. The behaviour deviates from IE and Firefox, though might be conformant with standards. Repro: Use the attached file to reproduce the bug
Attachments
<p> inside <li> (929 bytes, text/html)
2007-06-25 13:41 PDT, Sridhar Gurivireddy
no flags
Check if the inline really generates line boxes (4.06 KB, patch)
2007-06-26 12:37 PDT, mitz
no flags
Check if the inline really generates line boxes (78.97 KB, patch)
2007-06-30 07:01 PDT, mitz
hyatt: review+
Sridhar Gurivireddy
Comment 1 2007-06-25 13:41:16 PDT
Created attachment 15233 [details] <p> inside <li>
Dave Hyatt
Comment 2 2007-06-25 13:53:28 PDT
This is a bug (and a rather basic one at that).
mitz
Comment 3 2007-06-25 15:39:33 PDT
As Hyatt pointed out, the problem is that the marker gets put before the <a> instead of inside the <p>, because getParentOfFirstLineBox() thinks that the <a> is going to have a line box. I tried to fix it by changing - if (currChild->isInline()) + if (currChild->isInline() && (currChild->firstChild() || !currChild->isInlineFlow())) But the firstChild() check isn't right, for example if the child contains only skipped whitespace. I don't know how to tell if the child is going to generate lines.
mitz
Comment 4 2007-06-26 12:37:01 PDT
Created attachment 15255 [details] Check if the inline really generates line boxes This checks that the inline actually has some non-skipped content before placing the marker outside it. It makes two editing test fail: editing/pasteboard/4861080.html - I don't know what it's supposed to test once this bug is fixed editing/pasteboard/paste-4039777-fix.html - I don't understand the old results (they don't seem to be what's described or what I would expect) It might be better not to call inlineChildGeneratesLineBoxes() in all cases except when curr is an anonymous block with continuation.
mitz
Comment 5 2007-06-30 07:01:44 PDT
Created attachment 15324 [details] Check if the inline really generates line boxes Also fixes the <ul><li><div><ul><li>foo</li></ul></div><br></li></ul> case, which was rendered completely wrong in quirks mode, making it match Firefox by not applying the quirk if the list is not a child of the list item. As far as I can tell, the affected editing test was testing buggy conditions that no longer occur with this patch, but I did not want to remove it.
Dave Hyatt
Comment 6 2007-07-10 13:54:03 PDT
Comment on attachment 15324 [details] Check if the inline really generates line boxes r=me
Mark Rowe (bdash)
Comment 7 2007-07-13 04:53:51 PDT
Landed in r24255.
Note You need to log in before you can comment on or make changes to this bug.