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

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

Issue 1329553004: Add a FOUC painting test. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix build. Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/frame/FrameView.h » ('j') | 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) 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 static bool acceptsEditingFocus(const Element& element) 333 static bool acceptsEditingFocus(const Element& element)
334 { 334 {
335 ASSERT(element.hasEditableStyle()); 335 ASSERT(element.hasEditableStyle());
336 336
337 return element.document().frame() && element.rootEditableElement(); 337 return element.document().frame() && element.rootEditableElement();
338 } 338 }
339 339
340 uint64_t Document::s_globalTreeVersion = 0; 340 uint64_t Document::s_globalTreeVersion = 0;
341 341
342 static bool s_threadedParsingEnabledForUnitTests = true; 342 static bool s_threadedParsingEnabledForTesting = true;
343 343
344 Document::WeakDocumentSet& Document::liveDocumentSet() 344 Document::WeakDocumentSet& Document::liveDocumentSet()
345 { 345 {
346 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WeakDocumentSet>, set, (adoptPtrW illBeNoop(new WeakDocumentSet()))); 346 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WeakDocumentSet>, set, (adoptPtrW illBeNoop(new WeakDocumentSet())));
347 return *set; 347 return *set;
348 } 348 }
349 349
350 // This class doesn't work with non-Document ExecutionContext. 350 // This class doesn't work with non-Document ExecutionContext.
351 class AutofocusTask final : public ExecutionContextTask { 351 class AutofocusTask final : public ExecutionContextTask {
352 public: 352 public:
(...skipping 2027 matching lines...) Expand 10 before | Expand all | Expand 10 after
2380 2380
2381 PassRefPtrWillBeRawPtr<DocumentParser> Document::implicitOpen(ParserSynchronizat ionPolicy parserSyncPolicy) 2381 PassRefPtrWillBeRawPtr<DocumentParser> Document::implicitOpen(ParserSynchronizat ionPolicy parserSyncPolicy)
2382 { 2382 {
2383 cancelParsing(); 2383 cancelParsing();
2384 2384
2385 removeChildren(); 2385 removeChildren();
2386 ASSERT(!m_focusedElement); 2386 ASSERT(!m_focusedElement);
2387 2387
2388 setCompatibilityMode(NoQuirksMode); 2388 setCompatibilityMode(NoQuirksMode);
2389 2389
2390 if (!threadedParsingEnabledForUnitTestsOnly()) 2390 if (!threadedParsingEnabledForTesting())
2391 parserSyncPolicy = ForceSynchronousParsing; 2391 parserSyncPolicy = ForceSynchronousParsing;
2392 2392
2393 m_parserSyncPolicy = parserSyncPolicy; 2393 m_parserSyncPolicy = parserSyncPolicy;
2394 m_parser = createParser(); 2394 m_parser = createParser();
2395 setParsingState(Parsing); 2395 setParsingState(Parsing);
2396 setReadyState(Loading); 2396 setReadyState(Loading);
2397 2397
2398 return m_parser; 2398 return m_parser;
2399 } 2399 }
2400 2400
(...skipping 2828 matching lines...) Expand 10 before | Expand all | Expand 10 after
5229 void Document::adjustFloatRectForScrollAndAbsoluteZoom(FloatRect& rect, LayoutOb ject& layoutObject) 5229 void Document::adjustFloatRectForScrollAndAbsoluteZoom(FloatRect& rect, LayoutOb ject& layoutObject)
5230 { 5230 {
5231 if (!view()) 5231 if (!view())
5232 return; 5232 return;
5233 5233
5234 LayoutRect visibleContentRect(view()->visibleContentRect()); 5234 LayoutRect visibleContentRect(view()->visibleContentRect());
5235 rect.move(-FloatSize(visibleContentRect.x().toFloat(), visibleContentRect.y( ).toFloat())); 5235 rect.move(-FloatSize(visibleContentRect.x().toFloat(), visibleContentRect.y( ).toFloat()));
5236 adjustFloatRectForAbsoluteZoom(rect, layoutObject); 5236 adjustFloatRectForAbsoluteZoom(rect, layoutObject);
5237 } 5237 }
5238 5238
5239 void Document::setThreadedParsingEnabledForUnitTestsOnly(bool enabled) 5239 void Document::setThreadedParsingEnabledForTesting(bool enabled)
5240 { 5240 {
5241 s_threadedParsingEnabledForUnitTests = enabled; 5241 s_threadedParsingEnabledForTesting = enabled;
5242 } 5242 }
5243 5243
5244 bool Document::threadedParsingEnabledForUnitTestsOnly() 5244 bool Document::threadedParsingEnabledForTesting()
5245 { 5245 {
5246 return s_threadedParsingEnabledForUnitTests; 5246 return s_threadedParsingEnabledForTesting;
5247 } 5247 }
5248 5248
5249 bool Document::hasActiveParser() 5249 bool Document::hasActiveParser()
5250 { 5250 {
5251 return m_activeParserCount || (m_parser && m_parser->processingData()); 5251 return m_activeParserCount || (m_parser && m_parser->processingData());
5252 } 5252 }
5253 5253
5254 void Document::setContextFeatures(ContextFeatures& features) 5254 void Document::setContextFeatures(ContextFeatures& features)
5255 { 5255 {
5256 m_contextFeatures = PassRefPtrWillBeRawPtr<ContextFeatures>(features); 5256 m_contextFeatures = PassRefPtrWillBeRawPtr<ContextFeatures>(features);
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
5724 #ifndef NDEBUG 5724 #ifndef NDEBUG
5725 using namespace blink; 5725 using namespace blink;
5726 void showLiveDocumentInstances() 5726 void showLiveDocumentInstances()
5727 { 5727 {
5728 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 5728 Document::WeakDocumentSet& set = Document::liveDocumentSet();
5729 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5729 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5730 for (Document* document : set) 5730 for (Document* document : set)
5731 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5731 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5732 } 5732 }
5733 #endif 5733 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/frame/FrameView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698