Chromium Code Reviews
DescriptionMHTML saving optimization: don't generate CSS code that will be discarded.
FrameSerializer::serializeCSSStyleSheet code was generating CSS code for
all style elements in a frame even if they were already included in the
main HTML body generation executed earlier on in
FrameSerializer::serializeFrame. This generated code was simply
discarded later on.
This change detects early on if generating the CSS code will be really needed
and skips it if not. Also, when the CSS can be uniquely identified by its URL
and that URL was already analyzed before the method simply returns.
Tests on a Samsung Galaxy J1 loading a CSS-heavy web page [1] showed roughly
40% less CSS code generated and 20% less accumulative time taken from all
render processes' main threads for the whole save operation.
[1] http://www.creativebloq.com/web-design/examples-css-912710
BUG=651525
Review-Url: https://codereview.chromium.org/2397983002
Cr-Commit-Position: refs/heads/master@{#424032}
(cherry picked from commit f72e2c5e69ca7a44db46622e96f2eaab2849d70a)
Committed: https://chromium.googlesource.com/chromium/src/+/5453db5beff03a09ad40a2b704dd4b40b8273015
Patch Set 1 #
Messages
Total messages: 2 (1 generated)
|
|||||||||||||||||||