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

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

Issue 11612021: Revert 137939 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 8 years 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
« no previous file with comments | « Source/WebCore/dom/Document.h ('k') | Source/WebCore/dom/Node.cpp » ('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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 , m_isAnimatingFullScreen(false) 491 , m_isAnimatingFullScreen(false)
492 #endif 492 #endif
493 , m_loadEventDelayCount(0) 493 , m_loadEventDelayCount(0)
494 , m_loadEventDelayTimer(this, &Document::loadEventDelayTimerFired) 494 , m_loadEventDelayTimer(this, &Document::loadEventDelayTimerFired)
495 , m_referrerPolicy(ReferrerPolicyDefault) 495 , m_referrerPolicy(ReferrerPolicyDefault)
496 , m_directionSetOnDocumentElement(false) 496 , m_directionSetOnDocumentElement(false)
497 , m_writingModeSetOnDocumentElement(false) 497 , m_writingModeSetOnDocumentElement(false)
498 , m_writeRecursionIsTooDeep(false) 498 , m_writeRecursionIsTooDeep(false)
499 , m_writeRecursionDepth(0) 499 , m_writeRecursionDepth(0)
500 , m_wheelEventHandlerCount(0) 500 , m_wheelEventHandlerCount(0)
501 #if ENABLE(TOUCH_EVENTS)
502 , m_touchEventHandlerCount(0)
503 #endif
501 , m_pendingTasksTimer(this, &Document::pendingTasksTimerFired) 504 , m_pendingTasksTimer(this, &Document::pendingTasksTimerFired)
502 , m_scheduledTasksAreSuspended(false) 505 , m_scheduledTasksAreSuspended(false)
503 , m_visualUpdatesAllowed(true) 506 , m_visualUpdatesAllowed(true)
504 , m_visualUpdatesSuppressionTimer(this, &Document::visualUpdatesSuppressionT imerFired) 507 , m_visualUpdatesSuppressionTimer(this, &Document::visualUpdatesSuppressionT imerFired)
505 , m_sharedObjectPoolClearTimer(this, &Document::sharedObjectPoolClearTimerFi red) 508 , m_sharedObjectPoolClearTimer(this, &Document::sharedObjectPoolClearTimerFi red)
506 #ifndef NDEBUG 509 #ifndef NDEBUG
507 , m_didDispatchViewportPropertiesChanged(false) 510 , m_didDispatchViewportPropertiesChanged(false)
508 #endif 511 #endif
509 { 512 {
510 m_document = this; 513 m_document = this;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 Document::~Document() 606 Document::~Document()
604 { 607 {
605 ASSERT(!renderer()); 608 ASSERT(!renderer());
606 ASSERT(!m_inPageCache); 609 ASSERT(!m_inPageCache);
607 ASSERT(!m_savedRenderer); 610 ASSERT(!m_savedRenderer);
608 ASSERT(m_ranges.isEmpty()); 611 ASSERT(m_ranges.isEmpty());
609 ASSERT(!m_styleRecalcTimer.isActive()); 612 ASSERT(!m_styleRecalcTimer.isActive());
610 ASSERT(!m_parentTreeScope); 613 ASSERT(!m_parentTreeScope);
611 ASSERT(!m_guardRefCount); 614 ASSERT(!m_guardRefCount);
612 615
613 #if ENABLE(TOUCH_EVENT_TRACKING)
614 if (Document* ownerDocument = this->ownerDocument())
615 ownerDocument->didRemoveEventTargetNode(this);
616 #endif
617 // FIXME: Should we reset m_domWindow when we detach from the Frame? 616 // FIXME: Should we reset m_domWindow when we detach from the Frame?
618 if (m_domWindow) 617 if (m_domWindow)
619 m_domWindow->resetUnlessSuspendedForPageCache(); 618 m_domWindow->resetUnlessSuspendedForPageCache();
620 619
621 m_scriptRunner.clear(); 620 m_scriptRunner.clear();
622 621
623 histogramMutationEventUsage(m_listenerTypes); 622 histogramMutationEventUsage(m_listenerTypes);
624 623
625 removeAllEventListeners(); 624 removeAllEventListeners();
626 625
(...skipping 4966 matching lines...) Expand 10 before | Expand all | Expand 10 after
5593 { 5592 {
5594 ASSERT(m_wheelEventHandlerCount > 0); 5593 ASSERT(m_wheelEventHandlerCount > 0);
5595 --m_wheelEventHandlerCount; 5594 --m_wheelEventHandlerCount;
5596 Frame* mainFrame = page() ? page()->mainFrame() : 0; 5595 Frame* mainFrame = page() ? page()->mainFrame() : 0;
5597 if (mainFrame) 5596 if (mainFrame)
5598 mainFrame->notifyChromeClientWheelEventHandlerCountChanged(); 5597 mainFrame->notifyChromeClientWheelEventHandlerCountChanged();
5599 5598
5600 wheelEventHandlerCountChanged(this); 5599 wheelEventHandlerCountChanged(this);
5601 } 5600 }
5602 5601
5603 void Document::didAddTouchEventHandler(Node* handler) 5602 void Document::didAddTouchEventHandler()
5604 { 5603 {
5605 #if ENABLE(TOUCH_EVENTS) 5604 #if ENABLE(TOUCH_EVENTS)
5606 if (!m_touchEventTargets.get()) 5605 ++m_touchEventHandlerCount;
5607 m_touchEventTargets = adoptPtr(new TouchEventTargetSet); 5606 if (m_touchEventHandlerCount > 1)
5608 m_touchEventTargets->add(handler);
5609 if (Document* parent = parentDocument()) {
5610 parent->didAddTouchEventHandler(this);
5611 return; 5607 return;
5612 } 5608 if (Page* page = this->page())
5613 if (Page* page = this->page()) { 5609 page->chrome()->client()->needTouchEvents(true);
5614 #if ENABLE(TOUCH_EVENT_TRACKING)
5615 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordina tor())
5616 scrollingCoordinator->touchEventTargetRectsDidChange(this);
5617 #endif
5618 if (m_touchEventTargets->size() == 1)
5619 page->chrome()->client()->needTouchEvents(true);
5620 }
5621 #else
5622 UNUSED_PARAM(handler);
5623 #endif 5610 #endif
5624 } 5611 }
5625 5612
5626 void Document::didRemoveTouchEventHandler(Node* handler) 5613 void Document::didRemoveTouchEventHandler()
5627 { 5614 {
5628 #if ENABLE(TOUCH_EVENTS) 5615 #if ENABLE(TOUCH_EVENTS)
5629 if (!m_touchEventTargets.get()) 5616 ASSERT(m_touchEventHandlerCount);
5617 --m_touchEventHandlerCount;
5618 if (m_touchEventHandlerCount)
5630 return; 5619 return;
5631 ASSERT(m_touchEventTargets->contains(handler));
5632 m_touchEventTargets->remove(handler);
5633 if (Document* parent = parentDocument()) {
5634 parent->didRemoveTouchEventHandler(this);
5635 return;
5636 }
5637 5620
5638 Page* page = this->page(); 5621 Page* page = this->page();
5639 if (!page) 5622 if (!page)
5640 return; 5623 return;
5641 #if ENABLE(TOUCH_EVENT_TRACKING)
5642 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator( ))
5643 scrollingCoordinator->touchEventTargetRectsDidChange(this);
5644 #endif
5645 if (m_touchEventTargets->size())
5646 return;
5647 for (const Frame* frame = page->mainFrame(); frame; frame = frame->tree()->t raverseNext()) { 5624 for (const Frame* frame = page->mainFrame(); frame; frame = frame->tree()->t raverseNext()) {
5648 if (frame->document() && frame->document()->hasTouchEventHandlers()) 5625 if (frame->document() && frame->document()->touchEventHandlerCount())
5649 return; 5626 return;
5650 } 5627 }
5651 page->chrome()->client()->needTouchEvents(false); 5628 page->chrome()->client()->needTouchEvents(false);
5652 #else
5653 UNUSED_PARAM(handler);
5654 #endif 5629 #endif
5655 } 5630 }
5656 5631
5657 #if ENABLE(TOUCH_EVENT_TRACKING)
5658 void Document::didRemoveEventTargetNode(Node* handler)
5659 {
5660 if (m_touchEventTargets.get())
5661 m_touchEventTargets->removeAll(handler);
5662 }
5663 #endif
5664
5665 HTMLIFrameElement* Document::seamlessParentIFrame() const 5632 HTMLIFrameElement* Document::seamlessParentIFrame() const
5666 { 5633 {
5667 if (!shouldDisplaySeamlesslyWithParent()) 5634 if (!shouldDisplaySeamlesslyWithParent())
5668 return 0; 5635 return 0;
5669 5636
5670 HTMLFrameOwnerElement* ownerElement = this->ownerElement(); 5637 HTMLFrameOwnerElement* ownerElement = this->ownerElement();
5671 ASSERT(ownerElement->hasTagName(iframeTag)); 5638 ASSERT(ownerElement->hasTagName(iframeTag));
5672 return static_cast<HTMLIFrameElement*>(ownerElement); 5639 return static_cast<HTMLIFrameElement*>(ownerElement);
5673 } 5640 }
5674 5641
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
5971 m_templateContentsOwnerDocument = HTMLDocument::create(0, blankURL() ); 5938 m_templateContentsOwnerDocument = HTMLDocument::create(0, blankURL() );
5972 else 5939 else
5973 m_templateContentsOwnerDocument = Document::create(0, blankURL()); 5940 m_templateContentsOwnerDocument = Document::create(0, blankURL());
5974 } 5941 }
5975 5942
5976 return m_templateContentsOwnerDocument.get(); 5943 return m_templateContentsOwnerDocument.get();
5977 } 5944 }
5978 #endif 5945 #endif
5979 5946
5980 } // namespace WebCore 5947 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/dom/Document.h ('k') | Source/WebCore/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698