Title: [171702] trunk/Source/WebCore
Revision
171702
Author
an...@apple.com
Date
2014-07-28 15:18:12 -0700 (Mon, 28 Jul 2014)

Log Message

<embed> videos flashes constantly while playing inline on iPad, making it unwatchable
https://bugs.webkit.org/show_bug.cgi?id=135356
<rdar://problem/16828238>

Reviewed by Simon Fraser.
        
The shadow tree for media controls is scheduling style recalc. The general silliness of
HTMLPlugInImageElement::willRecalcStyle/willDetachRenderers is turning those into render
tree reconstructions causing flicker.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::willRecalcStyle):
        
    Don't do the forced renderer reconstruction if there is no style change for the element
    or its ancestors. This way recalcs scheduled by the shadow tree don't trigger the widget
    update code path.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (171701 => 171702)


--- trunk/Source/WebCore/ChangeLog	2014-07-28 21:58:42 UTC (rev 171701)
+++ trunk/Source/WebCore/ChangeLog	2014-07-28 22:18:12 UTC (rev 171702)
@@ -1,3 +1,22 @@
+2014-07-28  Antti Koivisto  <an...@apple.com>
+
+        <embed> videos flashes constantly while playing inline on iPad, making it unwatchable
+        https://bugs.webkit.org/show_bug.cgi?id=135356
+        <rdar://problem/16828238>
+
+        Reviewed by Simon Fraser.
+        
+        The shadow tree for media controls is scheduling style recalc. The general silliness of
+        HTMLPlugInImageElement::willRecalcStyle/willDetachRenderers is turning those into render
+        tree reconstructions causing flicker.
+
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::willRecalcStyle):
+        
+            Don't do the forced renderer reconstruction if there is no style change for the element
+            or its ancestors. This way recalcs scheduled by the shadow tree don't trigger the widget
+            update code path.
+
 2014-07-27  Brent Fulgham  <bfulg...@apple.com>
 
         [Mac, iOS] Paint-on closed captions get out-of-order in Safari

Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp (171701 => 171702)


--- trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp	2014-07-28 21:58:42 UTC (rev 171701)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp	2014-07-28 22:18:12 UTC (rev 171702)
@@ -223,8 +223,12 @@
     return HTMLPlugInElement::createElementRenderer(WTF::move(style));
 }
 
-bool HTMLPlugInImageElement::willRecalcStyle(Style::Change)
+bool HTMLPlugInImageElement::willRecalcStyle(Style::Change change)
 {
+    // Make sure style recalcs scheduled by a child shadow tree don't trigger reconstruction and cause flicker.
+    if (change == Style::NoChange && styleChangeType() == NoStyleChange)
+        return true;
+
     // FIXME: There shoudn't be need to force render tree reconstruction here.
     // It is only done because loading and load event dispatching is tied to render tree construction.
     if (!useFallbackContent() && needsWidgetUpdate() && renderer() && !isImageType() && (displayState() != DisplayingSnapshot))
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to