Bug 3317

Summary: REGRESSION: CSS2: outline is applied to both <li> element and its enclosing text with context dependent selector
Product: WebKit Reporter: Hanspeter Schaub <Hanspeterschaub>
Component: CSSAssignee: Dave Hyatt <hyatt>
Status: VERIFIED FIXED    
Severity: Normal    
Priority: P2    
Version: 412   
Hardware: Mac   
OS: OS X 10.4   
URL: http://homepage.mac.com/hanspeterschaub/work/conferences.html
Attachments:
Description Flags
Reduced test case
none
simple test case to see "outline" error with lists
none
proposed patch
hyatt: review-
list outline regression test
none
Actual behavior
none
Expected behavior
none
fixes the issue where the outline is applied to the list text element
hyatt: review+
minor revision to patch, removed space between closing parentheses hyatt: review+

Description Hanspeter Schaub 2005-06-07 16:11:23 PDT
Starting with Safary 1.3/2.0, I found that the CSS outline command appears to be applied twice when used 
on a list element.  I'm using a hover command on the <ul> <li> element, and it used to cause the list 
entry to be highlighted with a outline when the mouse was over it.  Starting with 1.3/2.0, now the outline 
is still there, but there is a 2nd, inner outline right around the text entry itself?  

This bug still seems to be there in the latest build I tried today.

thanks,

Hanspeter Schaub
Comment 1 Nicholas Shanks 2005-06-07 16:58:34 PDT
Could you please post a public URL or attach the "conferences.html" file to this bug - we are unable to see 
what's on your private iDisk !
Comment 2 Chris Petersen 2005-06-08 21:45:27 PDT
I have reduced the page to a simple text case that reproduces the problem.

The test case contains a simple ordered list uses class='test':

<ol class="test">
<li>
OL element with a single child LI element 
</li> 
</ol>

A CSS rule is applied to the OL:

ol.test li:hover {
	outline: dashed;
	padding:0.5em;
}

The problem occurs when padding is specified (padding: 0.5em)

If you open the test case "outline_sample.html" and hover over the OL,  both the OL and LI appear with 
a dashed outline. If  padding is removed, this issue will no longer reproduce.

Under Firefox 1.0.4 , this test case is rendered with just the outline for the OL.
Comment 3 Chris Petersen 2005-06-08 21:47:42 PDT
Created attachment 2167 [details]
Reduced test case
Comment 4 Hanspeter Schaub 2005-06-09 13:31:07 PDT
Created attachment 2188 [details]
simple test case to see "outline" error with lists
Comment 5 Hanspeter Schaub 2005-06-18 12:28:23 PDT
Created attachment 2463 [details]
proposed patch

I found that the code in renderflow.cpp was causing the erroneous outline to be
drawn on the list elements.  In this patch I simply commented out the old code.
 Please not, I'm not a professional programmer, but an engineer :-)  I found
this fix by searching through the code for anything related to drawing outlines
and testing those code sections.  

I did run the regression test and the modified code passes all the test.
Comment 6 Hanspeter Schaub 2005-06-18 12:30:28 PDT
Created attachment 2464 [details]
list outline regression test

This is the regression test for the proposed patch.  It shows a simple
unordered list with the outline applied to the list element.  If the test is
successful, then a single outline should appear over the list element.	If the
browser fails, then two outlines are visible.
Comment 7 David Kilzer (:ddkilzer) 2005-06-19 12:03:13 PDT
Created attachment 2474 [details]
Actual behavior
Comment 8 David Kilzer (:ddkilzer) 2005-06-19 12:04:38 PDT
Created attachment 2475 [details]
Expected behavior

Expected behavior (seen after patch in Attachment 2463 [details] is applied).
Comment 9 David Kilzer (:ddkilzer) 2005-06-19 12:32:54 PDT
After looking into this bug, it appears that the outline property is being applied to both the <li> element 
as well as its enclosing text.  Updated title to reflect this.
Comment 10 David Kilzer (:ddkilzer) 2005-06-19 12:33:59 PDT
See also Bug 3611 for another outline property issue.
Comment 11 Dave Hyatt 2005-06-19 21:41:30 PDT
Comment on attachment 2463 [details]
proposed patch

This patch is incorrect and will break all non-auto outline styles on inlines.

The real bug occurs in render_line.cpp around line 754.  Root lines should not
be adding their block objects to the outlineObjects dict.
Comment 12 Hanspeter Schaub 2005-06-22 17:04:37 PDT
Created attachment 2559 [details]
fixes the issue where the outline is applied to the list text element

Following Dave Hyatt's suggestion, I added a check to render_line.cpp (line
754) to check that the object is not a root object.  The previously supplied
regression test case renders properly, and running run-webkit-tests passes all
previous tests.
Comment 13 Dave Hyatt 2005-06-25 13:11:47 PDT
+ is not what you should set.  ? is how you ask  for review.  + means the patch received review.
Comment 14 Darin Adler 2005-06-26 16:49:32 PDT
Comment on attachment 2559 [details]
fixes the issue where the outline is applied to the list text element

Dave Hyatt should be the one to review this.
Comment 15 Dave Hyatt 2005-06-26 17:45:12 PDT
Comment on attachment 2559 [details]
fixes the issue where the outline is applied to the list text element

Style is wrong.  Make sure to remove the extra space between the two close
parentheses.

Other than that, r=me.
Comment 16 Hanspeter Schaub 2005-06-26 19:46:57 PDT
Created attachment 2661 [details]
minor revision to patch, removed space between closing parentheses 

fixes a small style error in the earlier patch.  The space between the two
closing parentheses has been removed in this version.
Comment 17 Dave Hyatt 2005-06-26 19:51:22 PDT
Comment on attachment 2661 [details]
minor revision to patch, removed space between closing parentheses 

r=me