Title: [264334] trunk/Source/WebCore
Revision
264334
Author
justin_...@apple.com
Date
2020-07-14 02:26:03 -0700 (Tue, 14 Jul 2020)

Log Message

[WebGL] REGRESSION (r262366): Google search photos do not render, black images
https://bugs.webkit.org/show_bug.cgi?id=214156
<rdar://problem/64964922>

Reviewed by Dean Jackson.

http://trac.webkit.org/changeset/262366 separated WebGL canvas contents swapping and presentation
into two steps. This Google search page was only running the presentation code without the swapping
step, as it removes canvases from the observer Document before the Document is able to swap its canvas'
contents. Ensure that re-inserted canvas elements properly register their new Documents as observers.

Covered by existing tests.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::insertedIntoAncestor):
* html/HTMLCanvasElement.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (264333 => 264334)


--- trunk/Source/WebCore/ChangeLog	2020-07-14 07:12:04 UTC (rev 264333)
+++ trunk/Source/WebCore/ChangeLog	2020-07-14 09:26:03 UTC (rev 264334)
@@ -1,3 +1,22 @@
+2020-07-14  Justin Fan  <justin_...@apple.com>
+
+        [WebGL] REGRESSION (r262366): Google search photos do not render, black images
+        https://bugs.webkit.org/show_bug.cgi?id=214156
+        <rdar://problem/64964922>
+
+        Reviewed by Dean Jackson.
+
+        http://trac.webkit.org/changeset/262366 separated WebGL canvas contents swapping and presentation
+        into two steps. This Google search page was only running the presentation code without the swapping
+        step, as it removes canvases from the observer Document before the Document is able to swap its canvas'
+        contents. Ensure that re-inserted canvas elements properly register their new Documents as observers.
+
+        Covered by existing tests.
+
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::insertedIntoAncestor): 
+        * html/HTMLCanvasElement.h:
+
 2020-07-14  Fujii Hironori  <hironori.fu...@sony.com>
 
         Unreviewed non-unified build fixes

Modified: trunk/Source/WebCore/html/HTMLCanvasElement.cpp (264333 => 264334)


--- trunk/Source/WebCore/html/HTMLCanvasElement.cpp	2020-07-14 07:12:04 UTC (rev 264333)
+++ trunk/Source/WebCore/html/HTMLCanvasElement.cpp	2020-07-14 09:26:03 UTC (rev 264334)
@@ -1008,6 +1008,14 @@
     HTMLElement::didMoveToNewDocument(oldDocument, newDocument);
 }
 
+Node::InsertedIntoAncestorResult HTMLCanvasElement::insertedIntoAncestor(InsertionType insertionType, ContainerNode& parentOfInsertedTree)
+{
+    if (insertionType.connectedToDocument)
+        addObserver(parentOfInsertedTree.document());
+
+    return HTMLElement::insertedIntoAncestor(insertionType, parentOfInsertedTree);
+}
+
 void HTMLCanvasElement::removedFromAncestor(RemovalType removalType, ContainerNode& oldParentOfRemovedTree)
 {
     if (removalType.disconnectedFromDocument) {

Modified: trunk/Source/WebCore/html/HTMLCanvasElement.h (264333 => 264334)


--- trunk/Source/WebCore/html/HTMLCanvasElement.h	2020-07-14 07:12:04 UTC (rev 264333)
+++ trunk/Source/WebCore/html/HTMLCanvasElement.h	2020-07-14 09:26:03 UTC (rev 264334)
@@ -169,6 +169,7 @@
     ScriptExecutionContext* canvasBaseScriptExecutionContext() const final { return HTMLElement::scriptExecutionContext(); }
 
     void didMoveToNewDocument(Document& oldDocument, Document& newDocument) final;
+    Node::InsertedIntoAncestorResult insertedIntoAncestor(InsertionType, ContainerNode&) final;
     void removedFromAncestor(RemovalType, ContainerNode& oldParentOfRemovedTree) final;
 
     FloatRect m_dirtyRect;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to