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

Unified Diff: Source/core/dom/StyleElement.cpp

Issue 1032033002: Fire error events for a variety of script and style failures. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed test failures Created 5 years, 9 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
« no previous file with comments | « Source/core/dom/StyleElement.h ('k') | Source/core/html/HTMLLinkElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/StyleElement.cpp
diff --git a/Source/core/dom/StyleElement.cpp b/Source/core/dom/StyleElement.cpp
index 445121bcb2b1d74c1dc45cf84331557cdb1d719c..d409c28be322aa27edf24385d64231aba2decf55 100644
--- a/Source/core/dom/StyleElement.cpp
+++ b/Source/core/dom/StyleElement.cpp
@@ -62,7 +62,7 @@ StyleElement::~StyleElement()
#endif
}
-void StyleElement::processStyleSheet(Document& document, Element* element)
+StyleElement::ProcessingResult StyleElement::processStyleSheet(Document& document, Element* element)
{
TRACE_EVENT0("blink", "StyleElement::processStyleSheet");
ASSERT(element);
@@ -71,9 +71,9 @@ void StyleElement::processStyleSheet(Document& document, Element* element)
m_registeredAsCandidate = true;
document.styleEngine().addStyleSheetCandidateNode(element, m_createdByParser);
if (m_createdByParser)
- return;
+ return ProcessingSuccessful;
- process(element);
+ return process(element);
}
void StyleElement::insertedInto(Element* element, ContainerNode* insertionPoint)
@@ -121,27 +121,28 @@ void StyleElement::clearDocumentData(Document& document, Element* element)
}
}
-void StyleElement::childrenChanged(Element* element)
+StyleElement::ProcessingResult StyleElement::childrenChanged(Element* element)
{
ASSERT(element);
if (m_createdByParser)
- return;
+ return ProcessingSuccessful;
- process(element);
+ return process(element);
}
-void StyleElement::finishParsingChildren(Element* element)
+StyleElement::ProcessingResult StyleElement::finishParsingChildren(Element* element)
{
ASSERT(element);
- process(element);
+ ProcessingResult result = process(element);
m_createdByParser = false;
+ return result;
}
-void StyleElement::process(Element* element)
+StyleElement::ProcessingResult StyleElement::process(Element* element)
{
if (!element || !element->inDocument())
- return;
- createSheet(element, element->textFromChildren());
+ return ProcessingSuccessful;
+ return createSheet(element, element->textFromChildren());
}
void StyleElement::clearSheet(Element* ownerElement)
@@ -169,7 +170,7 @@ static bool shouldBypassMainWorldCSP(Element* element)
return false;
}
-void StyleElement::createSheet(Element* e, const String& text)
+StyleElement::ProcessingResult StyleElement::createSheet(Element* e, const String& text)
{
ASSERT(e);
ASSERT(e->inDocument());
@@ -201,6 +202,8 @@ void StyleElement::createSheet(Element* e, const String& text)
if (m_sheet)
m_sheet->contents()->checkLoaded();
+
+ return passesContentSecurityPolicyChecks ? ProcessingSuccessful : ProcessingFatalError;
}
bool StyleElement::isLoading() const
« no previous file with comments | « Source/core/dom/StyleElement.h ('k') | Source/core/html/HTMLLinkElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698