Bug 40573 - Don't constantly recalculate style unnecessarily if JavaScript is not enabled
Summary: Don't constantly recalculate style unnecessarily if JavaScript is not enabled
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-14 08:31 PDT by Adam Treat
Modified: 2010-06-14 11:34 PDT (History)
3 users (show)

See Also:


Attachments
Just for comments please (2.99 KB, patch)
2010-06-14 08:40 PDT, Adam Treat
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Treat 2010-06-14 08:31:04 PDT
Because WebKit continues parsing before it loads stylesheets WebKit tries to recalculate styles and run layouts whenever it processes a style sheet.  This is only necessary so that JavaScript gets correct answers during load.  When JavaScript is not enabled this is unnecessary overhead.
Comment 1 Adam Treat 2010-06-14 08:40:51 PDT
Created attachment 58658 [details]
Just for comments please

We think this approach is correct, but would like feedback from page loading gurus.
Comment 2 Alexey Proskuryakov 2010-06-14 11:34:51 PDT
I think display:none has many effects that go beyond providing incorrect answers to JavaScript. But I don't have a specific example that would make this idea implausible.

> WebKit tries to recalculate styles and run layouts whenever it processes a style sheet.  

I'm not sure if that's entirely accurate. Why would one need to force layout with document.body.offsetTop if that were so?