Spec says "'Text-indent' only affects a line if it is the first formatted line of an element. For example, the first line of an anonymous block box is only affected if it is the first child of its parent element." [1] The test [2] (first block) shows that :first-line is not applied to "Some text", neither is the anonymous box in question the first child of its parent element, yet text-indent is applied. Reproduced in Safari, Chrome and nightly (r89415) on OSX and Safari and Chrome on Vista. [1] http://www.w3.org/TR/CSS21/text.html#propdef-text-indent [2] http://fry.si/bugs/text-indent-test.html
Created attachment 143592 [details] Reduced Test case
Another scenario: <style> body {background:#fff;} div {text-indent:50px;background:#eee;margin:0 0 10px; border} div:first-line {color:green;} span {display:block;background:#ddd;} </style> <body> <div> First Line Text. This must be indented. <span>Span Block. This must not be indented.</span> Text after span block. This must be not indented. </div> <body> Need some clarification on this, 1) I'm not sure if the text-indent must be applied to the text in the span element or not. The text in the span is not the first formatted line, however FF and opera seem to indent the text in the span element. 2) According to spec text-indent is to applied only for the first line text. However it is applied in even where there is not text on the first line. <div><img src="http://trac.webkit.org/chrome/site/icon.png" width="100px"/> </div> Is this expected behavior??
Created attachment 155868 [details] Patch
(In reply to comment #2) > Another scenario: > > <style> > body {background:#fff;} > div {text-indent:50px;background:#eee;margin:0 0 10px; border} > div:first-line {color:green;} > span {display:block;background:#ddd;} > </style> > > <body> > <div> > First Line Text. This must be indented. > <span>Span Block. This must not be indented.</span> > Text after span block. This must be not indented. > </div> > <body> > > Need some clarification on this, > 1) I'm not sure if the text-indent must be applied to the text in the span element or not. The text in the span is not the first formatted line, however FF and opera seem to indent the text in the span element. This is due to the span inheriting the indent from the div. > > 2) According to spec text-indent is to applied only for the first line text. However it is applied in even where there is not text on the first line. > > <div><img src="http://trac.webkit.org/chrome/site/icon.png" width="100px"/> > </div> > Is this expected behavior?? I think this is OK - it's the line-box that gets indented rather than the 'text'.
Comment on attachment 155868 [details] Patch Seems reasonable. Thanks!
Comment on attachment 155868 [details] Patch Rejecting attachment 155868 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 1 ERROR: /mnt/git/webkit-commit-queue/PerformanceTests/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive). Full output: http://queues.webkit.org/results/13470348
Comment on attachment 155868 [details] Patch The checkout got corrupted on one of the instances. Adam is fixing.
Comment on attachment 155868 [details] Patch Clearing flags on attachment: 155868 Committed r125202: <http://trac.webkit.org/changeset/125202>
All reviewed patches have been landed. Closing bug.