Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp

Issue 803133002: Use invalidation sets for fullscreen pseudos. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Load fullscreen.css on demand Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp b/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp
index 18ba58984796f5d3acb34b5da28ad571275c78ab..24758d9950625ff98168b1b123620e30210467cd 100644
--- a/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp
+++ b/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp
@@ -165,20 +165,21 @@ void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(const Element& el
changedDefaultStyle = true;
}
- // FIXME: This only works because we Force recalc the entire document so the new sheet
- // is loaded for <html> and the correct styles apply to everyone.
- if (!m_fullscreenStyleSheet && Fullscreen::isFullScreen(element.document())) {
- String fullscreenRules = loadResourceAsASCIIString("fullscreen.css") + LayoutTheme::theme().extraFullScreenStyleSheet();
- m_fullscreenStyleSheet = parseUASheet(fullscreenRules);
- m_defaultStyle->addRulesFromSheet(fullscreenStyleSheet(), screenEval());
- m_defaultQuirksStyle->addRulesFromSheet(fullscreenStyleSheet(), screenEval());
- changedDefaultStyle = true;
- }
-
ASSERT(!m_defaultStyle->features().hasIdsInSelectors());
ASSERT(m_defaultStyle->features().siblingRules.isEmpty());
}
+void CSSDefaultStyleSheets::ensureDefaultStyleSheetForFullscreen()
+{
+ if (m_fullscreenStyleSheet)
+ return;
+
+ String fullscreenRules = loadResourceAsASCIIString("fullscreen.css") + LayoutTheme::theme().extraFullScreenStyleSheet();
+ m_fullscreenStyleSheet = parseUASheet(fullscreenRules);
+ m_defaultStyle->addRulesFromSheet(fullscreenStyleSheet(), screenEval());
+ m_defaultQuirksStyle->addRulesFromSheet(fullscreenStyleSheet(), screenEval());
+}
+
DEFINE_TRACE(CSSDefaultStyleSheets)
{
visitor->trace(m_defaultStyle);
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.h ('k') | third_party/WebKit/Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698