Title: [189736] releases/WebKitGTK/webkit-2.10
Revision
189736
Author
carlo...@webkit.org
Date
2015-09-14 10:00:45 -0700 (Mon, 14 Sep 2015)

Log Message

Merge r189252 - http/tests/w3c/dom/nodes/Element-matches.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=148615

Reviewed by Ryosuke Niwa.

Source/WebCore:

Several newly-imported w3c tests were flaky due to the :target
pseudo-class selectors sometimes giving different results. The
issue seems to be that this type of selector relies on the
Document::cssTarget() element to do the matching. We update
this cssTarget Element in FrameView's scrollToFragment() /
scrollToAnchor(). This is called from
scrollToFragmentWithParentBoundary() which is called by
FrameLoader's finishedParsing() and loadInSameDocument().

In the first one, it is called *after* calling checkComplete()
which fires the onload event. However, in the second method,
it is called *before*. This patch updates finishedParsing()
so that scrollToFragmentWithParentBoundary() is called *before*
firing the onload event, consistently with loadInSameDocument().
This makes sure that _javascript_ executed in an onload event
handler will get accurate results for :target pseudo-class
selectors.

No new tests, covered by:
http/tests/w3c/dom/nodes/Element-matches.html
http/tests/w3c/dom/nodes/ParentNode-querySelector-All-xhtml.xhtml

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::finishedParsing):

LayoutTests:

Unskip the tests and rebaseline them now that the target pseudo selector
checks are consistently passing.

* TestExpectations:
* http/tests/w3c/dom/nodes/Element-matches-expected.txt:
* http/tests/w3c/dom/nodes/ParentNode-querySelector-All-expected.txt:
* http/tests/w3c/dom/nodes/ParentNode-querySelector-All-xhtml-expected.txt:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog (189735 => 189736)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog	2015-09-14 16:58:37 UTC (rev 189735)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog	2015-09-14 17:00:45 UTC (rev 189736)
@@ -1,3 +1,18 @@
+2015-09-02  Chris Dumez  <cdu...@apple.com>
+
+        http/tests/w3c/dom/nodes/Element-matches.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=148615
+
+        Reviewed by Ryosuke Niwa.
+
+        Unskip the tests and rebaseline them now that the target pseudo selector
+        checks are consistently passing.
+
+        * TestExpectations:
+        * http/tests/w3c/dom/nodes/Element-matches-expected.txt:
+        * http/tests/w3c/dom/nodes/ParentNode-querySelector-All-expected.txt:
+        * http/tests/w3c/dom/nodes/ParentNode-querySelector-All-xhtml-expected.txt:
+
 2015-08-31  Chris Dumez  <cdu...@apple.com>
 
         NodeFilter.SHOW_ALL has wrong value on 32-bit

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog (189735 => 189736)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2015-09-14 16:58:37 UTC (rev 189735)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2015-09-14 17:00:45 UTC (rev 189736)
@@ -1,3 +1,35 @@
+2015-09-02  Chris Dumez  <cdu...@apple.com>
+
+        http/tests/w3c/dom/nodes/Element-matches.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=148615
+
+        Reviewed by Ryosuke Niwa.
+
+        Several newly-imported w3c tests were flaky due to the :target
+        pseudo-class selectors sometimes giving different results. The
+        issue seems to be that this type of selector relies on the
+        Document::cssTarget() element to do the matching. We update
+        this cssTarget Element in FrameView's scrollToFragment() /
+        scrollToAnchor(). This is called from
+        scrollToFragmentWithParentBoundary() which is called by
+        FrameLoader's finishedParsing() and loadInSameDocument().
+
+        In the first one, it is called *after* calling checkComplete()
+        which fires the onload event. However, in the second method,
+        it is called *before*. This patch updates finishedParsing()
+        so that scrollToFragmentWithParentBoundary() is called *before*
+        firing the onload event, consistently with loadInSameDocument().
+        This makes sure that _javascript_ executed in an onload event
+        handler will get accurate results for :target pseudo-class
+        selectors.
+
+        No new tests, covered by:
+        http/tests/w3c/dom/nodes/Element-matches.html
+        http/tests/w3c/dom/nodes/ParentNode-querySelector-All-xhtml.xhtml
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::finishedParsing):
+
 2015-09-02  Zan Dobersek  <zdober...@igalia.com>
 
         Construct default winding string arguments in CanvasRenderingContext2D from ASCIILiteral objects

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/loader/FrameLoader.cpp (189735 => 189736)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/loader/FrameLoader.cpp	2015-09-14 16:58:37 UTC (rev 189735)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/loader/FrameLoader.cpp	2015-09-14 17:00:45 UTC (rev 189736)
@@ -753,6 +753,8 @@
 
     m_client.dispatchDidFinishDocumentLoad();
 
+    scrollToFragmentWithParentBoundary(m_frame.document()->url());
+
     checkCompleted();
 
     if (!m_frame.view())
@@ -761,7 +763,6 @@
     // Check if the scrollbars are really needed for the content.
     // If not, remove them, relayout, and repaint.
     m_frame.view()->restoreScrollbar();
-    scrollToFragmentWithParentBoundary(m_frame.document()->url());
 }
 
 void FrameLoader::loadDone()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to