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

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

Issue 2614663004: Pause HTML parser for external stylesheets in the body (Closed)
Patch Set: Paramaterized test cases 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 3347 matching lines...) Expand 10 before | Expand all | Expand 10 after
3358 } 3358 }
3359 3359
3360 void Document::didLoadAllImports() { 3360 void Document::didLoadAllImports() {
3361 if (!haveScriptBlockingStylesheetsLoaded()) 3361 if (!haveScriptBlockingStylesheetsLoaded())
3362 return; 3362 return;
3363 if (!importLoader()) 3363 if (!importLoader())
3364 styleResolverMayHaveChanged(); 3364 styleResolverMayHaveChanged();
3365 didLoadAllScriptBlockingResources(); 3365 didLoadAllScriptBlockingResources();
3366 } 3366 }
3367 3367
3368 void Document::didAddPendingStylesheetInBody() {
3369 if (ScriptableDocumentParser* parser = scriptableDocumentParser())
3370 parser->didAddPendingStylesheetInBody();
3371 }
3372
3368 void Document::didRemoveAllPendingStylesheet() { 3373 void Document::didRemoveAllPendingStylesheet() {
3369 styleResolverMayHaveChanged(); 3374 styleResolverMayHaveChanged();
3370 3375
3371 // Only imports on master documents can trigger rendering. 3376 // Only imports on master documents can trigger rendering.
3372 if (HTMLImportLoader* import = importLoader()) 3377 if (HTMLImportLoader* import = importLoader())
3373 import->didRemoveAllPendingStylesheet(); 3378 import->didRemoveAllPendingStylesheet();
3374 if (!haveImportsLoaded()) 3379 if (!haveImportsLoaded())
3375 return; 3380 return;
3376 didLoadAllScriptBlockingResources(); 3381 didLoadAllScriptBlockingResources();
3377 } 3382 }
3378 3383
3384 void Document::didRemoveAllPendingBodyStylesheets() {
3385 if (ScriptableDocumentParser* parser = scriptableDocumentParser())
3386 parser->didLoadAllBodyStylesheets();
3387 }
3388
3379 void Document::didLoadAllScriptBlockingResources() { 3389 void Document::didLoadAllScriptBlockingResources() {
3380 // Use wrapWeakPersistent because the task should not keep this Document alive 3390 // Use wrapWeakPersistent because the task should not keep this Document alive
3381 // just for executing scripts. 3391 // just for executing scripts.
3382 m_executeScriptsWaitingForResourcesTaskHandle = 3392 m_executeScriptsWaitingForResourcesTaskHandle =
3383 TaskRunnerHelper::get(TaskType::Networking, this) 3393 TaskRunnerHelper::get(TaskType::Networking, this)
3384 ->postCancellableTask( 3394 ->postCancellableTask(
3385 BLINK_FROM_HERE, 3395 BLINK_FROM_HERE,
3386 WTF::bind(&Document::executeScriptsWaitingForResources, 3396 WTF::bind(&Document::executeScriptsWaitingForResources,
3387 wrapWeakPersistent(this))); 3397 wrapWeakPersistent(this)));
3388 3398
(...skipping 3141 matching lines...) Expand 10 before | Expand all | Expand 10 after
6530 } 6540 }
6531 6541
6532 void showLiveDocumentInstances() { 6542 void showLiveDocumentInstances() {
6533 WeakDocumentSet& set = liveDocumentSet(); 6543 WeakDocumentSet& set = liveDocumentSet();
6534 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6544 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6535 for (Document* document : set) 6545 for (Document* document : set)
6536 fprintf(stderr, "- Document %p URL: %s\n", document, 6546 fprintf(stderr, "- Document %p URL: %s\n", document,
6537 document->url().getString().utf8().data()); 6547 document->url().getString().utf8().data());
6538 } 6548 }
6539 #endif 6549 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/ScriptableDocumentParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698