Open Bug 1287830 Opened 9 years ago Updated 3 years ago

text-indent adds space for empty node (no line of text involved)

Categories

(Core :: Layout, defect, P3)

45 Branch
x86_64
Windows 7
defect

Tracking

()

UNCONFIRMED

People

(Reporter: alex.th.kloss.77, Unassigned)

References

()

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36 Steps to reproduce: Try the following HTML source: <p style="padding: 5px; display:inline-block;text-indent:20px;background:#F00;"><span></span></p> Actual results: A red square with 30x10px² was rendered. Expected results: since there was no text inside the <p>, only an empty span, the red square should have been 10x10px². https://www.w3.org/TR/CSS2/text.html#propdef-text-indent clearly states that it should only affect the first formatted line - an empty <span> shouldn't be considered a formatted line.
OS: Unspecified → Windows 7
Hardware: Unspecified → x86_64
Component: Untriaged → Layout
Product: Firefox → Core
David, your thoughts about the spec and testcase?
Flags: needinfo?(dbaron)
I don't see anything in https://drafts.csswg.org/css2/selector.html#first-line-pseudo to suggest that such a line wouldn't count as the "first formatted line". But it's probably more relevant to find out what other implementations do, and fix the spec to match, rather than trying to parse the spec for the answer to a question the spec's authors hadn't thought about. What do other browsers do?
Flags: needinfo?(dbaron)
If there's no text, it's hardly a "line *of text* in a block container" as stated in https://drafts.csswg.org/css2/text.html#indentation-prop, is it? All other browsers that I tested (Chrome, Internet Explorer 9/11, Safari, Android native) showed the expected result.
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.