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

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

Issue 2336693002: Rendering text to a canvas in a frame-less document. (Closed)
Patch Set: Created 4 years, 3 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 r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 , m_elementDataCacheClearTimer(this, &Document::elementDataCacheClearTimerFi red) 465 , m_elementDataCacheClearTimer(this, &Document::elementDataCacheClearTimerFi red)
466 , m_timeline(DocumentTimeline::create(this)) 466 , m_timeline(DocumentTimeline::create(this))
467 , m_compositorPendingAnimations(new CompositorPendingAnimations()) 467 , m_compositorPendingAnimations(new CompositorPendingAnimations())
468 , m_templateDocumentHost(nullptr) 468 , m_templateDocumentHost(nullptr)
469 , m_didAssociateFormControlsTimer(this, &Document::didAssociateFormControlsT imerFired) 469 , m_didAssociateFormControlsTimer(this, &Document::didAssociateFormControlsT imerFired)
470 , m_timers(TaskRunnerHelper::get(TaskType::Timer, this)->clone()) 470 , m_timers(TaskRunnerHelper::get(TaskType::Timer, this)->clone())
471 , m_hasViewportUnits(false) 471 , m_hasViewportUnits(false)
472 , m_parserSyncPolicy(AllowAsynchronousParsing) 472 , m_parserSyncPolicy(AllowAsynchronousParsing)
473 , m_nodeCount(0) 473 , m_nodeCount(0)
474 , m_visibilityWasLogged(false) 474 , m_visibilityWasLogged(false)
475 , m_settings(Settings::create())
Justin Novosad 2016/09/12 18:44:59 This should be lazily allocated in settings() inst
zakerinasab 2016/09/12 19:47:33 Done.
475 { 476 {
476 if (m_frame) { 477 if (m_frame) {
477 DCHECK(m_frame->page()); 478 DCHECK(m_frame->page());
478 provideContextFeaturesToDocumentFrom(*this, *m_frame->page()); 479 provideContextFeaturesToDocumentFrom(*this, *m_frame->page());
479 480
480 m_fetcher = m_frame->loader().documentLoader()->fetcher(); 481 m_fetcher = m_frame->loader().documentLoader()->fetcher();
481 FrameFetchContext::provideDocumentToContext(m_fetcher->context(), this); 482 FrameFetchContext::provideDocumentToContext(m_fetcher->context(), this);
482 483
483 CustomElementRegistry* registry = m_frame->localDOMWindow() 484 CustomElementRegistry* registry = m_frame->localDOMWindow()
484 ? m_frame->localDOMWindow()->maybeCustomElements() 485 ? m_frame->localDOMWindow()->maybeCustomElements()
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
1415 return m_frame ? m_frame->page() : nullptr; 1416 return m_frame ? m_frame->page() : nullptr;
1416 } 1417 }
1417 1418
1418 FrameHost* Document::frameHost() const 1419 FrameHost* Document::frameHost() const
1419 { 1420 {
1420 return m_frame ? m_frame->host() : nullptr; 1421 return m_frame ? m_frame->host() : nullptr;
1421 } 1422 }
1422 1423
1423 Settings* Document::settings() const 1424 Settings* Document::settings() const
1424 { 1425 {
1425 return m_frame ? m_frame->settings() : nullptr; 1426 if (m_frame)
1427 return m_frame->settings();
1428 return m_settings.get();
1426 } 1429 }
1427 1430
1428 Range* Document::createRange() 1431 Range* Document::createRange()
1429 { 1432 {
1430 return Range::create(*this); 1433 return Range::create(*this);
1431 } 1434 }
1432 1435
1433 NodeIterator* Document::createNodeIterator(Node* root, unsigned whatToShow, Node Filter* filter) 1436 NodeIterator* Document::createNodeIterator(Node* root, unsigned whatToShow, Node Filter* filter)
1434 { 1437 {
1435 DCHECK(root); 1438 DCHECK(root);
(...skipping 4653 matching lines...) Expand 10 before | Expand all | Expand 10 after
6089 } 6092 }
6090 6093
6091 void showLiveDocumentInstances() 6094 void showLiveDocumentInstances()
6092 { 6095 {
6093 WeakDocumentSet& set = liveDocumentSet(); 6096 WeakDocumentSet& set = liveDocumentSet();
6094 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6097 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6095 for (Document* document : set) 6098 for (Document* document : set)
6096 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6099 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6097 } 6100 }
6098 #endif 6101 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698