No subject
Fri Mar 7 15:32:22 PST 2014
"The first formatted line of an element may occur inside a block-level descendant in the same flow (i.e., a block-level descendant that is not out-of-flow due to floating or positioning). For example, the first line of the DIV in <DIV><P>This line...</P></DIV> is the first line of the P (assuming that both P and DIV are block-level)."
--
You are receiving this mail because:
You are the assignee for the bug.
--1421408305.4d0bBc0.25043
Date: Fri, 16 Jan 2015 03:38:25 -0800
MIME-Version: 1.0
Content-Type: text/html
<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - ::first-line skips out-of-flow elements but doesn't affect the next block"
href="https://bugs.webkit.org/show_bug.cgi?id=140542">140542</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>::first-line skips out-of-flow elements but doesn't affect the next block
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>528+ (Nightly build)
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>OS</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>CSS
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>rego@igalia.com
</td>
</tr>
<tr>
<th>Depends on</th>
<td>140541
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=244759" name="attach_244759" title="Example to reproduce the issue">attachment 244759</a> <a href="attachment.cgi?id=244759&action=edit" title="Example to reproduce the issue">[details]</a></span>
Example to reproduce the issue
First <a class="bz_bug_link
bz_status_NEW "
title="NEW - REGRESSION: first-line doesn't affect any children"
href="show_bug.cgi?id=140541">bug #140541</a> should be fixed, but this issue was present before (Safari 7) and it's still present in Blink (<a href="https://code.google.com/p/chromium/issues/detail?id=449475">https://code.google.com/p/chromium/issues/detail?id=449475</a>).
Example (attached) to reproduce the issue ("Green" should be green and "Black" should be black):
<style>
.first-line-green::first-line {
color: lime;
}
.float {
float: left;
}
</style>
<div class="first-line-green">
<div class="float">
Black
</div>
<div>Green</div>
</div>
In the example the text "Green" appears in black.
Once <a class="bz_bug_link
bz_status_NEW "
title="NEW - REGRESSION: first-line doesn't affect any children"
href="show_bug.cgi?id=140541">bug #140541</a> is fixed, this problem might be probably because of "::first-line" skips the floated element as expected, but it doesn't select the "Green" text because of it's not the first child.
Probably it's due to the condition "parentBlock->firstChild() != firstLineBlock" in RenderBlock::firstLineBlock() (but if you remove this condition other simple cases will fail):
if (firstLineBlock->isReplaced() || firstLineBlock->isFloating()
|| !parentBlock || parentBlock->firstChild() != firstLineBlock || !isRenderBlockFlowOrRenderButton(*parentBlock))
break;
However, if you remove the "<div>" wrapping "Green" it worked as expected (once <a class="bz_bug_link
bz_status_NEW "
title="NEW - REGRESSION: first-line doesn't affect any children"
href="show_bug.cgi?id=140541">bug #140541</a> is fixed it'll work as expected):
<style>
.first-line-green::first-line {
color: lime;
}
.float {
float: left;
}
</style>
<div class="first-line-green">
<div class="float">
Black
</div>
Green
</div>
BTW, the same happens if you use a positioned element.
More information about the webkit-unassigned
mailing list