Bug 97013 - Add canvas to set of elements that do not allow style sharing in order to provoke RenderLayer creation
Summary: Add canvas to set of elements that do not allow style sharing in order to pro...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brian Salomon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-18 06:30 PDT by Brian Salomon
Modified: 2012-09-28 14:35 PDT (History)
15 users (show)

See Also:


Attachments
Patch (3.37 KB, patch)
2012-09-18 06:33 PDT, Brian Salomon
no flags Details | Formatted Diff | Diff
Patch (7.16 KB, patch)
2012-09-20 06:46 PDT, Brian Salomon
no flags Details | Formatted Diff | Diff
Patch (7.05 KB, patch)
2012-09-24 07:35 PDT, Brian Salomon
no flags Details | Formatted Diff | Diff
Patch (9.65 KB, patch)
2012-09-24 12:24 PDT, Brian Salomon
no flags Details | Formatted Diff | Diff
Adds test expectation for Mac (10.10 KB, patch)
2012-09-26 06:38 PDT, Brian Salomon
no flags Details | Formatted Diff | Diff
Change test expectations to expected to fail for mac and chromium (7.49 KB, patch)
2012-09-26 10:33 PDT, Brian Salomon
no flags Details | Formatted Diff | Diff
Patch (7.81 KB, patch)
2012-09-28 06:37 PDT, Brian Salomon
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Salomon 2012-09-18 06:30:43 PDT
Add canvas to set of elements that do not allow style sharing in order to provoke RenderLayer creation
Comment 1 Brian Salomon 2012-09-18 06:33:09 PDT
Created attachment 164545 [details]
Patch
Comment 2 Brian Salomon 2012-09-18 06:37:37 PDT
Related chromium bug: http://crbug.com/144686

James, does this seem like the correct approach to you?

I'm trying to figure out how this can be tested. I'm not sure if the original bug would reproduce in a layout test, though I'll try it.
Comment 3 Brian Salomon 2012-09-18 09:09:03 PDT
I seem unable to trigger the bug in a layout test.


I also wonder whether it would be a better (or even correct) fix to instead allow style sharing for iframes, plugins, and canvas and change setStyle to continue when the new/old style is the same object but skip the style diff computation and set diff = StyleDifferenceEqual.
Comment 4 James Robinson 2012-09-18 10:53:19 PDT
Comment on attachment 164545 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=164545&action=review

> Source/WebCore/rendering/RenderObject.cpp:1713
> +    // The answer to requiresLayer() for plugins, iframes, and canvas can change outside of the style system,

we do a setNeedsStyleRecalc(SyntheticStyleChange) in HTMLCanvasElement whenever the compositing status of a canvas changes, so I'm not sure that this comment change is accurate depending on what you mean by "outside of the style system"
Comment 5 James Robinson 2012-09-18 10:54:45 PDT
Bugfix seems pretty reasonable, but I think we want a layout test.  Does the test case in http://code.google.com/p/chromium/issues/detail?id=144686#c4 reproduce reliably?
Comment 6 Simon Fraser (smfr) 2012-09-18 10:56:37 PDT
You might be able to make a test similar to the iframe test (blame the changes that added iframes to the elements that disable sharing).
Comment 7 Brian Salomon 2012-09-18 12:10:01 PDT
James, it does repro reliably within Chromium but didn't when I ran it in DRT.

Simon, I will take a look. Thanks for the pointer.
Comment 8 Brian Salomon 2012-09-20 06:46:59 PDT
Created attachment 164909 [details]
Patch
Comment 9 Brian Salomon 2012-09-20 06:48:31 PDT
I was able to create a test that reproduces the bug without the code change (and works correctly with the code change).
Comment 10 Brian Salomon 2012-09-20 06:48:56 PDT
Comment on attachment 164545 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=164545&action=review

>> Source/WebCore/rendering/RenderObject.cpp:1713
>> +    // The answer to requiresLayer() for plugins, iframes, and canvas can change outside of the style system,
> 
> we do a setNeedsStyleRecalc(SyntheticStyleChange) in HTMLCanvasElement whenever the compositing status of a canvas changes, so I'm not sure that this comment change is accurate depending on what you mean by "outside of the style system"

Hopefully this is clearer in the new patch.
Comment 11 Simon Fraser (smfr) 2012-09-20 10:25:23 PDT
Comment on attachment 164909 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=164909&action=review

> LayoutTests/fast/canvas/canvas-render-layer.html:5
> +<head>
> +  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
> +</head>

You can remove this.

> LayoutTests/fast/canvas/canvas-render-layer.html:20
> +    if (window.testRunner) {
> +        testRunner.waitUntilDone();
> +    }

No need for braces.

> LayoutTests/fast/canvas/canvas-render-layer.html:27
> +        if (window.testRunner) {
> +            testRunner.display();
> +        }

Ditto. Note that display() doesn't always do the same thing on Mac and Chromium. If you're using it to force layer creation, that might not work on Mac synchronously. Can you make a test that doesn't use display()?
Comment 12 Brian Salomon 2012-09-24 07:35:30 PDT
Created attachment 165378 [details]
Patch
Comment 13 Brian Salomon 2012-09-24 07:37:41 PDT
Sorry for the slow cycle time; I was out of the office. It turns out the display() wasn't necessary at all.
Comment 14 Build Bot 2012-09-24 07:58:12 PDT
Comment on attachment 165378 [details]
Patch

Attachment 165378 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/13997610

New failing tests:
fast/canvas/canvas-render-layer.html
Comment 15 James Robinson 2012-09-24 10:48:17 PDT
Comment on attachment 165378 [details]
Patch

Could you add canvas-render-layer-expected.txt to this patch?  I think the tests will fail without it.
Comment 16 Brian Salomon 2012-09-24 12:24:24 PDT
Created attachment 165428 [details]
Patch
Comment 17 Brian Salomon 2012-09-24 12:28:12 PDT
(In reply to comment #15)
> (From update of attachment 165378 [details])
> Could you add canvas-render-layer-expected.txt to this patch?  I think the tests will fail without it.

Done in the latest patch. There are different expectations for the normal and virtual/gpu runs. The former should not create layers while the latter should.

At senorblanco's suggestion I had modified TestExpectations to mark the test as expected to fail, pending baselinig. But based on your request to add the canvas-render-layer-expected.txt file I'm wondering if that was actually incorrect.
Comment 18 Build Bot 2012-09-24 14:03:25 PDT
Comment on attachment 165428 [details]
Patch

Attachment 165428 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/13989793

New failing tests:
fast/canvas/canvas-render-layer.html
Comment 19 James Robinson 2012-09-24 17:10:10 PDT
Marking the test as failing in platform/chromium/TestExpectations won't help with the failure on the mac bot - you need to either add expectations that will apply to mac or mark it as failing for that platform.
Comment 20 Brian Salomon 2012-09-26 06:38:53 PDT
Created attachment 165784 [details]
Adds test expectation for Mac
Comment 21 WebKit Review Bot 2012-09-26 08:48:15 PDT
Comment on attachment 165784 [details]
Adds test expectation for Mac

Attachment 165784 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/14018571

New failing tests:
platform/chromium/virtual/gpu/fast/canvas/canvas-render-layer.html
fast/canvas/canvas-render-layer.html
Comment 22 Build Bot 2012-09-26 09:39:45 PDT
Comment on attachment 165784 [details]
Adds test expectation for Mac

Attachment 165784 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/13969061

New failing tests:
fast/canvas/canvas-render-layer.html
Comment 23 Brian Salomon 2012-09-26 10:33:42 PDT
Created attachment 165829 [details]
Change test expectations to expected to fail for mac and chromium
Comment 24 WebKit Review Bot 2012-09-26 10:39:06 PDT
Attachment 165829 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/fast..." exit_code: 1
WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky.
LayoutTests/platform/chromium/TestExpectations:972:  Test lacks BUG modifier.  [test/expectations] [5]
WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky.
WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky.
WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky.
WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky.
WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky.
WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky.
WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky.
WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky.
WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky.
WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky.
WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky.
WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky.
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 25 Eric Seidel (no email) 2012-09-26 10:43:33 PDT
Dirk: Do you know why the style bot is barfing like this?
Comment 26 Adam Barth 2012-09-26 10:46:32 PDT
(In reply to comment #25)
> Dirk: Do you know why the style bot is barfing like this?

If it keeps spamming like this, we need to turn off style checking for TestExpectation files.
Comment 27 Adam Barth 2012-09-26 10:53:03 PDT
I filed https://bugs.webkit.org/show_bug.cgi?id=97699 and attached a patch.
Comment 28 Brian Salomon 2012-09-26 12:04:04 PDT
Is it a known issue that the checker fails on pre-existing errors? E.g.:

LayoutTests/platform/chromium/TestExpectations:972:  Test lacks BUG modifier.  [test/expectations] [5]
Comment 29 Dirk Pranke 2012-09-26 12:09:30 PDT
(In reply to comment #28)
> Is it a known issue that the checker fails on pre-existing errors? E.g.:
> 
> LayoutTests/platform/chromium/TestExpectations:972:  Test lacks BUG modifier.  [test/expectations] [5]

I don't recall if this is known or not, so I think that makes it not known :). Feel free to file a bug; maybe something has regressed.
Comment 30 Brian Salomon 2012-09-26 12:31:13 PDT
(In reply to comment #29)
> (In reply to comment #28)
> > Is it a known issue that the checker fails on pre-existing errors? E.g.:
> > 
> > LayoutTests/platform/chromium/TestExpectations:972:  Test lacks BUG modifier.  [test/expectations] [5]
> 
> I don't recall if this is known or not, so I think that makes it not known :). Feel free to file a bug; maybe something has regressed.

Ok, I filed https://bugs.webkit.org/show_bug.cgi?id=97717
Comment 31 Brian Salomon 2012-09-27 06:54:26 PDT
Comment on attachment 165829 [details]
Change test expectations to expected to fail for mac and chromium

The latest patch passes the bots (leaving aside the bogus style complaint).
Comment 32 James Robinson 2012-09-27 18:06:34 PDT
Comment on attachment 165829 [details]
Change test expectations to expected to fail for mac and chromium

View in context: https://bugs.webkit.org/attachment.cgi?id=165829&action=review

> LayoutTests/fast/canvas/canvas-render-layer.html:34
> +            }, 5);

is there a particular reason these are 5ms delays instead of 0? typically we want tests to finish as quickly as possible
Comment 33 Brian Salomon 2012-09-28 06:37:18 PDT
Created attachment 166240 [details]
Patch
Comment 34 Brian Salomon 2012-09-28 06:39:02 PDT
(In reply to comment #32)
> (From update of attachment 165829 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=165829&action=review
> 
> > LayoutTests/fast/canvas/canvas-render-layer.html:34
> > +            }, 5);
> 
> is there a particular reason these are 5ms delays instead of 0? typically we want tests to finish as quickly as possible

I thought I had determined that this was necessary to repro the bug. That may have been true with an earlier version of the test, but it does repro with a zero timeout (as in the patch just uploaded).
Comment 35 WebKit Review Bot 2012-09-28 12:47:48 PDT
Comment on attachment 166240 [details]
Patch

Clearing flags on attachment: 166240

Committed r129934: <http://trac.webkit.org/changeset/129934>
Comment 36 WebKit Review Bot 2012-09-28 12:47:53 PDT
All reviewed patches have been landed.  Closing bug.
Comment 37 Ojan Vafai 2012-09-28 14:35:09 PDT
Filed bug 97940 for cleaning up the test and it's expectations.