RESOLVED FIXED Bug 163353
Share inline stylesheets between shadow trees
https://bugs.webkit.org/show_bug.cgi?id=163353
Summary Share inline stylesheets between shadow trees
Antti Koivisto
Reported 2016-10-12 13:45:12 PDT
If shadow trees have identical inline stylesheets the data structures can be shared. This will also allow sharing style resolvers in future.
Attachments
patch (8.72 KB, patch)
2016-10-12 13:48 PDT, Antti Koivisto
rniwa: review+
kling: commit-queue-
patch (14.54 KB, patch)
2016-10-14 04:16 PDT, Antti Koivisto
buildbot: commit-queue-
Archive of layout-test-results from ews105 for mac-yosemite-wk2 (1.12 MB, application/zip)
2016-10-14 04:42 PDT, Build Bot
no flags
Archive of layout-test-results from ews113 for mac-yosemite (742.03 KB, application/zip)
2016-10-14 05:09 PDT, Build Bot
no flags
Archive of layout-test-results from ews123 for ios-simulator-wk2 (6.81 MB, application/zip)
2016-10-14 05:10 PDT, Build Bot
no flags
Archive of layout-test-results from ews103 for mac-yosemite (727.35 KB, application/zip)
2016-10-14 05:29 PDT, Build Bot
no flags
patch (15.10 KB, patch)
2016-10-14 05:44 PDT, Antti Koivisto
buildbot: commit-queue-
Archive of layout-test-results from ews112 for mac-yosemite (1.62 MB, application/zip)
2016-10-14 06:15 PDT, Build Bot
no flags
Archive of layout-test-results from ews101 for mac-yosemite (690.24 KB, application/zip)
2016-10-14 06:27 PDT, Build Bot
no flags
Archive of layout-test-results from ews105 for mac-yosemite-wk2 (835.23 KB, application/zip)
2016-10-14 06:30 PDT, Build Bot
no flags
Archive of layout-test-results from ews123 for ios-simulator-wk2 (6.73 MB, application/zip)
2016-10-14 06:40 PDT, Build Bot
no flags
patch (15.11 KB, patch)
2016-10-14 06:44 PDT, Antti Koivisto
no flags
Antti Koivisto
Comment 1 2016-10-12 13:48:54 PDT
Andreas Kling
Comment 2 2016-10-12 13:54:18 PDT
Comment on attachment 291390 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=291390&action=review > Source/WebCore/dom/InlineStyleSheetOwner.cpp:192 > + fprintf(stderr, "retrieved inline stylesheet from cache, rules=%d\n", cachedSheet->ruleCount()); Well I suppose that's good to know about... > Source/WebCore/dom/InlineStyleSheetOwner.cpp:209 > + fprintf(stderr, "adding stylesheet to cache, rules=%d\n", m_sheet->contents().ruleCount()); More great information! > Source/WebCore/platform/MemoryPressureHandler.cpp:111 > + { > + ReliefLogger log("Clear inline stylesheet cache"); > + InlineStyleSheetOwner::clearCache(); > + } r=me based on this.
Ryosuke Niwa
Comment 3 2016-10-12 13:57:03 PDT
Comment on attachment 291390 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=291390&action=review > Source/WebCore/css/parser/CSSParserMode.h:126 > + hash ^= URLHash::hash(key.baseURL); > + hash ^= StringHash::hash(key.charset); > + hash ^= WTF::intHash(static_cast<unsigned>(key.mode)); Is there a better way to combine hash? > Source/WebCore/dom/InlineStyleSheetOwner.cpp:192 > + fprintf(stderr, "retrieved inline stylesheet from cache, rules=%d\n", cachedSheet->ruleCount()); Debugging code? > Source/WebCore/dom/InlineStyleSheetOwner.cpp:209 > + fprintf(stderr, "adding stylesheet to cache, rules=%d\n", m_sheet->contents().ruleCount()); Debugging code?
Ryosuke Niwa
Comment 4 2016-10-12 13:57:29 PDT
Comment on attachment 291390 [details] patch Oops, sorry, didn't mean to clear the r+.
Antti Koivisto
Comment 5 2016-10-13 05:02:56 PDT
Darin Adler
Comment 6 2016-10-13 09:57:09 PDT
Comment on attachment 291390 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=291390&action=review >> Source/WebCore/css/parser/CSSParserMode.h:126 >> + hash ^= WTF::intHash(static_cast<unsigned>(key.mode)); > > Is there a better way to combine hash? Longer term, the better way to hash a bunch of things is to construct a single hasher and then hash one item after another. Doing an exclusive or of hashes is nowhere near as a good as that. To make then hashes better in cases like this one I would like us to make a hasher class that is perhaps a bit like StringBuilder and lets us easily hash a sequence of different types of data and make a single hash out of all of it. Presumably we want to usually avoid both the "exclusive or'd hashes" pattern and even the "hash of hashes" pattern.
Ryan Haddad
Comment 7 2016-10-13 10:28:05 PDT
Reverted r207286 for reason: Caused LayoutTest http/tests/misc/acid3.html to fail. Committed r207291: <http://trac.webkit.org/changeset/207291>
Ryan Haddad
Comment 8 2016-10-13 10:29:01 PDT
*** Bug 163391 has been marked as a duplicate of this bug. ***
Ryan Haddad
Comment 9 2016-10-13 10:29:35 PDT
(In reply to comment #7) > Reverted r207286 for reason: > > Caused LayoutTest http/tests/misc/acid3.html to fail. > > Committed r207291: <http://trac.webkit.org/changeset/207291> Details in https://bugs.webkit.org/show_bug.cgi?id=163391
Antti Koivisto
Comment 10 2016-10-14 04:16:35 PDT
Build Bot
Comment 11 2016-10-14 04:42:48 PDT
Comment on attachment 291612 [details] patch Attachment 291612 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/2283784 Number of test failures exceeded the failure limit.
Build Bot
Comment 12 2016-10-14 04:42:51 PDT
Created attachment 291617 [details] Archive of layout-test-results from ews105 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Build Bot
Comment 13 2016-10-14 05:09:11 PDT
Comment on attachment 291612 [details] patch Attachment 291612 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/2283857 Number of test failures exceeded the failure limit.
Build Bot
Comment 14 2016-10-14 05:09:14 PDT
Created attachment 291619 [details] Archive of layout-test-results from ews113 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews113 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 15 2016-10-14 05:10:30 PDT
Comment on attachment 291612 [details] patch Attachment 291612 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/2283893 Number of test failures exceeded the failure limit.
Build Bot
Comment 16 2016-10-14 05:10:33 PDT
Created attachment 291620 [details] Archive of layout-test-results from ews123 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews123 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.6
Build Bot
Comment 17 2016-10-14 05:29:25 PDT
Comment on attachment 291612 [details] patch Attachment 291612 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/2284000 Number of test failures exceeded the failure limit.
Build Bot
Comment 18 2016-10-14 05:29:28 PDT
Created attachment 291622 [details] Archive of layout-test-results from ews103 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews103 Port: mac-yosemite Platform: Mac OS X 10.10.5
Antti Koivisto
Comment 19 2016-10-14 05:44:10 PDT
Build Bot
Comment 20 2016-10-14 06:15:51 PDT
Comment on attachment 291623 [details] patch Attachment 291623 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/2284225 Number of test failures exceeded the failure limit.
Build Bot
Comment 21 2016-10-14 06:15:54 PDT
Created attachment 291626 [details] Archive of layout-test-results from ews112 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews112 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 22 2016-10-14 06:27:52 PDT
Comment on attachment 291623 [details] patch Attachment 291623 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/2284266 Number of test failures exceeded the failure limit.
Build Bot
Comment 23 2016-10-14 06:27:56 PDT
Created attachment 291628 [details] Archive of layout-test-results from ews101 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 24 2016-10-14 06:30:02 PDT
Comment on attachment 291623 [details] patch Attachment 291623 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/2284269 Number of test failures exceeded the failure limit.
Build Bot
Comment 25 2016-10-14 06:30:05 PDT
Created attachment 291629 [details] Archive of layout-test-results from ews105 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Build Bot
Comment 26 2016-10-14 06:40:19 PDT
Comment on attachment 291623 [details] patch Attachment 291623 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/2284275 Number of test failures exceeded the failure limit.
Build Bot
Comment 27 2016-10-14 06:40:23 PDT
Created attachment 291630 [details] Archive of layout-test-results from ews123 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews123 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.6
Antti Koivisto
Comment 28 2016-10-14 06:44:51 PDT
Antti Koivisto
Comment 29 2016-10-14 08:42:40 PDT
Note You need to log in before you can comment on or make changes to this bug.