Skip to content

[css-inline] When does an empty inline suppress the whole line when in a list? #5276

@emilio

Description

@emilio

Consider these examples, extracted from a real website.

  • data:text/html,<!doctype html><ul><li><span></span><p>bar</p></li>
  • data:text/html,<ul><li><span></span><p>bar</p></li> (same as above, but quirks instead of standard mode).
  • data:text/html,<!doctype html><li><span></span><p>bar</p></li> (same as the first example, but with a wrapping <ul>)
  • data:text/html,<li><span></span><p>bar</p></li> (same as above, but quirks)

Browsers seem to disagree on whether the <span> should take space:

  • WebKit thinks the <span> should never take space.
  • Gecko changes depending on the quirks mode.
  • Blink differs depending on whether there's an <ul> or not (lol). I suspect there's a better explanation for this, cc @kojiishi.

So... It's not clear to me the spec defines this case, but I may be wrong... Browsers clearly disagree even in standards mode.

I think I like WebKit's behavior more, as it's more consistent with how layout works when markers are not involved... I can dig on why Gecko only behaves like this in Quirks mode if needed. But people may have different opinions?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions