OLD | NEW |
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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 329 |
330 static bool acceptsEditingFocus(const Element& element) | 330 static bool acceptsEditingFocus(const Element& element) |
331 { | 331 { |
332 ASSERT(element.hasEditableStyle()); | 332 ASSERT(element.hasEditableStyle()); |
333 | 333 |
334 return element.document().frame() && element.rootEditableElement(); | 334 return element.document().frame() && element.rootEditableElement(); |
335 } | 335 } |
336 | 336 |
337 uint64_t Document::s_globalTreeVersion = 0; | 337 uint64_t Document::s_globalTreeVersion = 0; |
338 | 338 |
| 339 static bool s_threadedParsingEnabledForUnitTests = true; |
| 340 |
339 Document::WeakDocumentSet& Document::liveDocumentSet() | 341 Document::WeakDocumentSet& Document::liveDocumentSet() |
340 { | 342 { |
341 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WeakDocumentSet>, set, (adoptPtrW
illBeNoop(new WeakDocumentSet()))); | 343 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WeakDocumentSet>, set, (adoptPtrW
illBeNoop(new WeakDocumentSet()))); |
342 return *set; | 344 return *set; |
343 } | 345 } |
344 | 346 |
345 // This class doesn't work with non-Document ExecutionContext. | 347 // This class doesn't work with non-Document ExecutionContext. |
346 class AutofocusTask final : public ExecutionContextTask { | 348 class AutofocusTask final : public ExecutionContextTask { |
347 public: | 349 public: |
348 static PassOwnPtr<AutofocusTask> create() | 350 static PassOwnPtr<AutofocusTask> create() |
(...skipping 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2374 | 2376 |
2375 PassRefPtrWillBeRawPtr<DocumentParser> Document::implicitOpen(ParserSynchronizat
ionPolicy parserSyncPolicy) | 2377 PassRefPtrWillBeRawPtr<DocumentParser> Document::implicitOpen(ParserSynchronizat
ionPolicy parserSyncPolicy) |
2376 { | 2378 { |
2377 cancelParsing(); | 2379 cancelParsing(); |
2378 | 2380 |
2379 removeChildren(); | 2381 removeChildren(); |
2380 ASSERT(!m_focusedElement); | 2382 ASSERT(!m_focusedElement); |
2381 | 2383 |
2382 setCompatibilityMode(NoQuirksMode); | 2384 setCompatibilityMode(NoQuirksMode); |
2383 | 2385 |
| 2386 if (!threadedParsingEnabledForUnitTestsOnly()) |
| 2387 parserSyncPolicy = ForceSynchronousParsing; |
| 2388 |
2384 m_parserSyncPolicy = parserSyncPolicy; | 2389 m_parserSyncPolicy = parserSyncPolicy; |
2385 m_parser = createParser(); | 2390 m_parser = createParser(); |
2386 setParsingState(Parsing); | 2391 setParsingState(Parsing); |
2387 setReadyState(Loading); | 2392 setReadyState(Loading); |
2388 | 2393 |
2389 return m_parser; | 2394 return m_parser; |
2390 } | 2395 } |
2391 | 2396 |
2392 HTMLElement* Document::body() const | 2397 HTMLElement* Document::body() const |
2393 { | 2398 { |
(...skipping 2825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5219 void Document::adjustFloatRectForScrollAndAbsoluteZoom(FloatRect& rect, LayoutOb
ject& layoutObject) | 5224 void Document::adjustFloatRectForScrollAndAbsoluteZoom(FloatRect& rect, LayoutOb
ject& layoutObject) |
5220 { | 5225 { |
5221 if (!view()) | 5226 if (!view()) |
5222 return; | 5227 return; |
5223 | 5228 |
5224 LayoutRect visibleContentRect(view()->visibleContentRect()); | 5229 LayoutRect visibleContentRect(view()->visibleContentRect()); |
5225 rect.move(-FloatSize(visibleContentRect.x().toFloat(), visibleContentRect.y(
).toFloat())); | 5230 rect.move(-FloatSize(visibleContentRect.x().toFloat(), visibleContentRect.y(
).toFloat())); |
5226 adjustFloatRectForAbsoluteZoom(rect, layoutObject); | 5231 adjustFloatRectForAbsoluteZoom(rect, layoutObject); |
5227 } | 5232 } |
5228 | 5233 |
| 5234 void Document::setThreadedParsingEnabledForUnitTestsOnly(bool enabled) |
| 5235 { |
| 5236 s_threadedParsingEnabledForUnitTests = enabled; |
| 5237 } |
| 5238 |
| 5239 bool Document::threadedParsingEnabledForUnitTestsOnly() |
| 5240 { |
| 5241 return s_threadedParsingEnabledForUnitTests; |
| 5242 } |
| 5243 |
5229 bool Document::hasActiveParser() | 5244 bool Document::hasActiveParser() |
5230 { | 5245 { |
5231 return m_activeParserCount || (m_parser && m_parser->processingData()); | 5246 return m_activeParserCount || (m_parser && m_parser->processingData()); |
5232 } | 5247 } |
5233 | 5248 |
5234 void Document::setContextFeatures(ContextFeatures& features) | 5249 void Document::setContextFeatures(ContextFeatures& features) |
5235 { | 5250 { |
5236 m_contextFeatures = PassRefPtrWillBeRawPtr<ContextFeatures>(features); | 5251 m_contextFeatures = PassRefPtrWillBeRawPtr<ContextFeatures>(features); |
5237 } | 5252 } |
5238 | 5253 |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5704 #ifndef NDEBUG | 5719 #ifndef NDEBUG |
5705 using namespace blink; | 5720 using namespace blink; |
5706 void showLiveDocumentInstances() | 5721 void showLiveDocumentInstances() |
5707 { | 5722 { |
5708 Document::WeakDocumentSet& set = Document::liveDocumentSet(); | 5723 Document::WeakDocumentSet& set = Document::liveDocumentSet(); |
5709 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5724 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5710 for (Document* document : set) | 5725 for (Document* document : set) |
5711 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5726 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
5712 } | 5727 } |
5713 #endif | 5728 #endif |
OLD | NEW |