Bug 158247 - Video elements are painted twice, in PaintPhaseForeground and PaintPhaseSelfOutline
Summary: Video elements are painted twice, in PaintPhaseForeground and PaintPhaseSelfO...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-31 19:36 PDT by Fujii Hironori
Modified: 2016-06-07 08:02 PDT (History)
12 users (show)

See Also:


Attachments
Patch (2.50 KB, patch)
2016-06-01 02:51 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (5.82 KB, patch)
2016-06-06 22:35 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff
outline-replaced-elements-offset-actual.png before fixing (14.36 KB, image/png)
2016-06-06 22:46 PDT, Fujii Hironori
no flags Details
Archive of layout-test-results from ews122 for ios-simulator-wk2 (757.74 KB, application/zip)
2016-06-06 23:40 PDT, Build Bot
no flags Details
Patch (5.84 KB, patch)
2016-06-07 00:04 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2016-05-31 19:36:48 PDT
Video elements are painted twice, in PaintPhaseForeground and PaintPhaseSelfOutline

In r105247 <http://trac.webkit.org/changeset/105247>, a following change has been made.
http://trac.webkit.org/changeset/105247/trunk/Source/WebCore/rendering/RenderReplaced.cpp

> Index: trunk/Source/WebCore/rendering/RenderReplaced.cpp
> ===================================================================
> --- a/trunk/Source/WebCore/rendering/RenderReplaced.cpp
> +++ b/trunk/Source/WebCore/rendering/RenderReplaced.cpp
> @@ -123,5 +123,5 @@
>          paintOutline(paintInfo.context, paintRect);
>      
> -    if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection)
> +    if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection && !canHaveChildren())
>          return;

Before this change, it was ensured paintReplaced is called only in PaintPhaseForeground and PaintPhaseSelection.
After this change, paintReplaced is called even in PaintPhaseSelfOutline if canHaveChildren().
Comment 1 Fujii Hironori 2016-05-31 23:15:22 PDT
Blink:

Issue 485644 - chromium - Outline of replaced object is painted twice

Issue: http://crbug.com/485644
Review: https://codereview.chromium.org/1129973003
Commit: https://src.chromium.org/viewvc/blink?revision=195140&view=revision
Comment 2 Fujii Hironori 2016-06-01 02:51:41 PDT
Created attachment 280227 [details]
Patch
Comment 3 Simon Fraser (smfr) 2016-06-06 10:46:15 PDT
You should be able to detect the double-painting by using border or background with alpha in a ref test, right?
Comment 4 Fujii Hironori 2016-06-06 22:35:36 PDT
Created attachment 280671 [details]
Patch

Thank you for review. I added a test case.
Comment 5 Fujii Hironori 2016-06-06 22:46:50 PDT
Created attachment 280675 [details]
outline-replaced-elements-offset-actual.png before fixing

All outline has a negatie offset in this test case.
All outline should be painted on a element.
But, only video element's outline was hidden by the poster image.
Comment 6 Build Bot 2016-06-06 23:40:49 PDT
Comment on attachment 280671 [details]
Patch

Attachment 280671 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1456670

New failing tests:
fast/replaced/outline-replaced-elements-offset.html
Comment 7 Build Bot 2016-06-06 23:40:53 PDT
Created attachment 280680 [details]
Archive of layout-test-results from ews122 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.4
Comment 8 Fujii Hironori 2016-06-07 00:04:59 PDT
Created attachment 280681 [details]
Patch
Comment 9 WebKit Commit Bot 2016-06-07 08:02:13 PDT
Comment on attachment 280681 [details]
Patch

Clearing flags on attachment: 280681

Committed r201752: <http://trac.webkit.org/changeset/201752>
Comment 10 WebKit Commit Bot 2016-06-07 08:02:22 PDT
All reviewed patches have been landed.  Closing bug.