Chromium Code Reviews| Index: Source/core/dom/Document.cpp |
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
| index 5ef85b8c99b269694a820145e9b53603cb2d594f..6fb1c88767aac1bc9baf56c181d1db5128efe109 100644 |
| --- a/Source/core/dom/Document.cpp |
| +++ b/Source/core/dom/Document.cpp |
| @@ -463,7 +463,7 @@ Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC |
| , m_visitedLinkState(VisitedLinkState::create(*this)) |
| , m_visuallyOrdered(false) |
| , m_readyState(Complete) |
| - , m_isParsing(false) |
| + , m_parsingState(Done) |
| , m_gotoAnchorNeededAfterStylesheetsLoad(false) |
| , m_containsValidityStyleRules(false) |
| , m_updateFocusAppearanceRestoresSelection(false) |
| @@ -2376,7 +2376,7 @@ PassRefPtrWillBeRawPtr<DocumentParser> Document::implicitOpen() |
| setCompatibilityMode(NoQuirksMode); |
| m_parser = createParser(); |
| - setParsing(true); |
| + setParsingState(Parsing); |
| setReadyState(Loading); |
| return m_parser; |
| @@ -2670,11 +2670,11 @@ Document::PageDismissalType Document::pageDismissalEventBeingDispatched() const |
| return NoDismissal; |
| } |
| -void Document::setParsing(bool b) |
| +void Document::setParsingState(ParsingState parsingState) |
| { |
| - m_isParsing = b; |
| + m_parsingState = parsingState; |
| - if (m_isParsing && !m_elementDataCache) |
| + if (m_parsingState == Parsing && !m_elementDataCache) |
|
sof
2014/11/14 21:34:02
Use parsing() instead?
Nate Chapin
2014/11/14 22:05:24
Done.
|
| m_elementDataCache = ElementDataCache::create(); |
| } |
| @@ -4430,16 +4430,16 @@ void Document::applyXSLTransform(ProcessingInstruction* pi) |
| String resultMIMEType; |
| String newSource; |
| String resultEncoding; |
| - setParsing(true); |
| + setParsingState(Parsing); |
| if (!processor->transformToString(this, resultMIMEType, newSource, resultEncoding)) { |
| - setParsing(false); |
| + setParsingState(Done); |
| return; |
| } |
| // FIXME: If the transform failed we should probably report an error (like Mozilla does). |
| LocalFrame* ownerFrame = frame(); |
| processor->createDocumentFromSource(newSource, resultEncoding, resultMIMEType, this, ownerFrame); |
| InspectorInstrumentation::frameDocumentUpdated(ownerFrame); |
| - setParsing(false); |
| + setParsingState(Done); |
| } |
| void Document::setTransformSource(PassOwnPtr<TransformSource> source) |
| @@ -4624,12 +4624,13 @@ void Document::finishedParsing() |
| { |
| ASSERT(!scriptableDocumentParser() || !m_parser->isParsing()); |
| ASSERT(!scriptableDocumentParser() || m_readyState != Loading); |
| - setParsing(false); |
| + setParsingState(InDOMContentLoaded); |
| if (!m_documentTiming.domContentLoadedEventStart) |
| m_documentTiming.domContentLoadedEventStart = monotonicallyIncreasingTime(); |
| dispatchEvent(Event::createBubble(EventTypeNames::DOMContentLoaded)); |
| if (!m_documentTiming.domContentLoadedEventEnd) |
| m_documentTiming.domContentLoadedEventEnd = monotonicallyIncreasingTime(); |
| + setParsingState(Done); |
| // The loader's finishedParsing() method may invoke script that causes this object to |
| // be dereferenced (when this document is in an iframe and the onload causes the iframe's src to change). |