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

Side by Side Diff: third_party/WebKit/Source/core/dom/StyleSheetCandidate.cpp

Issue 1867753006: Revert of Don't apply style elements or PIs with loading imports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-style-import-expected.txt ('k') | no next file » | 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 return toElement(node()).getAttribute(relAttr).contains("alternate"); 72 return toElement(node()).getAttribute(relAttr).contains("alternate");
73 } 73 }
74 74
75 bool StyleSheetCandidate::isEnabledViaScript() const 75 bool StyleSheetCandidate::isEnabledViaScript() const
76 { 76 {
77 return isHTMLLink() && toHTMLLinkElement(node()).isEnabledViaScript(); 77 return isHTMLLink() && toHTMLLinkElement(node()).isEnabledViaScript();
78 } 78 }
79 79
80 bool StyleSheetCandidate::isEnabledAndLoading() const 80 bool StyleSheetCandidate::isEnabledAndLoading() const
81 { 81 {
82 if (isHTMLLink()) 82 return isHTMLLink() && !toHTMLLinkElement(node()).isDisabled() && toHTMLLink Element(node()).styleSheetIsLoading();
83 return !toHTMLLinkElement(node()).isDisabled() && toHTMLLinkElement(node ()).styleSheetIsLoading();
84
85 StyleSheet* sheet = this->sheet();
86 return sheet && !sheet->disabled() && sheet->isLoading();
87 } 83 }
88 84
89 bool StyleSheetCandidate::hasPreferrableName() const 85 bool StyleSheetCandidate::hasPreferrableName() const
90 { 86 {
91 ASSERT(isEnabledAndLoading() || sheet()); 87 ASSERT(isEnabledAndLoading() || sheet());
92 return !isEnabledViaScript() && !title().isEmpty() && !isAlternate(); 88 return !isEnabledViaScript() && !title().isEmpty() && !isAlternate();
93 } 89 }
94 90
95 bool StyleSheetCandidate::canBeActivated(const String& currentPreferrableName) c onst 91 bool StyleSheetCandidate::canBeActivated(const String& currentPreferrableName) c onst
96 { 92 {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 return toSVGStyleElement(node()).sheet(); 139 return toSVGStyleElement(node()).sheet();
144 case Pi: 140 case Pi:
145 return toProcessingInstruction(node()).sheet(); 141 return toProcessingInstruction(node()).sheet();
146 } 142 }
147 143
148 ASSERT_NOT_REACHED(); 144 ASSERT_NOT_REACHED();
149 return 0; 145 return 0;
150 } 146 }
151 147
152 } // namespace blink 148 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-style-import-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698