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

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

Issue 757583002: Revert of Use Shadow DOM to display fallback content for images (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/editing/TextIterator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Updating the style on the shadow DOM for image fallback content can bring us here when imports 141 ASSERT(!styleSheetContents->isLoading());
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;
146 142
147 // See if all rules on the sheet are scoped to some specific ids or classes. 143 // See if all rules on the sheet are scoped to some specific ids or classes.
148 // Then test if we actually have any of those in the tree at the moment. 144 // Then test if we actually have any of those in the tree at the moment.
149 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport> >& importRules = styleSheetContents->importRules(); 145 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport> >& importRules = styleSheetContents->importRules();
150 for (unsigned i = 0; i < importRules.size(); ++i) { 146 for (unsigned i = 0; i < importRules.size(); ++i) {
151 if (!importRules[i]->styleSheet()) 147 if (!importRules[i]->styleSheet())
152 continue; 148 continue;
153 analyzeStyleSheet(importRules[i]->styleSheet()); 149 analyzeStyleSheet(importRules[i]->styleSheet());
154 if (m_dirtiesAllStyle) 150 if (m_dirtiesAllStyle)
155 return; 151 return;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 element->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonFo rTracing::create(StyleChangeReason::StyleSheetChange)); 207 element->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonFo rTracing::create(StyleChangeReason::StyleSheetChange));
212 // The whole subtree is now invalidated, we can skip to the next sib ling. 208 // The whole subtree is now invalidated, we can skip to the next sib ling.
213 element = ElementTraversal::nextSkippingChildren(*element); 209 element = ElementTraversal::nextSkippingChildren(*element);
214 continue; 210 continue;
215 } 211 }
216 element = ElementTraversal::next(*element); 212 element = ElementTraversal::next(*element);
217 } 213 }
218 } 214 }
219 215
220 } 216 }
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/editing/TextIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698