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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp

Issue 1913833002: Current work-in-progress crbug.com/567021 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed html import issue. Created 4 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * Copyright (C) 2012 Google Inc. All rights reserved. 5 * Copyright (C) 2012 Google Inc. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 ruleSet.fontFaceRules(); 76 ruleSet.fontFaceRules();
77 for (auto& fontFaceRule : fontFaceRules) { 77 for (auto& fontFaceRule : fontFaceRules) {
78 if (FontFace* fontFace = FontFace::create(&document, fontFaceRule)) 78 if (FontFace* fontFace = FontFace::create(&document, fontFaceRule))
79 cssFontSelector->fontFaceCache()->add(cssFontSelector, fontFaceRule, 79 cssFontSelector->fontFaceCache()->add(cssFontSelector, fontFaceRule,
80 fontFace); 80 fontFace);
81 } 81 }
82 if (fontFaceRules.size() && document.styleResolver()) 82 if (fontFaceRules.size() && document.styleResolver())
83 document.styleResolver()->invalidateMatchedPropertiesCache(); 83 document.styleResolver()->invalidateMatchedPropertiesCache();
84 } 84 }
85 85
86 void ScopedStyleResolver::appendCSSStyleSheet(CSSStyleSheet& cssSheet) {
87 RuleSet* ruleSet =
88 treeScope().document().styleEngine().ruleSetForSheet(cssSheet);
89
90 m_viewportDependentMediaQueryResults.appendVector(
91 cssSheet.viewportDependentMediaQueryResults());
92 m_deviceDependentMediaQueryResults.appendVector(
93 cssSheet.deviceDependentMediaQueryResults());
94 if (!ruleSet)
95 return;
96
97 unsigned index = m_authorStyleSheets.size();
98 m_authorStyleSheets.append(&cssSheet);
99 addKeyframeRules(*ruleSet);
100 addFontFaceRules(*ruleSet);
101 addTreeBoundaryCrossingRules(*ruleSet, &cssSheet, index);
102 }
103
104 void ScopedStyleResolver::appendActiveStyleSheets( 86 void ScopedStyleResolver::appendActiveStyleSheets(
105 unsigned index, 87 unsigned index,
106 const ActiveStyleSheetVector& activeSheets) { 88 const ActiveStyleSheetVector& activeSheets) {
107 for (auto activeIterator = activeSheets.begin() + index; 89 for (auto activeIterator = activeSheets.begin() + index;
108 activeIterator != activeSheets.end(); activeIterator++) { 90 activeIterator != activeSheets.end(); activeIterator++) {
109 CSSStyleSheet* sheet = activeIterator->first; 91 CSSStyleSheet* sheet = activeIterator->first;
110 m_viewportDependentMediaQueryResults.appendVector( 92 m_viewportDependentMediaQueryResults.appendVector(
111 sheet->viewportDependentMediaQueryResults()); 93 sheet->viewportDependentMediaQueryResults());
112 m_deviceDependentMediaQueryResults.appendVector( 94 m_deviceDependentMediaQueryResults.appendVector(
113 sheet->deviceDependentMediaQueryResults()); 95 sheet->deviceDependentMediaQueryResults());
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 m_treeBoundaryCrossingRuleSet->append( 297 m_treeBoundaryCrossingRuleSet->append(
316 RuleSubSet::create(parentStyleSheet, sheetIndex, ruleSetForScope)); 298 RuleSubSet::create(parentStyleSheet, sheetIndex, ruleSetForScope));
317 } 299 }
318 300
319 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) { 301 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) {
320 visitor->trace(m_parentStyleSheet); 302 visitor->trace(m_parentStyleSheet);
321 visitor->trace(m_ruleSet); 303 visitor->trace(m_ruleSet);
322 } 304 }
323 305
324 } // namespace blink 306 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698