New issue
Advanced search Search tips

Issue 801108 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Unnecessary active stylesheet update for style elements

Project Member Reported by futhark@chromium.org, Jan 11 2018

Issue description

We always create a MediaQuerySet for <style> elements. StyleEngine::MediaQueryAffectingValueChanged mark scopes for active stylesheet update when they contain stylesheets with MediaQuerySet non-null. We should not create a MediaQuerySet for all style elements, and we should not mark the stylesheet collection for active stylesheet update when the MediaQuerySet is empty.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0e466ff6c591b29e2e97bda6a5841f9180401781

commit 0e466ff6c591b29e2e97bda6a5841f9180401781
Author: Rune Lillesveen <futhark@chromium.org>
Date: Fri Jan 12 06:33:50 2018

Don't create MediaQuerySet for style elements without media.

Also, check if the MediaQuerySet contains anything before forcing an
active style update on media query affecting value changes. Always
creating a MediaQuerySet for style elements made us recollect active
stylesheets in every scope containing style elements. In particular, if
a media query in the document scope caused us to update active style in
the document scope, we also triggered an active stylesheet update in
all shadow scopes containing a style element.

Bug:  801108 
Change-Id: I06246b8c18507560c5d7c45b5a73ddd74f6dcb0f
Reviewed-on: https://chromium-review.googlesource.com/860925
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528893}
[modify] https://crrev.com/0e466ff6c591b29e2e97bda6a5841f9180401781/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
[modify] https://crrev.com/0e466ff6c591b29e2e97bda6a5841f9180401781/third_party/WebKit/Source/core/css/CSSStyleSheet.h
[modify] https://crrev.com/0e466ff6c591b29e2e97bda6a5841f9180401781/third_party/WebKit/Source/core/css/StyleElement.cpp
[modify] https://crrev.com/0e466ff6c591b29e2e97bda6a5841f9180401781/third_party/WebKit/Source/core/css/StyleEngineTest.cpp
[modify] https://crrev.com/0e466ff6c591b29e2e97bda6a5841f9180401781/third_party/WebKit/Source/core/css/StyleSheet.h
[modify] https://crrev.com/0e466ff6c591b29e2e97bda6a5841f9180401781/third_party/WebKit/Source/core/css/TreeScopeStyleSheetCollection.cpp

Status: Fixed (was: Started)

Sign in to add a comment