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

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

Issue 2650743002: Return ActiveSheetsChanged when rulesets change in common prefix. (Closed)
Patch Set: Using bool Created 3 years, 11 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/ActiveStyleSheets.cpp
diff --git a/third_party/WebKit/Source/core/css/ActiveStyleSheets.cpp b/third_party/WebKit/Source/core/css/ActiveStyleSheets.cpp
index cca65e7a1cc18a19e12f776f23d716ee70dfc917..f40b9864473e963a5aa6fefc651ba97b6c8bc4dd 100644
--- a/third_party/WebKit/Source/core/css/ActiveStyleSheets.cpp
+++ b/third_party/WebKit/Source/core/css/ActiveStyleSheets.cpp
@@ -38,18 +38,16 @@ ActiveSheetsChange compareActiveStyleSheets(
}
if (index == oldStyleSheetCount) {
- if (index == newStyleSheetCount) {
- return changedRuleSets.isEmpty() ? NoActiveSheetsChanged
- : ActiveSheetsChanged;
- }
-
- // Sheets added at the end.
+ bool ruleSetsChanged = !changedRuleSets.isEmpty();
sashab 2017/01/25 02:45:00 Hmm, is this the same logic as before? This is way
meade_UTC10 2017/01/25 05:14:40 I don't think that'd have the same behaviour, Sash
rune 2017/01/25 08:57:34 The isEmpty check must be done before the for-loop
rune 2017/01/25 08:57:34 Those are two different tests. The test here is th
for (; index < newStyleSheetCount; index++) {
if (newStyleSheets[index].second)
changedRuleSets.add(newStyleSheets[index].second);
}
- return changedRuleSets.isEmpty() ? NoActiveSheetsChanged
- : ActiveSheetsAppended;
+ if (ruleSetsChanged)
+ return ActiveSheetsChanged;
+ if (changedRuleSets.isEmpty())
+ return NoActiveSheetsChanged;
+ return ActiveSheetsAppended;
}
if (index == newStyleSheetCount) {

Powered by Google App Engine
This is Rietveld 408576698