Bug 119475 - Inserting a rule into an empty style sheet shouldn't trigger style recalc unless necessary.
Summary: Inserting a rule into an empty style sheet shouldn't trigger style recalc unl...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords: InRadar, Performance
Depends on:
Blocks:
 
Reported: 2013-08-04 00:28 PDT by Andreas Kling
Modified: 2013-08-04 08:56 PDT (History)
11 users (show)

See Also:


Attachments
Patch idea (4.79 KB, patch)
2013-08-04 00:31 PDT, Andreas Kling
koivisto: review+
Details | Formatted Diff | Diff
Crazier patch idea (8.14 KB, patch)
2013-08-04 03:26 PDT, Andreas Kling
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-05 for mac-mountainlion (1.23 MB, application/zip)
2013-08-04 05:56 PDT, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-06 for mac-mountainlion (1.22 MB, application/zip)
2013-08-04 06:54 PDT, Build Bot
no flags Details
Slightly less crazy patch idea (15.05 KB, patch)
2013-08-04 07:39 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff
Wider patch idea (15.38 KB, patch)
2013-08-04 07:43 PDT, Andreas Kling
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2013-08-04 00:28:28 PDT
Inserting a rule into an empty style sheet shouldn't trigger style recalc.
Comment 1 Radar WebKit Bug Importer 2013-08-04 00:28:39 PDT
<rdar://problem/14643481>
Comment 2 Andreas Kling 2013-08-04 00:31:37 PDT
Created attachment 208080 [details]
Patch idea
Comment 3 Andreas Kling 2013-08-04 03:26:34 PDT
Created attachment 208085 [details]
Crazier patch idea

Another approach. This one supports multiple insertions.
Comment 4 Andreas Kling 2013-08-04 03:55:40 PDT
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 5 Build Bot 2013-08-04 05:56:03 PDT
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
Comment 6 Build Bot 2013-08-04 05:56:05 PDT
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 7 Build Bot 2013-08-04 06:54:34 PDT
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
Comment 8 Build Bot 2013-08-04 06:54:37 PDT
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
Comment 9 Andreas Kling 2013-08-04 07:39:41 PDT
Created attachment 208091 [details]
Slightly less crazy patch idea
Comment 10 Andreas Kling 2013-08-04 07:43:31 PDT
Created attachment 208092 [details]
Wider patch idea
Comment 11 Antti Koivisto 2013-08-04 08:32:51 PDT
Comment on attachment 208092 [details]
Wider patch idea

Nice. r=me
Comment 12 Antti Koivisto 2013-08-04 08:41:32 PDT
Comment on attachment 208080 [details]
Patch idea

Might be good to land the simple version first
Comment 13 Andreas Kling 2013-08-04 08:56:19 PDT
Committed r153699: <http://trac.webkit.org/changeset/153699>