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&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rego&#64;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&amp;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 (&quot;Green&quot; should be green and &quot;Black&quot; should be black):
&lt;style&gt;
    .first-line-green::first-line {
        color: lime;
    }

    .float {
        float: left;
    }
&lt;/style&gt;
&lt;div class=&quot;first-line-green&quot;&gt;
    &lt;div class=&quot;float&quot;&gt;
        Black
    &lt;/div&gt;
    &lt;div&gt;Green&lt;/div&gt;
&lt;/div&gt;

In the example the text &quot;Green&quot; 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 &quot;::first-line&quot; skips the floated element as expected, but it doesn't select the &quot;Green&quot; text because of it's not the first child.
Probably it's due to the condition &quot;parentBlock-&gt;firstChild() != firstLineBlock&quot; in RenderBlock::firstLineBlock() (but if you remove this condition other simple cases will fail):
    if (firstLineBlock-&gt;isReplaced() || firstLineBlock-&gt;isFloating()
        || !parentBlock || parentBlock-&gt;firstChild() != firstLineBlock || !isRenderBlockFlowOrRenderButton(*parentBlock))
        break;

However, if you remove the &quot;&lt;div&gt;&quot; wrapping &quot;Green&quot; 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):
&lt;style&gt;
    .first-line-green::first-line {
        color: lime;
    }

    .float {
        float: left;
    }
&lt;/style&gt;
&lt;div class=&quot;first-line-green&quot;&gt;
    &lt;div class=&quot;float&quot;&gt;
        Black
    &lt;/div&gt;
    Green
&lt;/div&gt;

BTW, the same happens if you use a positioned element.



More information about the webkit-unassigned mailing list