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

Side by Side Diff: Source/core/css/invalidation/StyleSheetInvalidationAnalysis.cpp

Issue 481753002: Use Shadow DOM to display fallback content for images (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 case StyleRule::Keyframe: 131 case StyleRule::Keyframe:
132 case StyleRule::Style: 132 case StyleRule::Style:
133 break; 133 break;
134 } 134 }
135 ASSERT_NOT_REACHED(); 135 ASSERT_NOT_REACHED();
136 return true; 136 return true;
137 } 137 }
138 138
139 void StyleSheetInvalidationAnalysis::analyzeStyleSheet(StyleSheetContents* style SheetContents) 139 void StyleSheetInvalidationAnalysis::analyzeStyleSheet(StyleSheetContents* style SheetContents)
140 { 140 {
141 ASSERT(!styleSheetContents->isLoading()); 141 // Updating the style on the shadow DOM for image fallback content can bring us here when imports
142 // are still getting loaded in the main document. Just need to exit early as we will return here
143 // when the imports finish loading.
144 if (styleSheetContents->isLoading())
145 return;
142 146
143 // See if all rules on the sheet are scoped to some specific ids or classes. 147 // See if all rules on the sheet are scoped to some specific ids or classes.
144 // Then test if we actually have any of those in the tree at the moment. 148 // Then test if we actually have any of those in the tree at the moment.
145 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport> >& importRules = styleSheetContents->importRules(); 149 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport> >& importRules = styleSheetContents->importRules();
146 for (unsigned i = 0; i < importRules.size(); ++i) { 150 for (unsigned i = 0; i < importRules.size(); ++i) {
147 if (!importRules[i]->styleSheet()) 151 if (!importRules[i]->styleSheet())
148 continue; 152 continue;
149 analyzeStyleSheet(importRules[i]->styleSheet()); 153 analyzeStyleSheet(importRules[i]->styleSheet());
150 if (m_dirtiesAllStyle) 154 if (m_dirtiesAllStyle)
151 return; 155 return;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 element->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonFo rTracing::create(StyleChangeReason::StyleSheetChange)); 211 element->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonFo rTracing::create(StyleChangeReason::StyleSheetChange));
208 // The whole subtree is now invalidated, we can skip to the next sib ling. 212 // The whole subtree is now invalidated, we can skip to the next sib ling.
209 element = ElementTraversal::nextSkippingChildren(*element); 213 element = ElementTraversal::nextSkippingChildren(*element);
210 continue; 214 continue;
211 } 215 }
212 element = ElementTraversal::next(*element); 216 element = ElementTraversal::next(*element);
213 } 217 }
214 } 218 }
215 219
216 } 220 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698