Inserting a rule into an empty style sheet shouldn't trigger style recalc.
<rdar://problem/14643481>
Created attachment 208080 [details] Patch idea
Created attachment 208085 [details] Crazier patch idea Another approach. This one supports multiple insertions.
Comment on attachment 208085 [details] Crazier patch idea Actually, this is not quite correct. The existing invalidation analysis would not detect insertion into a non-empty active sheet, and fail to trigger recalc in that case.
Comment on attachment 208085 [details] Crazier patch idea Attachment 208085 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/1342794 New failing tests: media/track/track-css-user-override.html inspector/styles/undo-add-new-rule.html http/tests/css/shared-stylesheet-mutation.html http/tests/misc/acid3.html inspector/styles/styles-add-new-rule.html css3/filters/custom/custom-filter-property-computed-style.html fast/shapes/shape-inside/shape-inside-simple-polygon-001.html fast/shapes/shape-inside/shape-inside-regular-polygon16.html fast/shapes/shape-inside/shape-inside-outside-shape.html http/tests/css/shared-stylesheet-mutation-preconstruct.html fast/shapes/shape-inside/shape-inside-simple-polygon-003.html css3/filters/filter-property-computed-style.html fast/css/pseudo-valid-dynamic.html fast/shapes/shape-inside/shape-inside-regular-polygon8.html fast/media/mq-pixel-ratio-print.html fast/shapes/shape-inside/shape-inside-simple-polygon-004.html fast/shapes/shape-inside/shape-inside-simple-polygon-002.html
Created attachment 208089 [details] Archive of layout-test-results from webkit-ews-05 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-05 Port: mac-mountainlion Platform: Mac OS X 10.8.4
Comment on attachment 208085 [details] Crazier patch idea Attachment 208085 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/1333761 New failing tests: media/track/track-css-user-override.html inspector/styles/undo-add-new-rule.html http/tests/css/shared-stylesheet-mutation.html http/tests/misc/acid3.html inspector/styles/styles-add-new-rule.html css3/filters/custom/custom-filter-property-computed-style.html fast/shapes/shape-inside/shape-inside-simple-polygon-001.html fast/shapes/shape-inside/shape-inside-regular-polygon16.html fast/shapes/shape-inside/shape-inside-outside-shape.html http/tests/css/shared-stylesheet-mutation-preconstruct.html fast/shapes/shape-inside/shape-inside-simple-polygon-003.html css3/filters/filter-property-computed-style.html fast/css/pseudo-valid-dynamic.html fast/shapes/shape-inside/shape-inside-regular-polygon8.html fast/media/mq-pixel-ratio-print.html fast/shapes/shape-inside/shape-inside-simple-polygon-004.html fast/shapes/shape-inside/shape-inside-simple-polygon-002.html
Created attachment 208090 [details] Archive of layout-test-results from webkit-ews-06 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-06 Port: mac-mountainlion Platform: Mac OS X 10.8.4
Created attachment 208091 [details] Slightly less crazy patch idea
Created attachment 208092 [details] Wider patch idea
Comment on attachment 208092 [details] Wider patch idea Nice. r=me
Comment on attachment 208080 [details] Patch idea Might be good to land the simple version first
Committed r153699: <http://trac.webkit.org/changeset/153699>