RESOLVED FIXED 153051
Mixing Content Blocking of fonts and display:none rules causes battery drain
https://bugs.webkit.org/show_bug.cgi?id=153051
Summary Mixing Content Blocking of fonts and display:none rules causes battery drain
Myles C. Maxfield
Reported 2016-01-12 17:52:50 PST
Mixing Content Blocking of fonts and display:none rules causes battery drain
Attachments
Patch (24.86 KB, patch)
2016-01-12 18:40 PST, Myles C. Maxfield
no flags
Archive of layout-test-results from ews100 for mac-yosemite (734.17 KB, application/zip)
2016-01-12 19:28 PST, Build Bot
no flags
Archive of layout-test-results from ews107 for mac-yosemite-wk2 (739.25 KB, application/zip)
2016-01-12 19:33 PST, Build Bot
no flags
Archive of layout-test-results from ews114 for mac-yosemite (804.48 KB, application/zip)
2016-01-12 19:36 PST, Build Bot
no flags
Patch (25.91 KB, patch)
2016-01-12 19:38 PST, Myles C. Maxfield
mmaxfield: review-
Patch (8.82 KB, patch)
2016-01-14 17:18 PST, Myles C. Maxfield
achristensen: review+
Myles C. Maxfield
Comment 1 2016-01-12 18:40:59 PST
Build Bot
Comment 2 2016-01-12 19:28:31 PST
Comment on attachment 268835 [details] Patch Attachment 268835 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/684709 New failing tests: http/tests/security/contentSecurityPolicy/user-style-sheet-font-crasher.html
Build Bot
Comment 3 2016-01-12 19:28:34 PST
Created attachment 268843 [details] Archive of layout-test-results from ews100 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 4 2016-01-12 19:33:05 PST
Comment on attachment 268835 [details] Patch Attachment 268835 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/684713 New failing tests: http/tests/security/contentSecurityPolicy/user-style-sheet-font-crasher.html
Build Bot
Comment 5 2016-01-12 19:33:07 PST
Created attachment 268845 [details] Archive of layout-test-results from ews107 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Build Bot
Comment 6 2016-01-12 19:36:51 PST
Comment on attachment 268835 [details] Patch Attachment 268835 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/684705 New failing tests: http/tests/security/contentSecurityPolicy/user-style-sheet-font-crasher.html
Build Bot
Comment 7 2016-01-12 19:36:53 PST
Created attachment 268847 [details] Archive of layout-test-results from ews114 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-yosemite Platform: Mac OS X 10.10.5
Myles C. Maxfield
Comment 8 2016-01-12 19:38:58 PST
Myles C. Maxfield
Comment 9 2016-01-12 20:39:39 PST
Myles C. Maxfield
Comment 10 2016-01-14 12:00:13 PST
Yeah; it's as I suspected; this patch doesn't actually fix the bug. Any time you clear the style resolver, a layout will occur, which means the font will be used again, which means we will go through content blockers, which means we may clear the style resolver again.
Myles C. Maxfield
Comment 11 2016-01-14 12:02:36 PST
(In reply to comment #10) > Yeah; it's as I suspected; this patch doesn't actually fix the bug. Any time > you clear the style resolver, a layout will occur, which means the font will > be used again, which means we will go through content blockers, which means > we may clear the style resolver again. It looks like I'll need some bit of state saying "this font was blocked; don't try again." However, this means that I'll need some way of knowing when content blocker rules change (to clear the state).
Myles C. Maxfield
Comment 12 2016-01-14 12:04:40 PST
(In reply to comment #11) > (In reply to comment #10) > > Yeah; it's as I suspected; this patch doesn't actually fix the bug. Any time > > you clear the style resolver, a layout will occur, which means the font will > > be used again, which means we will go through content blockers, which means > > we may clear the style resolver again. > > It looks like I'll need some bit of state saying "this font was blocked; > don't try again." However, this means that I'll need some way of knowing > when content blocker rules change (to clear the state). Maybe the key here is that layout triggers the download, rather than setting a src attribute or something like that (for an image).
Myles C. Maxfield
Comment 13 2016-01-14 17:18:00 PST
Alex Christensen
Comment 14 2016-01-14 17:48:09 PST
Comment on attachment 269021 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=269021&action=review > Source/WebCore/ChangeLog:8 > + If we have applied a rule before, don't apply it again (thereby avoiding a relayout). If we have applied a rule before and we are not applying it again, don't resolve the style again. The problem wasn't that we were applying it again, the problem was that we were doing another style resolution when we weren't changing anything, which often led to infinite loops.
Myles C. Maxfield
Comment 15 2016-01-14 19:32:10 PST
Myles C. Maxfield
Comment 16 2016-01-14 21:49:32 PST
Myles C. Maxfield
Comment 17 2016-01-15 17:55:18 PST
Note You need to log in before you can comment on or make changes to this bug.