| 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_threadedParsingEnabledForTesting = true; | 342 static bool s_threadedParsingEnabledForUnitTests = 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 Loading... |
| 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 (!threadedParsingEnabledForTesting()) | 2390 if (!threadedParsingEnabledForUnitTestsOnly()) |
| 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 2825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5226 void Document::adjustFloatRectForScrollAndAbsoluteZoom(FloatRect& rect, LayoutOb
ject& layoutObject) | 5226 void Document::adjustFloatRectForScrollAndAbsoluteZoom(FloatRect& rect, LayoutOb
ject& layoutObject) |
| 5227 { | 5227 { |
| 5228 if (!view()) | 5228 if (!view()) |
| 5229 return; | 5229 return; |
| 5230 | 5230 |
| 5231 LayoutRect visibleContentRect(view()->visibleContentRect()); | 5231 LayoutRect visibleContentRect(view()->visibleContentRect()); |
| 5232 rect.move(-FloatSize(visibleContentRect.x().toFloat(), visibleContentRect.y(
).toFloat())); | 5232 rect.move(-FloatSize(visibleContentRect.x().toFloat(), visibleContentRect.y(
).toFloat())); |
| 5233 adjustFloatRectForAbsoluteZoom(rect, layoutObject); | 5233 adjustFloatRectForAbsoluteZoom(rect, layoutObject); |
| 5234 } | 5234 } |
| 5235 | 5235 |
| 5236 void Document::setThreadedParsingEnabledForTesting(bool enabled) | 5236 void Document::setThreadedParsingEnabledForUnitTestsOnly(bool enabled) |
| 5237 { | 5237 { |
| 5238 s_threadedParsingEnabledForTesting = enabled; | 5238 s_threadedParsingEnabledForUnitTests = enabled; |
| 5239 } | 5239 } |
| 5240 | 5240 |
| 5241 bool Document::threadedParsingEnabledForTesting() | 5241 bool Document::threadedParsingEnabledForUnitTestsOnly() |
| 5242 { | 5242 { |
| 5243 return s_threadedParsingEnabledForTesting; | 5243 return s_threadedParsingEnabledForUnitTests; |
| 5244 } | 5244 } |
| 5245 | 5245 |
| 5246 bool Document::hasActiveParser() | 5246 bool Document::hasActiveParser() |
| 5247 { | 5247 { |
| 5248 return m_activeParserCount || (m_parser && m_parser->processingData()); | 5248 return m_activeParserCount || (m_parser && m_parser->processingData()); |
| 5249 } | 5249 } |
| 5250 | 5250 |
| 5251 void Document::setContextFeatures(ContextFeatures& features) | 5251 void Document::setContextFeatures(ContextFeatures& features) |
| 5252 { | 5252 { |
| 5253 m_contextFeatures = PassRefPtrWillBeRawPtr<ContextFeatures>(features); | 5253 m_contextFeatures = PassRefPtrWillBeRawPtr<ContextFeatures>(features); |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5721 #ifndef NDEBUG | 5721 #ifndef NDEBUG |
| 5722 using namespace blink; | 5722 using namespace blink; |
| 5723 void showLiveDocumentInstances() | 5723 void showLiveDocumentInstances() |
| 5724 { | 5724 { |
| 5725 Document::WeakDocumentSet& set = Document::liveDocumentSet(); | 5725 Document::WeakDocumentSet& set = Document::liveDocumentSet(); |
| 5726 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5726 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 5727 for (Document* document : set) | 5727 for (Document* document : set) |
| 5728 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5728 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
| 5729 } | 5729 } |
| 5730 #endif | 5730 #endif |
| OLD | NEW |