<?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>42527</bug_id>
          
          <creation_ts>2010-07-18 15:26:36 -0700</creation_ts>
          <short_desc>[Qt] tst_QWebElement fails firstChildNextSibling and lastChildPreviousSibling</short_desc>
          <delta_ts>2010-07-18 15:55:57 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Qt, QtTriaged</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andreas Kling">kling</reporter>
          <assigned_to name="Andreas Kling">kling</assigned_to>
          <cc>hausmann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>253016</commentid>
    <comment_count>0</comment_count>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-07-18 15:26:36 -0700</bug_when>
    <thetext>Running current Qt 4.7 and WebKit ToT:

FAIL!  : tst_QWebElement::firstChildNextSibling() &apos;!table.isNull()&apos; returned FALSE. ()
   Loc: [tst_qwebelement.cpp(898)]
FAIL!  : tst_QWebElement::lastChildPreviousSibling() Compared values are not the same
   Actual (table.tagName()): P
   Expected (QString(&quot;TABLE&quot;)): TABLE
   Loc: [tst_qwebelement.cpp(911)]

The test fails because it&apos;s using invalid HTML:

&lt;body&gt;&lt;!--comment--&gt;&lt;p&gt;Test&lt;/p&gt;&lt;!--another comment&gt;&lt;table&gt;

The correct way to write this would be:

&lt;body&gt;&lt;!--comment--&gt;&lt;p&gt;Test&lt;/p&gt;&lt;!--another comment--&gt;&lt;table&gt;

HTML5 has the following to say about comments:

Comments must start with the four character sequence U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS (&lt;!--). Following this sequence, the comment may have text, with the additional restriction that the text must not start with a single U+003E GREATER-THAN SIGN character (&gt;), nor start with a U+002D HYPHEN-MINUS character (-) followed by a U+003E GREATER-THAN SIGN (&gt;) character, nor contain two consecutive U+002D HYPHEN-MINUS characters (--), nor end with a U+002D HYPHEN-MINUS character (-). Finally, the comment must be ended by the three character sequence U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E GREATER-THAN SIGN (--&gt;).

http://www.whatwg.org/specs/web-apps/current-work/#comments</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>253019</commentid>
    <comment_count>1</comment_count>
      <attachid>61915</attachid>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-07-18 15:30:59 -0700</bug_when>
    <thetext>Created attachment 61915
Proposed patch

Correct the HTML used by these tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>253021</commentid>
    <comment_count>2</comment_count>
      <attachid>61915</attachid>
    <who name="Antonio Gomes">tonikitoo</who>
    <bug_when>2010-07-18 15:49:20 -0700</bug_when>
    <thetext>Comment on attachment 61915
Proposed patch

&gt; diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
&gt; index efbee15..31b488f 100644
&gt; --- a/WebKit/qt/ChangeLog
&gt; +++ b/WebKit/qt/ChangeLog
&gt; @@ -1,3 +1,16 @@
&gt; +2010-07-18  Andreas Kling  &lt;andreas.kling@nokia.com&gt;
&gt; +
&gt; +        Reviewed by NOBODY (OOPS!).
&gt; +
&gt; +        [Qt] tst_QWebElement fails firstChildNextSibling and lastChildPreviousSibling
&gt; +        https://bugs.webkit.org/show_bug.cgi?id=42527
&gt; +
&gt; +        Correct the HTML used by these tests.
&gt; +
&gt; +        * tests/qwebelement/tst_qwebelement.cpp:
&gt; +        (tst_QWebElement::firstChildNextSibling):
&gt; +        (tst_QWebElement::lastChildPreviousSibling):
&gt; +
&gt;  2010-07-16  Zhe Su  &lt;suzhe@chromium.org&gt;
&gt;  
&gt;          Reviewed by Darin Adler.
&gt; diff --git a/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp b/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
&gt; index 8db0ec3..2f1097a 100644
&gt; --- a/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
&gt; +++ b/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
&gt; @@ -887,7 +887,7 @@ void tst_QWebElement::nullSelect()
&gt;  
&gt;  void tst_QWebElement::firstChildNextSibling()
&gt;  {
&gt; -    m_mainFrame-&gt;setHtml(&quot;&lt;body&gt;&lt;!--comment--&gt;&lt;p&gt;Test&lt;/p&gt;&lt;!--another commend&gt;&lt;table&gt;&quot;);
&gt; +    m_mainFrame-&gt;setHtml(&quot;&lt;body&gt;&lt;!--comment--&gt;&lt;p&gt;Test&lt;/p&gt;&lt;!--another comment--&gt;&lt;table&gt;&quot;);
&gt;  
&gt;      QWebElement body = m_mainFrame-&gt;findFirstElement(&quot;body&quot;);
&gt;      QVERIFY(!body.isNull());
&gt; @@ -902,7 +902,7 @@ void tst_QWebElement::firstChildNextSibling()
&gt;  
&gt;  void tst_QWebElement::lastChildPreviousSibling()
&gt;  {
&gt; -    m_mainFrame-&gt;setHtml(&quot;&lt;body&gt;&lt;!--comment--&gt;&lt;p&gt;Test&lt;/p&gt;&lt;!--another commend&gt;&lt;table&gt;&quot;);
&gt; +    m_mainFrame-&gt;setHtml(&quot;&lt;body&gt;&lt;!--comment--&gt;&lt;p&gt;Test&lt;/p&gt;&lt;!--another comment--&gt;&lt;table&gt;&quot;);
&gt;  
&gt;      QWebElement body = m_mainFrame-&gt;findFirstElement(&quot;body&quot;);
&gt;      QVERIFY(!body.isNull());</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>253024</commentid>
    <comment_count>3</comment_count>
      <attachid>61915</attachid>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-07-18 15:55:46 -0700</bug_when>
    <thetext>Comment on attachment 61915
Proposed patch

Clearing flags on attachment: 61915

Committed r63637: &lt;http://trac.webkit.org/changeset/63637&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>253025</commentid>
    <comment_count>4</comment_count>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-07-18 15:55:57 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>61915</attachid>
            <date>2010-07-18 15:30:59 -0700</date>
            <delta_ts>2010-07-18 15:55:46 -0700</delta_ts>
            <desc>Proposed patch</desc>
            <filename>bug-42527.diff</filename>
            <type>text/plain</type>
            <size>1704</size>
            <attacher name="Andreas Kling">kling</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYktpdC9xdC9DaGFuZ2VMb2cgYi9XZWJLaXQvcXQvQ2hhbmdlTG9nCmlu
ZGV4IGVmYmVlMTUuLjMxYjQ4OGYgMTAwNjQ0Ci0tLSBhL1dlYktpdC9xdC9DaGFuZ2VMb2cKKysr
IGIvV2ViS2l0L3F0L0NoYW5nZUxvZwpAQCAtMSwzICsxLDE2IEBACisyMDEwLTA3LTE4ICBBbmRy
ZWFzIEtsaW5nICA8YW5kcmVhcy5rbGluZ0Bub2tpYS5jb20+CisKKyAgICAgICAgUmV2aWV3ZWQg
YnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgW1F0XSB0c3RfUVdlYkVsZW1lbnQgZmFpbHMg
Zmlyc3RDaGlsZE5leHRTaWJsaW5nIGFuZCBsYXN0Q2hpbG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