<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>9840</bug_id>
          
          <creation_ts>2006-07-10 22:45:07 -0700</creation_ts>
          <short_desc>last-child pseudo-class applied to all elements</short_desc>
          <delta_ts>2006-12-16 14:26:23 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>4812</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philippe Wittenbergh">phiw2</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>nickshanks</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>49167</commentid>
    <comment_count>0</comment_count>
    <who name="Philippe Wittenbergh">phiw2</who>
    <bug_when>2006-07-10 22:45:07 -0700</bug_when>
    <thetext>The CSS3 :last-child pseudo-class is applied to all elements of a block instead of the last element. I&apos;ll attach a testcase in a moment.

This equally applies to the :last-of-type pseudo-class.

Safari 1.2 and older actually apply this correctly. But it is broken from Safari 1.3 and 2.0 onwards (and in the nightly WebKit builds).

(and it is not clear if these pseudo-classes are actually implemented, there is bug 5468 on that).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49168</commentid>
    <comment_count>1</comment_count>
      <attachid>9354</attachid>
    <who name="Philippe Wittenbergh">phiw2</who>
    <bug_when>2006-07-10 22:49:20 -0700</bug_when>
    <thetext>Created attachment 9354
test case

Interesting observation maybe. While filing in this bug report with another browser, WebKit was hidden. Unhiding it,  the testcase painted correctly. Refresh and display was wrong again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49197</commentid>
    <comment_count>2</comment_count>
    <who name="Nicholas Shanks">nickshanks</who>
    <bug_when>2006-07-11 01:50:24 -0700</bug_when>
    <thetext>This occurs because the last-* styles are checked as each element is read in (same as all styles) and at that point, each element *is* the last child since nothing has been added after it yet :-)
When repainting, the child is no longer last, so all is fine.

I have been waiting for a year for hyatt to decide what he wants to do about this, as the khtml solution used too much memory. No solution has yet been proposed though.

I think we could get by with just setting the usesSiblingSelectors bit on any :last-* pseudo-class (the bit currently used for ~ selector).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49198</commentid>
    <comment_count>3</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2006-07-11 02:06:10 -0700</bug_when>
    <thetext>Shrug, it&apos;s not my job to propose solutions to every problem.  Feel free to come up with something that doesn&apos;t bloat all nodes by 4 bytes. :)
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41745</commentid>
    <comment_count>4</comment_count>
    <who name="">mitz</who>
    <bug_when>2006-12-16 14:26:23 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of 4812 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>9354</attachid>
            <date>2006-07-10 22:49:20 -0700</date>
            <delta_ts>2006-07-10 22:49:20 -0700</delta_ts>
            <desc>test case</desc>
            <filename>test-last-child.html</filename>
            <type>text/html</type>
            <size>832</size>
            <attacher name="Philippe Wittenbergh">phiw2</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEvL0VOIiAiaHR0cDov
L3d3dy53My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