RESOLVED FIXED 63185
CSS 2.1 failure: 'Text-indent' only affects a line if it is the first formatted line of an element
https://bugs.webkit.org/show_bug.cgi?id=63185
Summary CSS 2.1 failure: 'Text-indent' only affects a line if it is the first formatt...
Marko Mrdjenovic
Reported 2011-06-22 14:37:15 PDT
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
Attachments
Reduced Test case (519 bytes, text/html)
2012-05-23 10:36 PDT, Pravin D
no flags
Patch (24.70 KB, patch)
2012-08-01 13:16 PDT, Robert Hogan
no flags
Pravin D
Comment 1 2012-05-23 10:36:58 PDT
Created attachment 143592 [details] Reduced Test case
Pravin D
Comment 2 2012-05-23 10:54:18 PDT
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??
Robert Hogan
Comment 3 2012-08-01 13:16:16 PDT
Robert Hogan
Comment 4 2012-08-01 13:56:27 PDT
(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'.
Eric Seidel (no email)
Comment 5 2012-08-09 13:36:17 PDT
Comment on attachment 155868 [details] Patch Seems reasonable. Thanks!
WebKit Review Bot
Comment 6 2012-08-09 13:41:06 PDT
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
Eric Seidel (no email)
Comment 7 2012-08-09 13:43:34 PDT
Comment on attachment 155868 [details] Patch The checkout got corrupted on one of the instances. Adam is fixing.
WebKit Review Bot
Comment 8 2012-08-09 14:13:00 PDT
Comment on attachment 155868 [details] Patch Clearing flags on attachment: 155868 Committed r125202: <http://trac.webkit.org/changeset/125202>
WebKit Review Bot
Comment 9 2012-08-09 14:13:04 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.