Title: [201752] trunk
Revision
201752
Author
commit-qu...@webkit.org
Date
2016-06-07 08:03:40 -0700 (Tue, 07 Jun 2016)

Log Message

Video elements are painted twice, in PaintPhaseForeground and PaintPhaseSelfOutline
https://bugs.webkit.org/show_bug.cgi?id=158247

Patch by Fujii Hironori <hironori.fu...@sony.com> on 2016-06-07
Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/replaced/outline-replaced-elements-offset.html

In <http://trac.webkit.org/changeset/105247>,
RenderReplaced::paint was changed to call
RenderReplaced::paintReplaced in PaintPhaseOutline and
PaintPhaseSelfOutline to paint outline of SVG.

As the result, RenderVideo::paintReplaced paints twice,
in forground and outline phase.

It was changed to paint outline of SVG in PaintPhaseForeground
since <http://trac.webkit.org/changeset/168645>.  No need to call
RenderReplaced::paintReplaced in outline phases anymore.

* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint): Return early if
PaintPhaseOutline or PaintPhaseSelfOutline.
Return early unless PaintPhaseForeground nor PaintPhaseSelection,
even if canHaveChildren().

LayoutTests:

* fast/replaced/outline-replaced-elements-offset-expected.html: Added.
* fast/replaced/outline-replaced-elements-offset.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (201751 => 201752)


--- trunk/LayoutTests/ChangeLog	2016-06-07 14:32:24 UTC (rev 201751)
+++ trunk/LayoutTests/ChangeLog	2016-06-07 15:03:40 UTC (rev 201752)
@@ -1,3 +1,13 @@
+2016-06-07  Fujii Hironori  <hironori.fu...@sony.com>
+
+        Video elements are painted twice, in PaintPhaseForeground and PaintPhaseSelfOutline
+        https://bugs.webkit.org/show_bug.cgi?id=158247
+
+        Reviewed by Simon Fraser.
+
+        * fast/replaced/outline-replaced-elements-offset-expected.html: Added.
+        * fast/replaced/outline-replaced-elements-offset.html: Added.
+
 2016-06-07  Michael Catanzaro  <mcatanz...@igalia.com>
 
         [GTK] Mark fast/text/international/system-language/han-quotes.html as flaky

Added: trunk/LayoutTests/fast/replaced/outline-replaced-elements-offset-expected.html (0 => 201752)


--- trunk/LayoutTests/fast/replaced/outline-replaced-elements-offset-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/replaced/outline-replaced-elements-offset-expected.html	2016-06-07 15:03:40 UTC (rev 201752)
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<style>
+  .group {
+    float: left; width: 180px;
+  }
+
+  div.item {
+    margin: 10px 0 20px 10px;
+    outline: 4px solid black;
+    outline-offset: -10px;
+    background-color: blue;
+    display: block;
+    height: 100px;
+    width: 100px;
+  }
+</style>
+
+<body>
+All the replaced elements below should have a solid black inset outline.<p>
+
+<div class="group">
+ &lt;video&gt;
+  <div class="item"></div>
+ &lt;canvas&gt;
+  <div class="item"></div>
+ &lt;media&gt;
+  <div class="item"></div>
+</div>
+
+<div class="group">
+ &lt;iframe&gt;
+  <div class="item"></div>
+ &lt;object&gt;
+  <div class="item"></div>
+</div>
+
+<div class="group">
+ &lt;input type=image&gt;
+  <div class="item"></div>
+ &lt;img&gt;
+  <div class="item"></div>
+</div>
+
+</body>

Added: trunk/LayoutTests/fast/replaced/outline-replaced-elements-offset.html (0 => 201752)


--- trunk/LayoutTests/fast/replaced/outline-replaced-elements-offset.html	                        (rev 0)
+++ trunk/LayoutTests/fast/replaced/outline-replaced-elements-offset.html	2016-06-07 15:03:40 UTC (rev 201752)
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<style>
+  .group {
+    float: left; width: 180px;
+  }
+
+  iframe, object, img, input[type="image"], canvas, media, video {
+    margin: 10px 0 20px 10px;
+    outline: 4px solid black;
+    outline-offset: -10px;
+    border: none;
+    border-radius: 0;
+    background-color: blue;
+    display: block;
+    height: 100px;
+    width: 100px;
+  }
+</style>
+
+<body>
+All the replaced elements below should have a solid black inset outline.<p>
+
+<div class="group">
+ &lt;video&gt;
+  <video poster="resources/square-blue-100x100.png"></video>
+ &lt;canvas&gt;
+  <canvas src="" day maybe"></canvas>
+ &lt;media&gt;
+  <media src=""
+</div>
+
+<div class="group">
+ &lt;iframe&gt;
+  <iframe src=""
+ &lt;object&gt;
+  <object src=""
+</div>
+
+<div class="group">
+ &lt;input type=image&gt;
+  <input type="image" src=""
+ &lt;img&gt;
+  <img src=""
+</div>
+
+</body>

Modified: trunk/Source/WebCore/ChangeLog (201751 => 201752)


--- trunk/Source/WebCore/ChangeLog	2016-06-07 14:32:24 UTC (rev 201751)
+++ trunk/Source/WebCore/ChangeLog	2016-06-07 15:03:40 UTC (rev 201752)
@@ -1,3 +1,30 @@
+2016-06-07  Fujii Hironori  <hironori.fu...@sony.com>
+
+        Video elements are painted twice, in PaintPhaseForeground and PaintPhaseSelfOutline
+        https://bugs.webkit.org/show_bug.cgi?id=158247
+
+        Reviewed by Simon Fraser.
+
+        Test: fast/replaced/outline-replaced-elements-offset.html
+
+        In <http://trac.webkit.org/changeset/105247>,
+        RenderReplaced::paint was changed to call
+        RenderReplaced::paintReplaced in PaintPhaseOutline and
+        PaintPhaseSelfOutline to paint outline of SVG.
+
+        As the result, RenderVideo::paintReplaced paints twice,
+        in forground and outline phase.
+
+        It was changed to paint outline of SVG in PaintPhaseForeground
+        since <http://trac.webkit.org/changeset/168645>.  No need to call
+        RenderReplaced::paintReplaced in outline phases anymore.
+
+        * rendering/RenderReplaced.cpp:
+        (WebCore::RenderReplaced::paint): Return early if
+        PaintPhaseOutline or PaintPhaseSelfOutline.
+        Return early unless PaintPhaseForeground nor PaintPhaseSelection,
+        even if canHaveChildren().
+
 2016-06-07  Nael Ouedraogo  <nael.ouedra...@crf.canon.fr>
 
         Creating a TouchList with non Touch items should throw an exception

Modified: trunk/Source/WebCore/rendering/RenderReplaced.cpp (201751 => 201752)


--- trunk/Source/WebCore/rendering/RenderReplaced.cpp	2016-06-07 14:32:24 UTC (rev 201751)
+++ trunk/Source/WebCore/rendering/RenderReplaced.cpp	2016-06-07 15:03:40 UTC (rev 201752)
@@ -154,11 +154,14 @@
     }
 
     LayoutRect paintRect = LayoutRect(adjustedPaintOffset, size());
-    if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style().outlineWidth())
-        paintOutline(paintInfo, paintRect);
-    
-    if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection && !canHaveChildren())
+    if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) {
+        if (style().outlineWidth())
+            paintOutline(paintInfo, paintRect);
         return;
+    }
+
+    if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection)
+        return;
     
     if (!paintInfo.shouldPaintWithinRoot(*this))
         return;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to