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.
i should add that the only outcome of this is incorrect styling.
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().
(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.
(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'). @_@;;
May be related to bug 72440.
http://trac.webkit.org/changeset/123570 fixed this.