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

Side by Side Diff: third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp

Issue 1716803002: Trigger repaint on first paint only on pending stylesheet decrement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/Source/core/paint/BlockPainter.cpp ('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) 2000 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2005, 2006, 2008, 2014 Apple Inc. All rights reserved. 3 * Copyright (C) 2005, 2006, 2008, 2014 Apple Inc. All rights reserved.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2008 Holger Hans Peter Freyther 7 * Copyright (C) 2008 Holger Hans Peter Freyther
8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 21 matching lines...) Expand all
32 #include "bindings/core/v8/V8Document.h" 32 #include "bindings/core/v8/V8Document.h"
33 #include "core/HTMLNames.h" 33 #include "core/HTMLNames.h"
34 #include "core/XMLNSNames.h" 34 #include "core/XMLNSNames.h"
35 #include "core/dom/CDATASection.h" 35 #include "core/dom/CDATASection.h"
36 #include "core/dom/Comment.h" 36 #include "core/dom/Comment.h"
37 #include "core/dom/Document.h" 37 #include "core/dom/Document.h"
38 #include "core/dom/DocumentFragment.h" 38 #include "core/dom/DocumentFragment.h"
39 #include "core/dom/DocumentType.h" 39 #include "core/dom/DocumentType.h"
40 #include "core/dom/ProcessingInstruction.h" 40 #include "core/dom/ProcessingInstruction.h"
41 #include "core/dom/ScriptLoader.h" 41 #include "core/dom/ScriptLoader.h"
42 #include "core/dom/StyleEngine.h"
42 #include "core/dom/TransformSource.h" 43 #include "core/dom/TransformSource.h"
43 #include "core/fetch/FetchInitiatorTypeNames.h" 44 #include "core/fetch/FetchInitiatorTypeNames.h"
44 #include "core/fetch/RawResource.h" 45 #include "core/fetch/RawResource.h"
45 #include "core/fetch/ResourceFetcher.h" 46 #include "core/fetch/ResourceFetcher.h"
46 #include "core/fetch/ScriptResource.h" 47 #include "core/fetch/ScriptResource.h"
47 #include "core/frame/ConsoleTypes.h" 48 #include "core/frame/ConsoleTypes.h"
48 #include "core/frame/LocalFrame.h" 49 #include "core/frame/LocalFrame.h"
49 #include "core/frame/UseCounter.h" 50 #include "core/frame/UseCounter.h"
50 #include "core/html/HTMLHtmlElement.h" 51 #include "core/html/HTMLHtmlElement.h"
51 #include "core/html/HTMLTemplateElement.h" 52 #include "core/html/HTMLTemplateElement.h"
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 // doEnd() could process a script tag, thus pausing parsing. 442 // doEnd() could process a script tag, thus pausing parsing.
442 if (m_parserPaused) 443 if (m_parserPaused)
443 return; 444 return;
444 445
445 if (m_sawError) { 446 if (m_sawError) {
446 insertErrorMessageBlock(); 447 insertErrorMessageBlock();
447 } else { 448 } else {
448 updateLeafTextNode(); 449 updateLeafTextNode();
449 // Do not bail out if in a stopped state, but notify document that 450 // Do not bail out if in a stopped state, but notify document that
450 // parsing has finished. 451 // parsing has finished.
451 document()->styleResolverChanged(); 452 document()->styleEngine().resolverChanged(FullStyleUpdate);
452 } 453 }
453 454
454 if (isParsing()) 455 if (isParsing())
455 prepareToStopParsing(); 456 prepareToStopParsing();
456 document()->setReadyState(Document::Interactive); 457 document()->setReadyState(Document::Interactive);
457 clearCurrentNodeStack(); 458 clearCurrentNodeStack();
458 document()->finishedParsing(); 459 document()->finishedParsing();
459 } 460 }
460 461
461 void XMLDocumentParser::finish() 462 void XMLDocumentParser::finish()
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 bool xmlViewerMode = !m_sawError && !m_sawCSS && !m_sawXSLTransform && hasNo StyleInformation(document()); 1535 bool xmlViewerMode = !m_sawError && !m_sawCSS && !m_sawXSLTransform && hasNo StyleInformation(document());
1535 if (xmlViewerMode) { 1536 if (xmlViewerMode) {
1536 const char noStyleMessage[] = "This XML file does not appear to have any style information associated with it. The document tree is shown below."; 1537 const char noStyleMessage[] = "This XML file does not appear to have any style information associated with it. The document tree is shown below.";
1537 document()->setIsViewSource(true); 1538 document()->setIsViewSource(true);
1538 V8Document::PrivateScript::transformDocumentToTreeViewMethod(document()- >frame(), document(), noStyleMessage); 1539 V8Document::PrivateScript::transformDocumentToTreeViewMethod(document()- >frame(), document(), noStyleMessage);
1539 } else if (m_sawXSLTransform) { 1540 } else if (m_sawXSLTransform) {
1540 xmlDocPtr doc = xmlDocPtrForString(document(), m_originalSourceForTransf orm.toString(), document()->url().string()); 1541 xmlDocPtr doc = xmlDocPtrForString(document(), m_originalSourceForTransf orm.toString(), document()->url().string());
1541 document()->setTransformSource(adoptPtr(new TransformSource(doc))); 1542 document()->setTransformSource(adoptPtr(new TransformSource(doc)));
1542 // Make the document think it's done, so it will apply XSL stylesheets. 1543 // Make the document think it's done, so it will apply XSL stylesheets.
1543 document()->setParsingState(Document::FinishedParsing); 1544 document()->setParsingState(Document::FinishedParsing);
1544 document()->styleResolverChanged(); 1545 document()->styleEngine().resolverChanged(FullStyleUpdate);
1545 1546
1546 // styleResolverChanged() call can detach the parser and null out its 1547 // resolverChanged() call can detach the parser and null out its
1547 // document. In that case, we just bail out. 1548 // document. In that case, we just bail out.
1548 if (isDetached()) 1549 if (isDetached())
1549 return; 1550 return;
1550 1551
1551 document()->setParsingState(Document::Parsing); 1552 document()->setParsingState(Document::Parsing);
1552 DocumentParser::stopParsing(); 1553 DocumentParser::stopParsing();
1553 } 1554 }
1554 } 1555 }
1555 1556
1556 xmlDocPtr xmlDocPtrForString(Document* document, const String& source, const Str ing& url) 1557 xmlDocPtr xmlDocPtrForString(Document* document, const String& source, const Str ing& url)
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1698 sax.initialized = XML_SAX2_MAGIC; 1699 sax.initialized = XML_SAX2_MAGIC;
1699 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state); 1700 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state);
1700 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; 1701 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />";
1701 parseChunk(parser->context(), parseString); 1702 parseChunk(parser->context(), parseString);
1702 finishParsing(parser->context()); 1703 finishParsing(parser->context());
1703 attrsOK = state.gotAttributes; 1704 attrsOK = state.gotAttributes;
1704 return state.attributes; 1705 return state.attributes;
1705 } 1706 }
1706 1707
1707 } // namespace blink 1708 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/BlockPainter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698