Bug 63046 - HTMLLIElement::attach() seems incorrect
Summary: HTMLLIElement::attach() seems incorrect
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 72352
  Show dependency treegraph
 
Reported: 2011-06-20 23:36 PDT by Roland Steiner
Modified: 2012-07-25 19:10 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roland Steiner 2011-06-20 23:36:36 PDT
HTMLLIElement::attach() searches its parents for the containing list. However:

.) It ignores intervening "terrain", so will happily pass through whole tables, etc.
.) It doesn't check the element's display type, so will accept an <ol> or <ul>, even if their display type is not [un]ordered list. And conversely, it will not consider other elements even if their display type is set to list.

This seems incorrect.
Comment 1 Roland Steiner 2011-06-20 23:37:06 PDT
i should add that the only outcome of this is incorrect styling.
Comment 2 Roland Steiner 2011-06-20 23:38:11 PDT
It will also fail if the <li> is inside shadow DOM, and the containing <ol>/<ul> is outside - i.e., parentNode() should be changed to parentOrHostNode().
Comment 3 Dominic Cooney 2011-06-21 03:22:53 PDT
(In reply to comment #0)
> HTMLLIElement::attach() searches its parents for the containing list. However:
> 
> .) It ignores intervening "terrain", so will happily pass through whole tables, etc.

That seems busted.

> .) It doesn't check the element's display type, so will accept an <ol> or <ul>, even if their display type is not [un]ordered list. And conversely, it will not consider other elements even if their display type is set to list.

This seems OK. What is the problem with this behavior?

> This seems incorrect.
Comment 4 Roland Steiner 2011-06-21 15:52:58 PDT
(In reply to comment #3)
> (In reply to comment #0)
> > .) It doesn't check the element's display type, so will accept an <ol> or <ul>, even if their display type is not [un]ordered list. And conversely, it will not consider other elements even if their display type is set to list.
> 
> This seems OK. What is the problem with this behavior?

You're right, of course, esp. as there IS NO 'list' display type (just 'list-item'). @_@;;
Comment 5 Dominic Cooney 2011-11-15 16:53:08 PST
May be related to bug 72440.
Comment 6 Hajime Morrita 2012-07-25 19:10:50 PDT
http://trac.webkit.org/changeset/123570 fixed this.